FreeNOS
|
Simple filesystem path parser. More...
#include <FileSystemPath.h>
Public Member Functions | |
FileSystemPath (const char *path, const char separator=DefaultSeparator) | |
Constructor using char pointer. More... | |
const String & | parent () const |
Retrieve the full path of our parent. More... | |
const String & | base () const |
The name of the last element in the path. More... | |
const String & | full () const |
Get the full path as a String. More... | |
const List< String > & | split () const |
Returns a List of separate path elements. More... | |
Size | length () const |
Get Length of our full path. More... | |
Static Public Attributes | |
static const Size | MaximumLength = 64u |
Maximum length of a filesystem path in bytes. More... | |
Private Attributes | |
const char | m_separator |
Separator character. More... | |
const String | m_full |
Full input path. More... | |
const List< String > | m_path |
The path split in pieces by the separator. More... | |
const String | m_base |
Last element in the full path. More... | |
String | m_parent |
Full path to our parent. More... | |
Static Private Attributes | |
static const char | DefaultSeparator = '/' |
The default path separator character. More... | |
Simple filesystem path parser.
Definition at line 37 of file FileSystemPath.h.
FileSystemPath::FileSystemPath | ( | const char * | path, |
const char | separator = DefaultSeparator |
||
) |
Constructor using char pointer.
path | The input path to parse. |
separator | Pathname separator. |
Definition at line 22 of file FileSystemPath.cpp.
References List< T >::head(), m_parent, m_path, m_separator, and ZERO.
const String & FileSystemPath::base | ( | ) | const |
The name of the last element in the path.
Definition at line 53 of file FileSystemPath.cpp.
References m_base.
Referenced by FileSystemServer::insertFileCache(), and FileSystemServer::registerFile().
const String & FileSystemPath::full | ( | ) | const |
Get the full path as a String.
Definition at line 58 of file FileSystemPath.cpp.
References m_full.
Referenced by FileSystemServer::processRequest().
Size FileSystemPath::length | ( | ) | const |
Get Length of our full path.
Definition at line 68 of file FileSystemPath.cpp.
References String::length(), and m_full.
Referenced by FileSystemServer::findFileCache().
const String & FileSystemPath::parent | ( | ) | const |
Retrieve the full path of our parent.
Definition at line 48 of file FileSystemPath.cpp.
References m_parent.
Referenced by FileSystemServer::findFileCache(), FileSystemServer::getParentDirectory(), and FileSystemServer::insertFileCache().
Returns a List of separate path elements.
Definition at line 63 of file FileSystemPath.cpp.
References m_path.
Referenced by chdir(), FileSystemServer::findFileCache(), and FileSystemServer::lookupFile().
|
staticprivate |
The default path separator character.
Definition at line 42 of file FileSystemPath.h.
|
private |
Last element in the full path.
Definition at line 107 of file FileSystemPath.h.
Referenced by base().
|
private |
Full input path.
Definition at line 101 of file FileSystemPath.h.
|
private |
Full path to our parent.
Definition at line 110 of file FileSystemPath.h.
Referenced by FileSystemPath(), and parent().
The path split in pieces by the separator.
Definition at line 104 of file FileSystemPath.h.
Referenced by FileSystemPath(), and split().
|
private |
Separator character.
Definition at line 98 of file FileSystemPath.h.
Referenced by FileSystemPath().
|
static |
Maximum length of a filesystem path in bytes.
Definition at line 47 of file FileSystemPath.h.
Referenced by FileSystemClient::findMount(), FileSystemServer::mountHandler(), MpiProxy::processExec(), FileSystemServer::processRequest(), and FileSystemClient::request().