X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fpath.h;h=1da6a934cd800874107503ab0fea7d259061f951;hp=6662a8c20a875856c347d6488747f9c515ecdb5f;hb=0ba3e9d15af4e8c30eef5445d2b64fee4870505f;hpb=911ae41312cf1c9db02b8b513cc8edbe78d97006 diff --git a/source/path.h b/source/path.h index 6662a8c..1da6a93 100644 --- a/source/path.h +++ b/source/path.h @@ -1,8 +1,10 @@ -/* +/* $Id$ + This file is part of libmsppath -Copyright © 2006 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ + #ifndef MSP_PATH_PATH_H_ #define MSP_PATH_PATH_H_ @@ -10,7 +12,6 @@ Distributed under the LGPL #include namespace Msp { -namespace Path { enum { @@ -24,19 +25,19 @@ enum class Path { public: - class iterator + class Iterator { public: - iterator &operator++(); - iterator &operator--(); + Iterator &operator++(); + Iterator &operator--(); std::string operator*() const; - bool operator==(const iterator &i) const { return (start==i.start && end==i.end); } - bool operator!=(const iterator &i) const { return !(*this==i); } + bool operator==(const Iterator &i) const { return (start==i.start && end==i.end); } + bool operator!=(const Iterator &i) const { return !(*this==i); } private: const Path &path; unsigned start,end; - iterator(const Path &); + Iterator(const Path &); friend class Path; }; @@ -53,8 +54,8 @@ public: Path &operator/=(const Path &); std::string operator[](int) const; bool operator==(const Path &) const; - iterator begin() const { return iterator(*this); } - iterator end() const { iterator i(*this); i.start=i.end=std::string::npos; return i; } + Iterator begin() const { return Iterator(*this); } + Iterator end() const { Iterator i(*this); i.start=i.end=std::string::npos; return i; } private: std::string path; @@ -64,7 +65,6 @@ private: inline std::ostream &operator<<(std::ostream &o, const Path &p) { o<