aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-09 20:21:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-09 20:21:23 +0000
commit33015df117c4eae6afac1bfda0dca56d8ca96c08 (patch)
tree52c1dc8f2e1bb489f36e10b33ae9e9eb7c66eaaa
parent65ed9efb56ad967c8349eeca61402239d6f8af9d (diff)
downloadpaludis-33015df117c4eae6afac1bfda0dca56d8ca96c08.tar.gz
paludis-33015df117c4eae6afac1bfda0dca56d8ca96c08.tar.xz
More code and doxygen cleanups
-rw-r--r--paludis/util/fs_entry.hh97
-rw-r--r--paludis/util/instantiation_policy.hh30
-rw-r--r--paludis/util/is_file_with_extension.cc12
-rw-r--r--paludis/util/is_file_with_extension.hh12
-rw-r--r--paludis/util/iterator.hh152
-rw-r--r--paludis/util/pstream.hh21
-rw-r--r--paludis/util/random.hh5
-rw-r--r--paludis/util/save.hh5
-rw-r--r--paludis/util/strip.hh8
-rw-r--r--paludis/util/system.hh16
-rw-r--r--paludis/util/tokeniser.hh8
-rw-r--r--paludis/util/validated.hh7
-rw-r--r--paludis/util/virtual_constructor.hh2
-rw-r--r--paludis/util/visitor.hh62
14 files changed, 259 insertions, 178 deletions
diff --git a/paludis/util/fs_entry.hh b/paludis/util/fs_entry.hh
index bf666ee..ceaa4e3 100644
--- a/paludis/util/fs_entry.hh
+++ b/paludis/util/fs_entry.hh
@@ -46,10 +46,12 @@ namespace paludis
class FSError : public Exception
{
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
FSError(const std::string & message) throw ();
+
+ ///\}
};
/**
@@ -110,26 +112,22 @@ namespace paludis
void _stat() const;
public:
- /**
- * Constructor, from a path.
- */
+ ///\name Basic operations
+ ///\{
+
FSEntry(const std::string & path);
- /**
- * Copy constructor.
- */
FSEntry(const FSEntry & other);
- /**
- * Destructor.
- */
~FSEntry();
- /**
- * Assignment, from another FSEntry.
- */
const FSEntry & operator= (const FSEntry & other);
+ ///\}
+
+ ///\name Modification operations
+ ///\{
+
/**
* Join with another FSEntry.
*/
@@ -154,6 +152,22 @@ namespace paludis
}
/**
+ * Return the last part of our path (eg '/foo/bar' => 'bar').
+ */
+ std::string basename() const;
+
+ /**
+ * Return the first part of our path (eg '/foo/bar' => '/foo').
+ */
+ FSEntry dirname() const;
+
+
+ ///\}
+
+ ///\name Filesystem queries
+ ///\{
+
+ /**
* Does a filesystem entry exist at our location?
*/
bool exists() const;
@@ -191,16 +205,6 @@ namespace paludis
mode_t permissions() const;
/**
- * Return the last part of our path (eg '/foo/bar' => 'bar').
- */
- std::string basename() const;
-
- /**
- * Return the first part of our path (eg '/foo/bar' => '/foo').
- */
- FSEntry dirname() const;
-
- /**
* Return the canonicalised version of our path.
*/
FSEntry realpath() const;
@@ -233,6 +237,30 @@ namespace paludis
off_t file_size() const;
/**
+ * Fetch our owner.
+ *
+ * \exception FSError If we don't exist or the stat call fails.
+ */
+ uid_t owner() const;
+
+ /**
+ * Fetch our group.
+ *
+ * \exception FSError If we don't exist or the stat call fails.
+ */
+ gid_t group() const;
+
+ /**
+ * Return the current working directory
+ */
+ static FSEntry cwd();
+
+ ///\}
+
+ ///\name Filesystem operations
+ ///\{
+
+ /**
* Try to make a directory.
*
* \return True, if we succeeded, and false if the directory
@@ -279,24 +307,7 @@ namespace paludis
*/
void chmod(const mode_t mode);
- /**
- * Fetch our owner.
- *
- * \exception FSError If we don't exist or the stat call fails.
- */
- uid_t owner() const;
-
- /**
- * Fetch our group.
- *
- * \exception FSError If we don't exist or the stat call fails.
- */
- gid_t group() const;
-
- /**
- * Return the current working directory
- */
- static FSEntry cwd();
+ ///\}
};
/**
diff --git a/paludis/util/instantiation_policy.hh b/paludis/util/instantiation_policy.hh
index 94b6e28..352c950 100644
--- a/paludis/util/instantiation_policy.hh
+++ b/paludis/util/instantiation_policy.hh
@@ -96,6 +96,9 @@ namespace paludis
const InstantiationPolicy & operator= (const InstantiationPolicy &);
protected:
+ ///\name Basic operations
+ ///\{
+
~InstantiationPolicy()
{
}
@@ -103,6 +106,8 @@ namespace paludis
InstantiationPolicy()
{
}
+
+ ///\}
};
/**
@@ -119,11 +124,16 @@ namespace paludis
const InstantiationPolicy & operator= (const InstantiationPolicy &);
protected:
+ ///\name Basic operations
+ ///\{
+
InstantiationPolicy();
~InstantiationPolicy()
{
}
+
+ ///\}
};
}
@@ -148,11 +158,19 @@ namespace paludis
static CountedPtr<OurType_, count_policy::ExternalCountTag> _instance;
protected:
+ ///\name Basic operations
+ ///\{
+
InstantiationPolicy()
{
}
+ ///\}
+
public:
+ ///\name Singleton operations
+ ///\{
+
/**
* Fetch our instance.
*/
@@ -160,6 +178,8 @@ namespace paludis
{
return _instance.raw_pointer();
}
+
+ ///\}
};
template <typename OurType_>
@@ -184,15 +204,25 @@ namespace paludis
static OurType_ * _instance;
protected:
+ ///\name Basic operations
+ ///\{
+
InstantiationPolicy()
{
}
+ ///\}
+
public:
+ ///\name Singleton operations
+ ///\{
+
/**
* Fetch our instance.
*/
static OurType_ * get_instance();
+
+ ///\}
};
template<typename OurType_>
diff --git a/paludis/util/is_file_with_extension.cc b/paludis/util/is_file_with_extension.cc
index 1310782..fa2c756 100644
--- a/paludis/util/is_file_with_extension.cc
+++ b/paludis/util/is_file_with_extension.cc
@@ -27,6 +27,18 @@ using namespace paludis;
* \ingroup grpfilesystem
*/
+IsFileWithExtension::IsFileWithExtension(const std::string & ext) :
+ _prefix(""),
+ _ext(ext)
+{
+}
+
+IsFileWithExtension::IsFileWithExtension(const std::string & prefix, const std::string & ext) :
+ _prefix(prefix),
+ _ext(ext)
+{
+}
+
bool
IsFileWithExtension::operator() (const FSEntry & f) const
{
diff --git a/paludis/util/is_file_with_extension.hh b/paludis/util/is_file_with_extension.hh
index 86c2ccb..c0cb0f3 100644
--- a/paludis/util/is_file_with_extension.hh
+++ b/paludis/util/is_file_with_extension.hh
@@ -50,20 +50,12 @@ namespace paludis
/**
* Constructor.
*/
- IsFileWithExtension(const std::string & ext) :
- _prefix(""),
- _ext(ext)
- {
- }
+ IsFileWithExtension(const std::string & ext);
/**
* Constructor.
*/
- IsFileWithExtension(const std::string & prefix, const std::string & ext) :
- _prefix(prefix),
- _ext(ext)
- {
- }
+ IsFileWithExtension(const std::string & prefix, const std::string & ext);
/**
* Operator.
diff --git a/paludis/util/iterator.hh b/paludis/util/iterator.hh
index 55b721d..817ed43 100644
--- a/paludis/util/iterator.hh
+++ b/paludis/util/iterator.hh
@@ -110,9 +110,9 @@ namespace paludis
Iter_ _i;
public:
- /**
- * Constructor, from a base iterator.
- */
+ ///\name Basic operations
+ ///\{
+
IndirectIterator(const Iter_ & i) :
Comparisons<typename std::iterator_traits<Iter_>::iterator_category, Iter_, Value_>::Type(
&IndirectIterator<Iter_, Value_>::_i),
@@ -120,9 +120,6 @@ namespace paludis
{
}
- /**
- * Copy constructor.
- */
IndirectIterator(const IndirectIterator & other) :
Comparisons<typename std::iterator_traits<Iter_>::iterator_category, Iter_, Value_>::Type(
&IndirectIterator<Iter_, Value_>::_i),
@@ -130,65 +127,56 @@ namespace paludis
{
}
- /**
- * Assignment.
- */
const IndirectIterator & operator= (const IndirectIterator & other)
{
_i = other._i;
return *this;
}
- /**
- * Dereference.
- */
+ ///\}
+
+ ///\name Dereference operators
+ ///\{
+
Value_ & operator*()
{
return **_i;
}
- /**
- * Dereference arrow.
- */
Value_ * operator->()
{
return &**_i;
}
- /**
- * Dereference, const.
- */
const Value_ & operator*() const
{
return **_i;
}
- /**
- * Dereference arrow, const.
- */
const Value_ * operator->() const
{
return &**_i;
}
- /**
- * Increment.
- */
+ ///\}
+
+ ///\name Increment, decrement operators
+ ///\{
+
IndirectIterator & operator++ ()
{
++_i;
return *this;
}
- /**
- * Increment.
- */
IndirectIterator operator++ (int)
{
IndirectIterator tmp(*this);
++_i;
return tmp;
}
+
+ ///\}
};
/**
@@ -223,27 +211,21 @@ namespace paludis
*/
typedef typename Iter_::container_type container_type;
- /**
- * Constructor, from an iterator.
- */
+ ///\name Basic operations
+ ///\{
+
FilterInsertIterator(const Iter_ & i, const Pred_ & p) :
_i(i),
_p(p)
{
}
- /**
- * Copy constructor.
- */
FilterInsertIterator(const FilterInsertIterator & other) :
_i(other._i),
_p(other._p)
{
}
- /**
- * Assignment.
- */
template <typename T_>
const FilterInsertIterator & operator= (const T_ value)
{
@@ -252,42 +234,39 @@ namespace paludis
return *this;
}
- /**
- * Destructor.
- */
~FilterInsertIterator();
- /**
- * Dereference.
- */
+ ///
+
+ ///\name Dereference operators
+ ///\{
+
FilterInsertIterator & operator* ()
{
return *this;
}
- /**
- * Dereference arrow.
- */
FilterInsertIterator * operator-> ()
{
return this;
}
- /**
- * Increment.
- */
+ ///\}
+
+ ///\name Increment, decrement operators
+ ///\{
+
FilterInsertIterator & operator++ ()
{
return *this;
}
- /**
- * Increment.
- */
FilterInsertIterator & operator++ (int)
{
return *this;
}
+
+ ///\}
};
template <typename Iter_, typename Pred_>
@@ -332,27 +311,20 @@ namespace paludis
typedef typename Trans_::argument_type value_type;
};
- /**
- * Constructor, from an iterator.
- */
+ ///\name Basic operations
+ ///\{
TransformInsertIterator(const Iter_ & i, const Trans_ & t = Trans_()) :
_i(i),
_t(t)
{
}
- /**
- * Copy constructor.
- */
TransformInsertIterator(const TransformInsertIterator & other) :
_i(other._i),
_t(other._t)
{
}
- /**
- * Assignment.
- */
template <typename T_>
const TransformInsertIterator & operator= (const T_ value)
{
@@ -360,38 +332,38 @@ namespace paludis
return *this;
}
- /**
- * Dereference.
- */
+ ///\}
+
+ ///\name Dereference operators
+ ///\{
+
TransformInsertIterator & operator* ()
{
return *this;
}
- /**
- * Dereference arrow.
- */
TransformInsertIterator * operator-> ()
{
return this;
}
- /**
- * Increment.
- */
+ ///\}
+
+ ///\name Increment, decrement operators
+ ///\{
+
TransformInsertIterator & operator++ ()
{
return *this;
}
- /**
- * Increment.
- */
TransformInsertIterator & operator++ (int)
{
return *this;
}
+ ///\}
+
};
/**
@@ -462,25 +434,19 @@ namespace paludis
typedef Type_ value_type;
};
- /**
- * Constructor, from an iterator.
- */
+ ///\name Basic operations
+ ///\{
+
CreateInsertIterator(const Iter_ & i) :
_i(i)
{
}
- /**
- * Copy constructor.
- */
CreateInsertIterator(const CreateInsertIterator & other) :
_i(other._i)
{
}
- /**
- * Assignment.
- */
template <typename T_>
const CreateInsertIterator & operator= (const T_ value)
{
@@ -488,37 +454,37 @@ namespace paludis
return *this;
}
- /**
- * Dereference.
- */
+ ///\}
+
+ ///\name Dereference operators
+ ///\{
+
CreateInsertIterator & operator* ()
{
return *this;
}
- /**
- * Dereference arrow.
- */
CreateInsertIterator * operator-> ()
{
return this;
}
- /**
- * Increment.
- */
+ ///\}
+
+ ///\name Increment, decrement operators
+ ///\{
+
CreateInsertIterator & operator++ ()
{
return *this;
}
- /**
- * Increment.
- */
CreateInsertIterator & operator++ (int)
{
return *this;
}
+
+ ///\}
};
/**
diff --git a/paludis/util/pstream.hh b/paludis/util/pstream.hh
index af79b8f..f6fe15d 100644
--- a/paludis/util/pstream.hh
+++ b/paludis/util/pstream.hh
@@ -46,10 +46,12 @@ namespace paludis
class PStreamError : public Exception
{
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
PStreamError(const std::string & message) throw ();
+
+ ///\}
};
/**
@@ -99,6 +101,9 @@ namespace paludis
virtual int_type underflow();
public:
+ ///\name Basic operations
+ ///\{
+
/**
* Constructor.
*
@@ -106,11 +111,10 @@ namespace paludis
*/
PStreamInBuf(const std::string & command);
- /**
- * Destructor.
- */
~PStreamInBuf();
+ ///\}
+
/**
* What was our command?
*/
@@ -167,6 +171,9 @@ namespace paludis
public std::istream
{
public:
+ ///\name Basic operations
+ ///\{
+
/**
* Constructor.
*
@@ -180,6 +187,8 @@ namespace paludis
{
}
+ ///\}
+
/**
* What is our exit status?
*/
diff --git a/paludis/util/random.hh b/paludis/util/random.hh
index bc5e43c..66b7498 100644
--- a/paludis/util/random.hh
+++ b/paludis/util/random.hh
@@ -45,12 +45,17 @@ namespace paludis
static const uint32_t _m = 1771875;
public:
+ ///\name Basic operations
+ ///\{
+
/// Constructor, with a seed.
Random(uint32_t seed);
/// Constructor, with a magic random seed.
Random();
+ ///\}
+
/// Fetch a random number in (0, max]
template <typename DiffType_>
DiffType_ operator() (DiffType_ max)
diff --git a/paludis/util/save.hh b/paludis/util/save.hh
index cbc55ea..d57b9e7 100644
--- a/paludis/util/save.hh
+++ b/paludis/util/save.hh
@@ -46,6 +46,9 @@ namespace paludis
const T_ _value;
public:
+ ///\name Basic operations
+ ///\{
+
/**
* Constructor.
*/
@@ -72,6 +75,8 @@ namespace paludis
{
*_ptr = _value;
}
+
+ ///\}
};
}
diff --git a/paludis/util/strip.hh b/paludis/util/strip.hh
index cc62d16..e4e89fa 100644
--- a/paludis/util/strip.hh
+++ b/paludis/util/strip.hh
@@ -78,14 +78,16 @@ namespace paludis
const std::string _second;
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
StripAdapter(const std::string & second) :
_second(second)
{
}
+ ///\}
+
/**
* Operation.
*/
diff --git a/paludis/util/system.hh b/paludis/util/system.hh
index 99b6881..a5c1482 100644
--- a/paludis/util/system.hh
+++ b/paludis/util/system.hh
@@ -42,10 +42,12 @@ namespace paludis
class GetenvError : public Exception
{
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
GetenvError(const std::string & key) throw ();
+
+ ///\}
};
/**
@@ -113,11 +115,13 @@ namespace paludis
std::string args;
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
explicit MakeEnvCommand(const std::string &, const std::string &);
+ ///\}
+
/**
* Add some environment.
*/
diff --git a/paludis/util/tokeniser.hh b/paludis/util/tokeniser.hh
index f350826..450422b 100644
--- a/paludis/util/tokeniser.hh
+++ b/paludis/util/tokeniser.hh
@@ -165,14 +165,16 @@ namespace paludis
const std::basic_string<Char_> _delims;
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
Tokeniser(const std::basic_string<Char_> & delims) :
_delims(delims)
{
}
+ ///\}
+
/**
* Do the tokenisation.
*/
diff --git a/paludis/util/validated.hh b/paludis/util/validated.hh
index 01b2433..14135c2 100644
--- a/paludis/util/validated.hh
+++ b/paludis/util/validated.hh
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_VALIDATED_HH
#define PALUDIS_GUARD_PALUDIS_VALIDATED_HH 1
-#include <ostream>
+#include <iosfwd>
#include <paludis/util/comparison_policy.hh>
/** \file
@@ -47,6 +47,9 @@ namespace paludis
ValidatedDataType_ _value;
public:
+ ///\name Basic operations
+ ///\{
+
/**
* Copy constructor (no validation needed).
*/
@@ -67,6 +70,8 @@ namespace paludis
return *this;
}
+ ///\}
+
/**
* Fetch to our ValidatedDataType_. This should not be a cast
* operator to avoid problems with ambiguous comparison operators.
diff --git a/paludis/util/virtual_constructor.hh b/paludis/util/virtual_constructor.hh
index 503ebf9..e128d21 100644
--- a/paludis/util/virtual_constructor.hh
+++ b/paludis/util/virtual_constructor.hh
@@ -54,7 +54,7 @@ namespace paludis
struct ThrowException
{
/**
- * Internal use: provide handle_not_found.
+ * Internal use: provide handle_not_found.
*
* \ingroup grpvc
*/
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index 882f99d..2707180 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -81,18 +81,25 @@ namespace paludis
class Visits
{
protected:
- /**
- * Destructor.
- */
+ ///\name Basic operations
+ ///\{
+
virtual ~Visits()
{
}
+ ///\}
+
public:
+ ///\name Visitor operations
+ ///\{
+
/**
* Visit a node of the specified type.
*/
virtual void visit(NodePtrType_ const) = 0;
+
+ ///\}
};
/**
@@ -104,12 +111,14 @@ namespace paludis
class Visits<const visitor_internals::NoType<n_> * >
{
protected:
- /**
- * Destructor.
- */
+ ///\name Basic operations
+ ///\{
+
~Visits()
{
}
+
+ ///\}
};
/**
@@ -121,9 +130,14 @@ namespace paludis
class Visits<visitor_internals::NoType<n_> * >
{
protected:
+ ///\name Basic operations
+ ///\{
+
~Visits()
{
}
+
+ ///\}
};
}
@@ -145,6 +159,9 @@ namespace paludis
}
public:
+ ///\name Visitor operations
+ ///\{
+
/**
* Accept a visitor.
*/
@@ -154,6 +171,8 @@ namespace paludis
* Accept a constant visitor.
*/
virtual void accept(typename VisitorType_::ConstVisitor * const) const = 0;
+
+ ///\}
};
/**
@@ -167,14 +186,19 @@ namespace paludis
public virtual VisitableInterface<VisitorType_>
{
protected:
- /**
- * Destructor.
- */
+ ///\name Basic operations
+ ///\{
+
virtual ~Visitable()
{
}
+ ///\}
+
public:
+ ///\name Visitor operations
+ ///\{
+
virtual void accept(typename VisitorType_::Visitor * const v)
{
static_cast<visitor_internals::Visits<OurType_ *> *>(v)->visit(
@@ -186,6 +210,8 @@ namespace paludis
static_cast<visitor_internals::Visits<const OurType_ *> *>(v)->visit(
static_cast<const OurType_ *>(this));
}
+
+ ///\}
};
/**
@@ -225,7 +251,12 @@ namespace paludis
public visitor_internals::Visits<typename visitor_internals::MakePointerToConst<N9_>::Type>
{
protected:
+ ///\name Basic operations
+ ///\{
+
~ConstVisitor();
+
+ ///\}
};
/**
@@ -243,7 +274,12 @@ namespace paludis
public visitor_internals::Visits<N9_>
{
protected:
+ ///\name Basic operations
+ ///\{
+
~Visitor();
+
+ ///\}
};
};
@@ -288,14 +324,16 @@ namespace paludis
VisitorPointer_ * const _p;
public:
- /**
- * Constructor.
- */
+ ///\name Basic operations
+ ///\{
+
AcceptVisitor(VisitorPointer_ * const p) :
_p(p)
{
}
+ ///\}
+
/**
* Operator.
*/