![]() |
Home | Libraries | Author | Links |
NameT shall be convertable to std::string thus representing the path's character representation.
Definition at line 253 of file filesysaids.hpp.
Public Types | |
typedef NameT | name_type |
Template type parameter NameT. | |
typedef boost::filesystem::path | base |
Public base class. | |
Public Member Functions | |
path () | |
Construct an empty path object. | |
path (const boost::filesystem::path &src) | |
Construct a path object from src. | |
path (const std::string &src) | |
Construct a path object from src. | |
path (const char *src) | |
Construct a path object from src. | |
path (const std::string &src, name_check checker) | |
Construct a path object from src with name check function checker. | |
path (const char *src, name_check checker) | |
Construct a path object from src with name check function checker. | |
const name_type | string () const |
Returns this path's character representation as name_type object which is convertible to std::string. | |
std::string | head () const |
If this path is not empty, the method returns *begin(), else an empty std::string. | |
path< NameT > | tail_path () const |
If this path is not empty, the method retuns a path object consisting of this path with stripped off the head() component, else the empty path. | |
bool | has_head () const |
Returns true, if head() is not empty, else false. | |
bool | has_tail_path () const |
Returns true, if tail_path() is not empty, else false. | |
path< NameT > | operator- (const base &stem) const |
If stem is the initial part of this path, return a path<NameT> object consisting of this path stripped off stem, else return the empty path. | |
path< NameT > | relative_to_directory (const base &source) const |
If this path is empty, the empty path object is returned. | |
template<class DataT> | |
int | recurse (DataT &parent) const |
The member function template recurse handles this path, and if it is a directory and recursion is not switched off, recursively all items of the tree spanned by this directory. | |
template<class DataT> | |
int | recurse (typename DataT::env_type &env) const |
The member function template recurse handles this path, and if it is a directory and recursion is not switched off, recursively all items of the tree spanned by this directory. | |
template<class DataT> | |
int | traverse (DataT &parent, const path< NameT > &route) const |
The member function template traverse handles this path, and then if the normalized route r consists of the components r1, . | |
template<class DataT> | |
int | traverse (typename DataT::env_type &env, const path< NameT > &route) const |
The member function template traverse handles this path, and then if the normalized route r consists of the components r1, . | |
Classes | |
class | dirdata |
Abstract base class template of directory data created for each directory the recusion handles. More... | |
class | recursionenv |
Type of or public base class of the global recursion environment used by the methods recurse() and traverse(). More... |
stm::path< NameT >::path | ( | const boost::filesystem::path< NameT > & | src | ) |
Construct a path object from src.
Construct a path object from src.
Construct a path object from src.
stm::path< NameT >::path | ( | const std::string & | src, | |
name_check | checker | |||
) |
Construct a path object from src with name check function checker.
Construct a path object from src with name check function checker.
Returns this path's character representation as name_type object which is convertible to std::string.
std::string stm::path< NameT >::head | ( | ) | const |
If this path is not empty, the method returns *begin(), else an empty std::string.
bool stm::path< NameT >::has_head | ( | ) | const |
Returns true, if head() is not empty, else false.
bool stm::path< NameT >::has_tail_path | ( | ) | const |
Returns true, if tail_path() is not empty, else false.
path<NameT> stm::path< NameT >::relative_to_directory | ( | const base & | source | ) | const |
If this path is empty, the empty path object is returned.
If the completed forms of this path and source have the same root directory, a non-empty normalized path object result is returned such that source / result designates the same file system element as this path, where source is assumed to be a directory. Else the completed form of this path is returned.
int stm::path< NameT >::recurse | ( | DataT & | parent | ) | const |
The member function template recurse handles this path, and if it is a directory and recursion is not switched off, recursively all items of the tree spanned by this directory.
It is an error, if this path does not exist.
Provided EnvT is publicly derived from path<NameT>::recursionenv and DataT is publicly derived from path<NameT>::dirdata<DataT, EnvT>, then EnvT is the same type as DataT::env_type and is the type of the recursion environment. The argument parent describes the directory data of this path's parent directory and shall be obtained by the constructor
DataT parent (env);
EnvT env (root, flags);
After successful return the results of the execution are contained in the directory data parent and in the recursion environment accessible through parent.env ().
On success 0 is returned, else a value < 0. If -1 is returned, the variable errno reflects the error's cause.
int stm::path< NameT >::recurse | ( | typename DataT::env_type & | env | ) | const |
The member function template recurse handles this path, and if it is a directory and recursion is not switched off, recursively all items of the tree spanned by this directory.
It is an error, if this path does not exist.
Provided EnvT is publicly derived from path<NameT>::recursionenv and DataT is publicly derived from path<NameT>::dirdata<DataT, EnvT>, then EnvT is the same type as DataT::env_type and is the type of the recursion environment. The argument env of this type shall be obtained by the constructor
EnvT env (root, flags);
After successful return the results of the execution are contained in the recursion environment env.
On success 0 is returned, else a value < 0. If -1 is returned, the variable errno reflects the error's cause.
int stm::path< NameT >::traverse | ( | DataT & | parent, | |
const path< NameT > & | route | |||
) | const |
The member function template traverse handles this path, and then if the normalized route r consists of the components r1, .
.., rn, successively the paths *this / r1, *this / r1 / r2, ..., *this / r1 / ... / rn.
It is an error, if r.has_root_path() is true, or if r.head() == '.' or r.head() == '..' holds, whereas it is not required that this path or any of the composed paths exist.
Provided EnvT is publicly derived from path<NameT>::recursionenv and DataT is publicly derived from path<NameT>::dirdata<DataT, EnvT>, then EnvT is the same type as DataT::env_type and is the type of the recursion environment. The argument parent describes the directory data of this path's parent directory and shall be obtained by the constructor
DataT parent (env);
EnvT env (root, flags);
After successful return the results of the execution are contained in the directory data parent and in the recursion environment accessible through parent.env ().
On success 0 is returned, else a value < 0. If -1 is returned, the variable errno reflects the error's cause.
int stm::path< NameT >::traverse | ( | typename DataT::env_type & | env, | |
const path< NameT > & | route | |||
) | const |
The member function template traverse handles this path, and then if the normalized route r consists of the components r1, .
.., rn, successively the paths *this / r1, *this / r1 / r2, ..., *this / r1 / ... / rn.
It is an error, if r.has_root_path() is true, or if r.head() == '.' or r.head() == '..' holds, whereas it is not required that this path or any of the composed paths exist.
Provided EnvT is publicly derived from path<NameT>::recursionenv and DataT is publicly derived from path<NameT>::dirdata<DataT, EnvT>, then EnvT is the same type as DataT::env_type and is the type of the recursion environment. The argument env of this type shall be obtained by the constructor
EnvT env (root, flags);
After successful return the results of the execution are contained in the recursion environment env.
On success 0 is returned, else a value < 0. If -1 is returned, the variable errno reflects the error's cause.
© Copyright Tom Michaelis 2002-2007
Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).