enum
{
-#ifdef WIN32
+#ifdef _WIN32
DIRSEP = '\\'
#else
DIRSEP = '/'
public:
class Iterator
{
+ public:
+ typedef PositionArray::difference_type difference_type;
+ typedef const std::string value_type;
+ typedef const std::string *pointer;
+ typedef const std::string &reference;
+ typedef std::input_iterator_tag iterator_category;
+
private:
const Path *path;
PositionArray::const_iterator iter;
bool end;
+ std::string current;
Iterator(const Path &, bool = false);
public:
static Iterator at_end(const Path &p) { return Iterator(p, true); }
Iterator &operator++();
+ Iterator operator++(int) { Iterator i = *this; ++*this; return i; }
Iterator &operator--();
- std::string operator*() const;
+ const std::string &operator*() const { return current; }
+ const std::string *operator->() const { return ¤t; }
bool operator==(const Iterator &i) const { return (iter==i.iter && end==i.end); }
bool operator!=(const Iterator &i) const { return !(*this==i); }
+ private:
+ void update();
};
private:
/// Returns the path as a string.
const std::string &str() const { return path; }
+ /// Returns the path as a pointer to a null-terminated string.
+ const char *c_str() const { return path.c_str(); }
+
/// Returns the number of components in the path.
unsigned size() const;