]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/path.h
Use #ifdef _WIN32 rather than WIN32
[libs/core.git] / source / fs / path.h
index 5d0a5d353d4d465954b11ed9f7ff57a36aca5a5a..82600dc35c28d5787f69b56f0af3b8b12af50f22 100644 (file)
@@ -10,7 +10,7 @@ namespace FS {
 
 enum
 {
-#ifdef WIN32
+#ifdef _WIN32
        DIRSEP = '\\'
 #else
        DIRSEP = '/'
@@ -36,10 +36,18 @@ private:
 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:
@@ -47,10 +55,14 @@ 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 &current; }
                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: