|
VMime
|
#include <path.hpp>


Public Types | |
| typedef vmime::word | component |
| typedef std::vector< component > | list |
Public Member Functions | |
| path () | |
| path (const component &c) | |
| path (const path &p) | |
| path (const string &s) | |
| path | operator/ (const path &p) const |
| path | operator/ (const component &c) const |
| path & | operator/= (const path &p) |
| path & | operator/= (const component &c) |
| path | getParent () const |
| path & | operator= (const path &p) |
| path & | operator= (const component &c) |
| bool | operator== (const path &p) const |
| bool | operator!= (const path &p) const |
| void | appendComponent (const component &c) |
| const component & | getComponentAt (const size_t pos) const |
| component & | getComponentAt (const size_t pos) |
| bool | isEmpty () const |
| bool | isRoot () const |
| const component | getLastComponent () const |
| component & | getLastComponent () |
| size_t | getSize () const |
| const component & | operator[] (const size_t x) const |
| component & | operator[] (const size_t x) |
| bool | isDirectParentOf (const path &p) const |
| bool | isParentOf (const path &p) const |
| void | renameParent (const path &oldPath, const path &newPath) |
| const string | toString (const string &sep, const charset &cset) const |
Static Public Member Functions | |
| static path | fromString (const string &str, const string &sep, const charset &cset) |
Additional Inherited Members | |
| Protected Member Functions inherited from object | |
| object () | |
| object (const object &) | |
| object & | operator= (const object &) |
| virtual | ~object () |
Abstract representation of a path (filesystem, mailbox, etc).
| typedef vmime::word component |
| path | ( | ) |
Referenced by fromString(), getParent(), isDirectParentOf(), isParentOf(), operator!=(), operator/(), operator/(), operator/=(), operator/=(), operator=(), operator=(), operator==(), path(), and renameParent().
| path | ( | const component & | c | ) |
| path | ( | const path & | p | ) |
References object::object(), and path().
|
explicit |
| void appendComponent | ( | const component & | c | ) |
Construct a new path from a string.
| str | string representation of the path |
| sep | separator string (eg: "/") |
| cset | charset in which the path is encoded (use the value returned by vmime::charset::getLocalCharset() to use the default charset of your system) |
References appendComponent(), vmime::end(), and path().
| path::component & getComponentAt | ( | const size_t | pos | ) |
Return the component at the specified position.
| pos | position |
| const path::component & getComponentAt | ( | const size_t | pos | ) | const |
Return the component at the specified position.
| pos | position |
| path::component & getLastComponent | ( | ) |
Return the last component of this path (non-const version).
| const path::component getLastComponent | ( | ) | const |
Return the last component of this path (const version).
Referenced by courierMaildirFormat::isSubfolderDirectory(), kmailMaildirFormat::isSubfolderDirectory(), kmailMaildirFormat::listFoldersImpl(), IMAPFolder::rename(), and maildirFolder::rename().
| size_t getSize | ( | ) | const |
Return the number of components in this path.
Referenced by isDirectParentOf(), isParentOf(), courierMaildirFormat::listDirectories(), courierMaildirFormat::listFolders(), and renameParent().
| bool isDirectParentOf | ( | const path & | p | ) | const |
| bool isEmpty | ( | ) | const |
Test whether this path is empty (root).
Referenced by getParent(), kmailMaildirFormat::listFoldersImpl(), IMAPFolder::rename(), maildirFolder::rename(), and renameParent().
| bool isParentOf | ( | const path & | p | ) | const |
Test whether this path is a parent of another one.
| p | other path |
References getSize(), and path().
Referenced by IMAPFolder::rename(), and maildirFolder::rename().
| bool isRoot | ( | ) | const |
Test whether this path is the root (alias for isEmpty()).
Referenced by courierMaildirFormat::listDirectories().
| path::component & operator[] | ( | const size_t | x | ) |
Return the specified component of the path (non-const version).
| x | index of the component |
| const path::component & operator[] | ( | const size_t | x | ) | const |
Return the specified component of the path (const version).
| x | index of the component |
Rename a parent component in the path.
Example: path("a/b/c/d").renameParent("a/b", "x/y/z") will return path("x/y/z/c/d").
| oldPath | old parent path |
| newPath | new parent path |
References getSize(), isEmpty(), and path().
Referenced by courierMaildirFormat::renameFolder().
Returns a string representation of this path.
| sep | separator string (eg: "/") |
| cset | charset in which to encode the components (use the value returned by vmime::charset::getLocalCharset() to use the default charset of your system) |