#include <PathName.hpp>
Public Types | |
| typedef blocxx::List< blocxx::String > | List |
Public Member Functions | |
| PathName () | |
| Create an empty PathName object. | |
| PathName (const PathName &path) | |
| Create a Copy of a PathName object. | |
| PathName (const PathName::List &list) | |
| Create a new PathName object from a PathName::List. | |
| PathName (const blocxx::String &name) | |
| Create a new PathName object from a blocxx::String. | |
| PathName (const char *name) | |
| Create a new PathName object from a c string. | |
| virtual | ~PathName () |
| PathName & | operator= (const PathName &path) |
| Assigns path to this PathName object and returns a reference to it. | |
| PathName & | operator+= (const PathName &path) |
| Appends path to this PathName object and a reference to it. | |
| blocxx::String | toString () const |
| Returns the complete path this PathName object holds. | |
| PathName::List | toList () const |
| Returns the path this PathName object holds, as a PathName::List. The first element of that list is either the prefix, or, if there is no drive prefix it's an empty string. | |
| blocxx::String | prefix () const |
| Returns the path prefix if existent, otherwise "". | |
| bool | empty () const |
| Returns true if this PathName object holds an empty path. | |
| bool | absolute () const |
| Returns true if this PathName object holds an absolute Path. | |
| bool | relative () const |
| Returns true if this PathName object holds an relative path. | |
| PathName | dirName () const |
| Returns the directory part of the path string. | |
| blocxx::String | baseName () const |
| Returns the base name part of the path string. | |
| PathName | absoluteName () const |
| Returns the absolute name of the path string this object holds. | |
| PathName | relativeName () const |
| Returns the relative name of the path string this object holds. | |
| PathName | cat (const PathName &add) const |
| Create a new PathName object from the concatenation of this and add. | |
| PathName | extend (const blocxx::String &ext) const |
| Create a new PathName object by extending this PathName object by ext. | |
| bool | equal (const PathName &rpath) const |
| Test for equality of this and rpath. | |
Static Public Member Functions | |
| static PathName | dirName (const PathName &path) |
| Returns the directory part of path. | |
| static blocxx::String | baseName (const PathName &path) |
| Returns the base name part of path. | |
| static PathName | absoluteName (const PathName &path) |
| Returns the absolute name of path. | |
| static PathName | relativeName (const PathName &path) |
| Returns the relative name of path. | |
| static PathName | cat (const PathName &path, const PathName &add) |
| Create a new PathName object by concatenating two existing ones. | |
| static PathName | extend (const PathName &path, const blocxx::String &ext) |
| Create a new PathName object by extending path by ext. | |
| static bool | equal (const PathName &lpath, const PathName &rpath) |
| Static function to test for equality of two PathName objects. | |
Protected Member Functions | |
| void | assign (const blocxx::String &path) |
| Assigns path to this PathName objects m_name string. | |
| void | assign (const PathName::List &list) |
| Assigns list to this PathName objects m_name string. | |
Private Attributes | |
| size_t | m_prefix |
| holds index of first character in the path string after an (optional) drive letter. | |
| blocxx::String | m_name |
This class is intended for internal usage inside of LiMaL pluglibs and should never appear in the pluglib interface.
|
|
|
|
|
Create an empty PathName object.
|
|
|
Create a Copy of a PathName object.
|
|
|
Create a new PathName object from a PathName::List.
|
|
|
Create a new PathName object from a blocxx::String.
|
|
|
Create a new PathName object from a c string.
|
|
|
Destructor |
|
|
Returns true if this PathName object holds an absolute Path.
|
|
|
Returns the absolute name of path.
PathName p1("foo/bar/some_file"); std::cout << absoluteName( p1 ); // == "/foo/bar/some_file"
|
|
|
Returns the absolute name of the path string this object holds.
PathName p1("foo/bar/some_file"); std::cout << p1.absoluteName(); // == "/foo/bar/some_file"
|
|
|
Assigns list to this PathName objects m_name string. Takes the given path list, cleans it (i.e.: removing redundant parts from it like './foo/../bar/some_file" -> './bar/some_file') sets m_prefix and assigns the cleansed path string to m_path.
|
|
|
Assigns path to this PathName objects m_name string. Takes the given path string, cleans it (i.e.: removing redundant parts from it like './foo/../bar/some_file" -> './bar/some_file') sets m_prefix and assigns the cleansed path string to m_path.
|
|
|
Returns the base name part of path. Returns the base name (i.e. the file name) of the path string. For example:
PathName p1("/foo/bar/some_file"); std::cout << PathName::baseName( p1 ); // == "some_file"
|
|
|
Returns the base name part of the path string. Returns the base name (i.e. the file name) of the path string. For example:
std::cout << PathName("/foo/bar/some_file").baseName(); // == "some_file"
|
|
||||||||||||
|
Create a new PathName object by concatenating two existing ones. Static function for concatenating two PathName objects. For example:
PathName p1("/foo"); PathName p2("bar/some_file"); std::cout << PathName::cat( p1, p2 ); // == "/foo/bar/some_file"
|
|
|
Create a new PathName object from the concatenation of this and add. Creates a new PathName object consisting of the concatenation of this PathName object and add and returns it. For example:
PathName p1("/foo"); PathName p2("bar/some_file"); std::cout << p1.cat( p2 ); // == "/foo/bar/some_file"
|
|
|
Returns the directory part of path. Static function to aquire the directory part of a PathName object. For example:
PathName p1("/foo/bar/some_file"); std::cout << PathName::dirName(p1); // == "/foo/bar"
|
|
|
Returns the directory part of the path string. Returns the directory part of the path string this PathName object holds. For example:
std::cout << PathName("/foo/bar/some_file").dirName(); // == "/foo/bar"
|
|
|
Returns true if this PathName object holds an empty path.
|
|
||||||||||||
|
Static function to test for equality of two PathName objects.
|
|
|
Test for equality of this and rpath.
|
|
||||||||||||
|
Create a new PathName object by extending path by ext. Static function to create a new PathName object that consists of path extended by the string ext. Basically it just glues the two strings together and calls PathName( const blocxx::String ) For Example:
PathName p1("/foo"); blocxx::String strExt(".old"); std::cout << PathName::extend(p1, strExt ); // == "/foo.old"
|
|
|
Create a new PathName object by extending this PathName object by ext. Use this function to create a new PathName object that consists of this PathName object extended by the string ext. Basically it just glues the two strings together and calls PathName( const blocxx::String ) For Example:
PathName p1("/foo"); blocxx::String strExt(".old"); std::cout << p1.extend( strExt ); // == "/foo.old"
|
|
|
Appends path to this PathName object and a reference to it.
|
|
|
Assigns path to this PathName object and returns a reference to it.
|
|
|
Returns the path prefix if existent, otherwise "". Returns the path prefix (i.e. drive letter), if the path this PathName object holds contains one (like in 'c:/foo/bar'), otherwise the empty string will be returned.
|
|
|
Returns true if this PathName object holds an relative path.
|
|
|
Returns the relative name of path.
PathName p1("/foo/bar/some_file"); std::cout << relativeName( p1 ); // == "./foo/bar/some_file"
|
|
|
Returns the relative name of the path string this object holds.
PathName p1("/foo/bar/some_file"); std::cout << p1.relativeName(); // == "./foo/bar/some_file"
|
|
|
Returns the path this PathName object holds, as a PathName::List. The first element of that list is either the prefix, or, if there is no drive prefix it's an empty string.
|
|
|
Returns the complete path this PathName object holds.
|
|
|
|
|
|
holds index of first character in the path string after an (optional) drive letter.
|
1.4.6