VMime
|
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 maildirFolder::copyMessages(), maildirFolder::expunge(), and maildirFolder::setMessageFlags().
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 path::appendComponent(), vmime::end(), and vmime::npos.
const path::component & getComponentAt | ( | const size_t | pos | ) | const |
Return the component at the specified position.
pos | position |
path::component & getComponentAt | ( | const size_t | pos | ) |
Return the component at the specified position.
pos | position |
const path::component getLastComponent | ( | ) | const |
Return the last component of this path (const version).
Referenced by kmailMaildirFormat::folderPathToFileSystemPath(), kmailMaildirFormat::isSubfolderDirectory(), courierMaildirFormat::isSubfolderDirectory(), kmailMaildirFormat::listFoldersImpl(), maildirFolder::rename(), and IMAPFolder::rename().
path::component & getLastComponent | ( | ) |
Return the last component of this path (non-const version).
path getParent | ( | ) | const |
References path::isEmpty().
Referenced by POP3Folder::getParent(), maildirFolder::getParent(), and IMAPFolder::getParent().
size_t getSize | ( | ) | const |
Return the number of components in this path.
Referenced by POP3Folder::exists(), courierMaildirFormat::folderPathToFileSystemPath(), kmailMaildirFormat::folderPathToFileSystemPath(), POP3Folder::getAttributes(), path::isDirectParentOf(), path::isParentOf(), courierMaildirFormat::listDirectories(), courierMaildirFormat::listFolders(), POP3Folder::open(), IMAPFolder::rename(), and path::renameParent().
bool isDirectParentOf | ( | const path & | p | ) | const |
Test whether this path is a direct parent of another one.
p | other path |
References path::getSize().
Referenced by IMAPFolder::getFolders().
bool isEmpty | ( | ) | const |
Test whether this path is empty (root).
Referenced by POP3Folder::exists(), POP3Folder::getAttributes(), maildirFolder::getAttributes(), IMAPFolder::getAttributes(), POP3Folder::getFolders(), path::getParent(), POP3Folder::getParent(), maildirFolder::getParent(), IMAPFolder::getParent(), kmailMaildirFormat::listFoldersImpl(), POP3Folder::open(), maildirFolder::rename(), IMAPFolder::rename(), and path::renameParent().
bool isParentOf | ( | const path & | p | ) | const |
Test whether this path is a parent of another one.
p | other path |
References path::getSize().
Referenced by maildirFolder::rename(), and IMAPFolder::rename().
bool isRoot | ( | ) | const |
Test whether this path is the root (alias for isEmpty()).
Referenced by courierMaildirFormat::folderExists(), courierMaildirFormat::folderPathToFileSystemPath(), and courierMaildirFormat::listDirectories().
bool operator!= | ( | const path & | p | ) | const |
bool operator== | ( | const path & | p | ) | const |
const path::component & operator[] | ( | const size_t | x | ) | const |
Return the specified component of the path (const version).
x | index of the component |
path::component & operator[] | ( | const size_t | x | ) |
Return the specified component of the path (non-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 path::getSize(), and path::isEmpty().
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) |