aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 00:46:43 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 00:46:43 +0000
commit6d629dc95a344f1b7e3a2a5d85c121eafdfd4165 (patch)
tree4e97b92742f83f1a4ecd0d920c95c5419e3bf8ae
parent14cf958649905bf83c06ae072b8c19f051cf6c73 (diff)
downloadpaludis-6d629dc95a344f1b7e3a2a5d85c121eafdfd4165.tar.gz
paludis-6d629dc95a344f1b7e3a2a5d85c121eafdfd4165.tar.xz
More Doxygen comments.
-rw-r--r--paludis/configuration_error.cc7
-rw-r--r--paludis/configuration_error.hh16
-rw-r--r--paludis/create_insert_iterator_TEST.cc12
-rw-r--r--paludis/smart_record_TEST.cc11
-rw-r--r--paludis/strip.hh42
-rw-r--r--paludis/strip_TEST.cc26
6 files changed, 114 insertions, 0 deletions
diff --git a/paludis/configuration_error.cc b/paludis/configuration_error.cc
index 08292e4..1d8c15a 100644
--- a/paludis/configuration_error.cc
+++ b/paludis/configuration_error.cc
@@ -22,6 +22,13 @@
using namespace paludis;
+/** \file
+ * Implementation of ConfigurationError.
+ *
+ * \ingroup ConfigFile
+ * \ingroup Exception
+ */
+
ConfigurationError::ConfigurationError(const std::string & msg) throw () :
Exception(msg)
{
diff --git a/paludis/configuration_error.hh b/paludis/configuration_error.hh
index 2c9346f..4f55af7 100644
--- a/paludis/configuration_error.hh
+++ b/paludis/configuration_error.hh
@@ -23,11 +23,27 @@
#include <paludis/exception.hh>
+/** \file
+ * Declarations for the ConfigurationError class.
+ *
+ * \ingroup Exception
+ * \ingroup ConfigFile
+ */
+
namespace paludis
{
+ /**
+ * A ConfigurationError is thrown when an invalid configuration occurs.
+ *
+ * \ingroup Exception
+ * \ingroup ConfigFile
+ */
class ConfigurationError : public Exception
{
protected:
+ /**
+ * Constructor.
+ */
ConfigurationError(const std::string & msg) throw ();
};
}
diff --git a/paludis/create_insert_iterator_TEST.cc b/paludis/create_insert_iterator_TEST.cc
index d3cad94..a7f4560 100644
--- a/paludis/create_insert_iterator_TEST.cc
+++ b/paludis/create_insert_iterator_TEST.cc
@@ -27,6 +27,13 @@
using namespace paludis;
using namespace test;
+/** \file
+ * Test cases for CreateInsertIterator.
+ *
+ * \ingroup Test
+ * \ingroup Iterator
+ */
+
#ifndef DOXYGEN
struct C
{
@@ -41,6 +48,11 @@ struct C
namespace test_cases
{
+ /**
+ * \test Test create_inserter.
+ *
+ * \ingroup Test
+ */
struct CreateInsertIteratorTest : TestCase
{
CreateInsertIteratorTest() : TestCase("create insert iterator") { }
diff --git a/paludis/smart_record_TEST.cc b/paludis/smart_record_TEST.cc
index cad967c..3c1e45f 100644
--- a/paludis/smart_record_TEST.cc
+++ b/paludis/smart_record_TEST.cc
@@ -24,6 +24,12 @@
using namespace paludis;
using namespace test;
+/** \file
+ * Test cases for smart_record.hh .
+ *
+ * \ingroup Test
+ */
+
#ifndef DOXYGEN
enum PersonKeys
@@ -51,6 +57,11 @@ typedef MakeSmartRecord<PersonRecordTag>::Type Person;
namespace test_cases
{
+ /**
+ * \test Test a simple SmartRecord.
+ *
+ * \ingroup Test
+ */
struct SimpleRecordTest : TestCase
{
SimpleRecordTest() : TestCase("simple") { }
diff --git a/paludis/strip.hh b/paludis/strip.hh
index 9224f92..7fc8d07 100644
--- a/paludis/strip.hh
+++ b/paludis/strip.hh
@@ -26,14 +26,35 @@
namespace paludis
{
+ /**
+ * Return a string equal to s minus any leading characters that are
+ * contained in prefix.
+ */
std::string strip_leading_string(const std::string & s, const std::string & prefix);
+ /**
+ * Return a string equal to s, minus the string remove if remove occurs at
+ * the start of s.
+ */
std::string strip_leading(const std::string & s, const std::string & remove);
+ /**
+ * Return a string equal to s minus any trailing characters that are
+ * contained in suffix.
+ */
std::string strip_trailing_string(const std::string & s, const std::string & suffix);
+ /**
+ * Return a string equal to s, minus the string remove if remove occurs at
+ * the end of s.
+ */
std::string strip_trailing(const std::string & s, const std::string & remove);
+ /**
+ * Adapt one of the strip_ functions for use as a std::unary_function by
+ * binding a value to the second parameter (avoids the reference to const
+ * issue with std::bind2nd).
+ */
template <std::string (* f_)(const std::string &, const std::string &)>
class StripAdapter :
public std::unary_function<std::string, const std::string>
@@ -42,20 +63,41 @@ namespace paludis
const std::string _second;
public:
+ /**
+ * Constructor.
+ */
StripAdapter(const std::string & second) :
_second(second)
{
}
+ /**
+ * Operation.
+ */
std::string operator() (const std::string & first) const
{
return (*f_)(first, _second);
}
};
+ /**
+ * Adapt strip_leading_string to a functor by binding its second argument.
+ */
typedef StripAdapter<&strip_leading_string> StripLeadingString;
+
+ /**
+ * Adapt strip_leading to a functor by binding its second argument.
+ */
typedef StripAdapter<&strip_leading> StripLeading;
+
+ /**
+ * Adapt strip_trailing_string to a functor by binding its second argument.
+ */
typedef StripAdapter<&strip_trailing_string> StripTrailingString;
+
+ /**
+ * Adapt strip_trailing to a functor by binding its second argument.
+ */
typedef StripAdapter<&strip_trailing> StripTrailing;
}
diff --git a/paludis/strip_TEST.cc b/paludis/strip_TEST.cc
index 8bc924b..c0f2b37 100644
--- a/paludis/strip_TEST.cc
+++ b/paludis/strip_TEST.cc
@@ -27,8 +27,19 @@
using namespace paludis;
using namespace test;
+/** \file
+ * Test cases for strip.hh.
+ *
+ * \ingroup Test
+ */
+
namespace test_cases
{
+ /**
+ * \test Test StripLeadingString.
+ *
+ * \ingroup Test
+ */
struct StripLeadingStringTest : TestCase
{
StripLeadingStringTest() : TestCase("StripLeadingString") { }
@@ -45,6 +56,11 @@ namespace test_cases
}
} test_strip_leading_string;
+ /**
+ * \test Test StripLeading.
+ *
+ * \ingroup Test
+ */
struct StripLeadingTest : TestCase
{
StripLeadingTest() : TestCase("StripLeading") {}
@@ -61,6 +77,11 @@ namespace test_cases
}
} test_strip_leading;
+ /**
+ * \test Test StripTrailingString.
+ *
+ * \ingroup Test
+ */
struct StripTrailingStringTest : TestCase
{
StripTrailingStringTest() : TestCase("StripTrailingString") { }
@@ -77,6 +98,11 @@ namespace test_cases
}
} test_strip_trailing_string;
+ /**
+ * \test Test StripTrailing.
+ *
+ * \ingroup Test
+ */
struct StripTrailingTest : TestCase
{
StripTrailingTest() : TestCase("StripTrailing") {}