40 #ifndef CA_MGM_PATH_PATHINFO_HPP
41 #define CA_MGM_PATH_PATHINFO_HPP
43 #include <ca-mgm/config.h>
53 #include <sys/types.h>
60 namespace CA_MGM_NAMESPACE {
133 friend std::ostream &
operator<<( std::ostream & str, FileType obj );
152 struct stat m_statbuf_C;
176 PathInfo(
const std::string & path,
Mode initial = E_STAT );
224 int error()
const {
return m_error; }
230 void setPath(
const PathName & path );
244 void setMode( Mode mode );
259 bool stat (
const PathName & path );
273 bool lstat (
const PathName & path );
290 bool operator()(
const PathName & path );
349 FileType fileType()
const;
395 nlink_t nlink()
const;
464 mode_t uperm()
const;
472 mode_t gperm()
const;
480 mode_t operm()
const;
498 bool isPerm ( mode_t m )
const;
509 bool hasPerm( mode_t m )
const;
526 mode_t st_mode()
const;
533 mode_t userMay()
const;
542 bool userMayR()
const;
550 bool userMayW()
const;
558 bool userMayX()
const;
567 bool userMayRW()
const;
576 bool userMayRX()
const;
585 bool userMayWX()
const;
594 bool userMayRWX()
const;
633 ::off_t size()
const;
641 blksize_t blksize()
const;
649 blkcnt_t blocks()
const;
658 time_t atime()
const;
665 time_t mtime()
const;
672 time_t ctime()
const;
691 StatMode(
const mode_t & mode_r = 0 ) : _mode( mode_r ) {}
734 mode_t uperm()
const;
735 mode_t gperm()
const;
736 mode_t operm()
const;
739 bool isPerm( mode_t m )
const;
740 bool hasPerm( mode_t m )
const;
742 mode_t st_mode()
const;
788 bool insert(
const dev_t & dev_r,
const ino_t & ino_r ) {
789 return _devino[dev_r].insert( ino_r ).second;
800 #endif // CA_MGM_PATH_PATHINFO_HPP
Simple cache remembering device/inode to detect hard links.
Definition: PathInfo.hpp:763
bool insert(const dev_t &dev_r, const ino_t &ino_r)
Remember dev/ino.
Definition: PathInfo.hpp:788
PathName manipulation class.
Definition: PathName.hpp:65
void clear()
Clear cache.
Definition: PathInfo.hpp:778
int m_error
Definition: PathInfo.hpp:154
FileType
Definition: PathInfo.hpp:106
int error() const
Returns the internal error code.
Definition: PathInfo.hpp:224
Mode mode() const
Returns the stat mode which is currently set in this PathInfo object.
Definition: PathInfo.hpp:211
bool exists() const
True if the path that this PathInfo object points to exists.
Definition: PathInfo.hpp:337
mode_t _mode
Definition: PathInfo.hpp:689
LiMaL path name manipulation utilities.
std::string toString() const
Returns a std::string formed from the PathName object this this PathInfo object holds.
Definition: PathInfo.hpp:204
std::ostream & operator<<(std::ostream &ostr, const PathName &path)
Wrapper class for mode_t values as derived from ::stat.
Definition: PathInfo.hpp:684
Wrapper class for ::stat/::lstat and other file/directory related operations.
Definition: PathInfo.hpp:100
Mode
Definition: PathInfo.hpp:104
DevInoCache()
Constructor.
Definition: PathInfo.hpp:773
Mode m_mode
Definition: PathInfo.hpp:153
std::string toString() const
Returns the complete path this PathName object holds.
const PathName path() const
Returns the PathName object this PathInfo object holds.
Definition: PathInfo.hpp:196
StatMode(const mode_t &mode_r=0)
Definition: PathInfo.hpp:691
PathName m_path
Definition: PathInfo.hpp:146
std::map< dev_t, std::set< ino_t > > _devino
Definition: PathInfo.hpp:767