X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpath.h;h=1da6a934cd800874107503ab0fea7d259061f951;hb=9dc69f850aab362348787353a55a900a5d72c5dc;hp=6662a8c20a875856c347d6488747f9c515ecdb5f;hpb=05ea50ffd15fa74ab1059df2c63442fdf83dec96;p=libs%2Fcore.git 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<