]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/path.h
Reorder Path member functions
[libs/core.git] / source / fs / path.h
index ed9cc7985b62d863f86a6bc19726de692791d077..6aa16f6d08191a9d7d4000f8f9be65ee4d6217a6 100644 (file)
@@ -48,7 +48,10 @@ public:
        Path();
        Path(const std::string &);
        Path(const char *);
+private:
+       void init(const std::string &);
 
+public:
        const std::string &str() const { return path; }
 
        /// Returns the number of components in the path.
@@ -66,18 +69,19 @@ public:
        Path operator/(const Path &p) const;
        Path &operator/=(const Path &);
 
-       /**
-       Extracts a single component from the path.  Negative indices count from the
-       end of the path.
-       */
+private:
+       /** Adds a component to the path.  It must not contain the directory
+       separator character. */
+       void add_component(const std::string &);
+
+public:
+       /** Extracts a single component from the path.  Negative indices count from
+       the end of the path. */
        std::string operator[](int) const;
 
        bool operator==(const Path &) const;
        Iterator begin() const;
        Iterator end() const;
-private:
-       void init(const std::string &);
-       void add_component(const std::string &);
 };
 
 inline std::ostream &operator<<(std::ostream &o, const Path &p) { o<<p.str(); return o; }