4#include "zipios++/zipios-config.h"
25 FilePath(
const string &path =
"",
bool check_exists =
false ) ;
27 inline FilePath &operator= (
const string &rhs ) ;
29 inline operator string()
const ;
41 inline bool exists()
const ;
61 inline bool isFifo()
const ;
75 static const char _separator;
78 mutable bool _checked ;
79 mutable bool _exists ;
80 mutable bool _is_reg ;
81 mutable bool _is_dir ;
82 mutable bool _is_char ;
83 mutable bool _is_block ;
84 mutable bool _is_socket ;
85 mutable bool _is_fifo ;
94FilePath &FilePath::operator= (
const string &rhs ) {
101 if ( _path.size() > 0 )
102 if ( _path[ _path.size() -1 ] == _separator )
103 _path.erase( _path.size() - 1 ) ;
106FilePath::operator string()
const {
112 if ( _path.size() > 0 )
113 return _path + _separator + name._path ;
120 string::size_type pos ;
121 pos = _path.find_last_of( _separator ) ;
122 if ( pos != string::npos )
123 return _path.substr( pos + 1);
FilePath represents a path to a file or directory name.
void check() const
This function sets _checked to true, stats the path, to see if it exists and to determine what type o...
bool isCharSpecial() const
bool isBlockSpecial() const
void pruneTrailingSeparator()
Prunes the trailing separator of a specified path.
FilePath filename() const
Returns filename of the FilePath object by pruning the path off.
FilePath operator+(const FilePath &name) const
Concatenates FilePath objects.