#include <unixstl/filesystem/path.hpp>
C | The character type | |
T | The traits type. Defaults to filesystem_traits<C>. On translators that do not support default template arguments, it must be explicitly stipulated | |
A | The allocator class. Defaults to stlsoft::allocator_selector<C>::allocator_type. On translators that do not support default template arguments, it must be explicitly stipulated |
push/pop
-based interface Construction | |
basic_path () | |
Constructs an empty path. | |
basic_path (char_type const *path) | |
Constructs a path from path . | |
template<typename S> | |
basic_path (S const &s) | |
Constructs a path from path . | |
basic_path (char_type const *path, size_type cch) | |
Constructs a path from cch characters in path . | |
basic_path (class_type const &rhs) | |
Copies the contents of rhs . | |
class_type & | operator= (class_type const &rhs) |
Copies the contents of rhs . | |
class_type & | operator= (char_type const *rhs) |
Copies the contents of rhs . | |
template<typename S> | |
class_type & | operator= (S const &s) |
Copies the contents of s . | |
static class_type | root (char_type const *s) |
template<typename S> | |
static class_type | root (S const &s) |
Attributes | |
char_type const * | get_file () const |
Returns a pointer to the part of the path after the last path name separator. | |
char_type const * | get_ext () const |
Returns a pointer to the extension, or to the empty string if there is no extension. | |
size_type | length () const |
Returns the length of the converted path. | |
size_type | size () const |
Returns the length of the converted path. | |
bool_type | empty () const |
Determines whether the path is empty. | |
char_type const * | c_str () const |
Conversion to a non-mutable (const) pointer to the path. | |
char_type const & | operator[] (size_type index) const |
Returns a non-mutable (const) reference to the character at the given index. | |
bool_type | exists () const |
Indicates whether the path represents an existing file system entry. | |
bool_type | is_rooted () const |
Indicates whether the path is rooted. | |
bool_type | is_absolute () const |
Indicates whether the path is absolute. | |
bool_type | has_sep () const |
Indicates whether the path has a trailing separator. | |
size_type | copy (char_type *buffer, size_type cchBuffer) const |
Copies the contents into a caller supplied buffer. | |
static size_type | max_size () |
The maximum possible length of a path. | |
Public Types | |
Types | |
typedef C | char_type |
The char type. | |
typedef T | traits_type |
The traits type. | |
typedef A | allocator_type |
The allocator type. | |
typedef basic_path< C, T, A > | class_type |
The current parameterisation of the type. | |
typedef size_t | size_type |
The size type. | |
typedef bool | bool_type |
The Boolean type. | |
Public Member Functions | |
Operations | |
class_type & | push (class_type const &rhs, bool_type bAddPathNameSeparator=false) |
Appends the contents of rhs to the path. | |
class_type & | push (char_type const *rhs, bool_type bAddPathNameSeparator=false) |
Appends the contents of rhs to the path. | |
class_type & | push_ext (class_type const &rhs, bool_type bAddPathNameSeparator=false) |
Appends the contents of rhs to the path as an extension. | |
class_type & | push_ext (char_type const *rhs, bool_type bAddPathNameSeparator=false) |
Appends the contents of rhs to the path as an extension. | |
class_type & | push_sep () |
Ensures that the path has a trailing path name separator. | |
class_type & | pop (bool_type bRemoveTrailingPathNameSeparator=true) |
Pops the last path element from the path. | |
class_type & | pop_sep () |
Ensures that the path does not have a trailing path name separator. | |
class_type & | pop_ext () |
Removes the extension, if any, from the file component of the path. | |
class_type & | operator/= (char_type const *rhs) |
Equivalent to push(). | |
template<typename S> | |
class_type & | operator/= (S const &rhs) |
Equivalent to push(). | |
void | clear () |
Removes all content. | |
class_type & | make_absolute (bool_type bRemoveTrailingPathNameSeparator=true) |
Converts the path to absolute form. | |
class_type & | canonicalise (bool_type bRemoveTrailingPathNameSeparator=true) |
Canonicalises the path, removing all "./" parts and evaluating all "../" parts. | |
Comparison | |
bool_type | equivalent (char_type const *rhs) const |
bool_type | equivalent (class_type const &rhs) const |
bool_type | equal (char_type const *rhs) const |
bool_type | equal (class_type const &rhs) const |
Classes | |
struct | part |
typedef C char_type |
The char type.
typedef T traits_type |
The traits type.
typedef A allocator_type |
The allocator type.
typedef basic_path<C, T, A> class_type |
The current parameterisation of the type.
typedef size_t size_type |
The size type.
typedef bool bool_type |
The Boolean type.
basic_path | ( | ) |
Constructs an empty path.
basic_path | ( | char_type const * | path | ) | [explicit] |
Constructs a path from path
.
basic_path | ( | S const & | s | ) | [inline, explicit] |
Constructs a path from path
.
References unixstl::c_str_data(), unixstl::c_str_len(), and stlsoft_ns_qual.
basic_path | ( | char_type const * | path, | |
size_type | cch | |||
) |
Constructs a path from cch
characters in path
.
basic_path | ( | class_type const & | rhs | ) |
Copies the contents of rhs
.
class_type& operator= | ( | class_type const & | rhs | ) |
Copies the contents of rhs
.
class_type& operator= | ( | char_type const * | rhs | ) |
Copies the contents of rhs
.
class_type& operator= | ( | S const & | s | ) | [inline] |
class_type& push | ( | class_type const & | rhs, | |
bool_type | bAddPathNameSeparator = false | |||
) |
Appends the contents of rhs
to the path.
class_type& push | ( | char_type const * | rhs, | |
bool_type | bAddPathNameSeparator = false | |||
) |
Appends the contents of rhs
to the path.
class_type& push_ext | ( | class_type const & | rhs, | |
bool_type | bAddPathNameSeparator = false | |||
) |
Appends the contents of rhs
to the path as an extension.
class_type& push_ext | ( | char_type const * | rhs, | |
bool_type | bAddPathNameSeparator = false | |||
) |
Appends the contents of rhs
to the path as an extension.
class_type& push_sep | ( | ) |
Ensures that the path has a trailing path name separator.
class_type& pop | ( | bool_type | bRemoveTrailingPathNameSeparator = true |
) |
Pops the last path element from the path.
class_type& pop_sep | ( | ) |
Ensures that the path does not have a trailing path name separator.
class_type& pop_ext | ( | ) |
Removes the extension, if any, from the file component of the path.
class_type& operator/= | ( | char_type const * | rhs | ) |
Equivalent to push().
class_type& operator/= | ( | S const & | rhs | ) | [inline] |
void clear | ( | ) |
Removes all content.
class_type& make_absolute | ( | bool_type | bRemoveTrailingPathNameSeparator = true |
) |
Converts the path to absolute form.
class_type& canonicalise | ( | bool_type | bRemoveTrailingPathNameSeparator = true |
) |
Canonicalises the path, removing all "./" parts and evaluating all "../" parts.
char_type const* get_file | ( | ) | const |
Returns a pointer to the part of the path after the last path name separator.
If the path contains no path name separator, the full path will be returned
char_type const* get_ext | ( | ) | const |
Returns a pointer to the extension, or to the empty string if there is no extension.
size_type length | ( | ) | const |
Returns the length of the converted path.
static size_type max_size | ( | ) | [static] |
The maximum possible length of a path.
bool_type empty | ( | ) | const |
Determines whether the path is empty.
char_type const* c_str | ( | ) | const |
Conversion to a non-mutable (const) pointer to the path.
Returns a non-mutable (const) reference to the character at the given index.
index >= size()
. bool_type exists | ( | ) | const |
Indicates whether the path represents an existing file system entry.
bool_type is_rooted | ( | ) | const |
Indicates whether the path is rooted.
bool_type is_absolute | ( | ) | const |
Indicates whether the path is absolute.
bool_type has_sep | ( | ) | const |
Indicates whether the path has a trailing separator.
Copies the contents into a caller supplied buffer.
buffer | Pointer to character buffer to receive the contents. May be NULL, in which case the method returns size(). | |
cchBuffer | Number of characters of available space in buffer . |