The class fc::Local is used to encapsulate local directories or files.
More...
#include <FCPath.hpp>
|
virtual | ~Local (void) |
|
| Local (const std::string &n) |
|
virtual void | setDefaultDir (const std::string &dir) const |
| Set the default directory. Will ensure it is terminated by a slash or backslash. More...
|
|
virtual const std::string & | defaultDir (void) const |
| Get the default directory. This is guaranteed to be terminated by a slash or backslash. More...
|
|
virtual const std::string & | separator (void) const |
| Return the usual path separator, such as slash or backslash. More...
|
|
virtual Local | operator+ (const std::string &name) const |
|
virtual bool | empty (void) const |
|
virtual const char * | c_str (void) const |
|
virtual | operator const char * (void) const |
|
virtual | operator const std::string & (void) const |
|
virtual const std::string & | str (void) const |
|
virtual Name & | operator+= (const std::string &rhs) |
| Append a filename to an existing Local or Remote object. More...
|
|
virtual bool | isAbsolute (void) const |
| Original name is absolute, such as /tmp/test.txt or C:\Files . More...
|
|
virtual bool | isRelative (void) const |
| Original name is relative, such as test.txt or ..\test.txt . More...
|
|
virtual const std::string & | name (void) const |
| The original name specified when this object was first instantiated. More...
|
|
virtual const std::string & | parentDir (void) const |
| Get the parent directory if known, or a blank string if unknown. More...
|
|
virtual const std::string & | filename (void) const |
| Get the last component in full() which normally would be the filename. More...
|
|
virtual const std::string & | full (void) const |
| Get the full name. More...
|
|
|
std::string | findSeparator (void) const |
| Logic to extract the directory separator from the default directory or the explicit name. More...
|
|
virtual Name & | clearCache (void) |
| Clear the mutable cache items. More...
|
|
The class fc::Local is used to encapsulate local directories or files.
fc::Local::~Local |
( |
void |
| ) |
|
|
virtual |
fc::Local::Local |
( |
const std::string & |
n | ) |
|
|
explicit |
void fc::Local::setDefaultDir |
( |
const std::string & |
dir | ) |
const |
|
virtual |
const std::string & fc::Local::defaultDir |
( |
void |
| ) |
const |
|
virtual |
const std::string & fc::Local::separator |
( |
void |
| ) |
const |
|
virtual |
fc::Local fc::Local::operator+ |
( |
const std::string & |
name | ) |
const |
|
virtual |
virtual bool fc::Name::empty |
( |
void |
| ) |
const |
|
inlinevirtualinherited |
virtual const char* fc::Name::c_str |
( |
void |
| ) |
const |
|
inlinevirtualinherited |
virtual fc::Name::operator const char * |
( |
void |
| ) |
const |
|
inlinevirtualinherited |
virtual fc::Name::operator const std::string & |
( |
void |
| ) |
const |
|
inlinevirtualinherited |
virtual const std::string& fc::Name::str |
( |
void |
| ) |
const |
|
inlinevirtualinherited |
References fc::Name::defaultDir(), fc::Name::filename(), fc::Name::findSeparator(), fc::Name::full(), fc::Name::isAbsolute(), fc::Name::isRelative(), fc::Name::name(), fc::Name::operator+=(), fc::Name::parentDir(), fc::Name::separator(), and fc::Name::setDefaultDir().
fc::Name & fc::Name::operator+= |
( |
const std::string & |
rhs | ) |
|
|
virtualinherited |
bool fc::Name::isAbsolute |
( |
void |
| ) |
const |
|
virtualinherited |
bool fc::Name::isRelative |
( |
void |
| ) |
const |
|
virtualinherited |
const std::string & fc::Name::name |
( |
void |
| ) |
const |
|
virtualinherited |
const std::string & fc::Name::parentDir |
( |
void |
| ) |
const |
|
virtualinherited |
Get the parent directory if known, or a blank string if unknown.
The directory name (if not empty) will always be terminated with /
or \
. For example:
Original Name | parentDir() |
test.txt | |
../test.txt | ../ |
/tmp/foo/bar/name.txt | /tmp/foo/bar/ |
/testing/123/ | /testing/ |
/ | / |
References fc::Name::full(), fc::Name::parentDirectory, and fc::Name::separator().
const std::string & fc::Name::filename |
( |
void |
| ) |
const |
|
virtualinherited |
const std::string & fc::Name::full |
( |
void |
| ) |
const |
|
virtualinherited |
Get the full name.
- If
name
is absolute, then this returns the name.
- If
name
is relative, then this returns the name combined with the default directory.
Most of the time, this is the method you'll want to call to generate a path or filename.
Examples when the default directory is set to /tmp/
:
Directory Name | full() |
/test.txt | /test.txt |
test.txt | /tmp/test.txt |
../test.txt | /tmp/../test.txt |
C:\MyFiles\test.txt | C:\MyFiles\test.txt |
- Returns
- the full name, combined with the default directory when appropriate
References fc::Name::defaultDir(), fc::Name::fullDirAndName, fc::Name::name(), and fc::Name::separator().
std::string fc::Name::findSeparator |
( |
void |
| ) |
const |
|
protectedinherited |
fc::Name & fc::Name::clearCache |
( |
void |
| ) |
|
|
protectedvirtualinherited |
std::string fc::Local::defaultLocalDirectory |
|
staticprotected |
std::string fc::Local::defaultLocalSeparator |
|
staticprotected |
std::string fc::Name::explicitName |
|
protectedinherited |
The name used when the object was instantiated.
std::string fc::Name::fileName |
|
mutableprotectedinherited |
the last component from full()
std::string fc::Name::parentDirectory |
|
mutableprotectedinherited |
the parent directory including the terminating slash
std::string fc::Name::fullDirAndName |
|
mutableprotectedinherited |
the name combined with the default directory
The documentation for this class was generated from the following files: