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 ;
44 inline bool isRegular()
const ;
47 inline bool isDirectory()
const ;
51 inline bool isCharSpecial()
const ;
55 inline bool isBlockSpecial()
const ;
58 inline bool isSocket()
const ;
61 inline bool isFifo()
const ;
66 inline void pruneTrailingSeparator() ;
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 ;
94 FilePath &FilePath::operator= (
const string &rhs ) {
96 pruneTrailingSeparator() ;
101 if ( _path.size() > 0 )
102 if ( _path[ _path.size() -1 ] == _separator )
103 _path.erase( _path.size() - 1 ) ;
106 FilePath::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 filename() const
Returns filename of the FilePath object by pruning the path off.
bool isBlockSpecial() const
void pruneTrailingSeparator()
Prunes the trailing separator of a specified path.
bool isCharSpecial() const
FilePath operator+(const FilePath &name) const
Concatenates FilePath objects.
FilePath represents a path to a file or directory name.