#include <PathInfo.h>
Public Types | |
| enum | Mode { OPTIONAL = Traits::BIT_OPTIONAL | Traits::BIT_ONCE, MANDTAORY = Traits::BIT_MANDTAORY | Traits::BIT_ONCE, MULTIPLE_OPTIONAL = Traits::BIT_OPTIONAL | Traits::BIT_MULTIPLE, MULTIPLE_MANDTAORY = Traits::BIT_MANDTAORY | Traits::BIT_MULTIPLE, STAT, LSTAT } |
| stat() or lstat() More... | |
Public Member Functions | |
| ~PathInfo () | |
| Dtor. | |
| const Pathname & | path () const |
| Return current Pathname. | |
| const std::string & | asString () const |
| Return current Pathname as String. | |
| Mode | mode () const |
| Return current stat Mode. | |
| int | error () const |
| Return error returned from last stat/lstat call. | |
| void | setPath (const Pathname &path) |
| Set a new Pathname. | |
| void | setMode (Mode mode) |
| Set a new Mode . | |
| bool | stat (const Pathname &path) |
| STAT path. | |
| bool | lstat (const Pathname &path) |
| LSTAT path. | |
| bool | operator() (const Pathname &path) |
| Restat path using current mode. | |
| bool | stat () |
| STAT current path. | |
| bool | lstat () |
| LSTAT current path. | |
| bool | operator() () |
| Restat current path using current mode. | |
| bool | isExist () const |
| Return whether valid stat info exists. | |
| StatMode | asStatMode () const |
| Return st_mode() as filesystem::StatMode. | |
| nlink_t | nlink () const |
Private Attributes | |
| Pathname | path_t |
| stat | statbuf_C |
| Mode | mode_e |
| int | error_i |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const PathInfo &obj) |
| Stream output. | |
false or 0, if stat was not successful.For convenience PathInfo is available as zypp::PathInfo too.
Definition at line 218 of file PathInfo.h.
Definition at line 224 of file PathInfo.h.
| zypp::filesystem::PathInfo::PathInfo | ( | ) |
Definition at line 129 of file PathInfo.cc.
| zypp::filesystem::PathInfo::PathInfo | ( | const std::string & | path, | |
| Mode | initial = STAT | |||
| ) | [explicit] |
| zypp::filesystem::PathInfo::PathInfo | ( | const char * | path, | |
| Mode | initial = STAT | |||
| ) | [explicit] |
| zypp::filesystem::PathInfo::~PathInfo | ( | ) |
| zypp::filesystem::PathInfo::PathInfo | ( | ) |
Definition at line 129 of file PathInfo.cc.
| zypp::filesystem::PathInfo::PathInfo | ( | const std::string & | path, | |
| Mode | initial = STAT | |||
| ) | [explicit] |
| zypp::filesystem::PathInfo::PathInfo | ( | const char * | path, | |
| Mode | initial = STAT | |||
| ) | [explicit] |
| const Pathname& zypp::filesystem::PathInfo::path | ( | ) | const [inline] |
Return current Pathname.
Definition at line 244 of file PathInfo.h.
References path_t.
Referenced by lstat(), operator()(), setPath(), and stat().
| const std::string& zypp::filesystem::PathInfo::asString | ( | ) | const [inline] |
Return current Pathname as String.
Definition at line 246 of file PathInfo.h.
References zypp::filesystem::Pathname::asString(), and path_t.
Referenced by zypp::filesystem::operator<<().
| Mode zypp::filesystem::PathInfo::mode | ( | ) | const [inline] |
| int zypp::filesystem::PathInfo::error | ( | ) | const [inline] |
Return error returned from last stat/lstat call.
Definition at line 250 of file PathInfo.h.
References error_i.
| void zypp::filesystem::PathInfo::setPath | ( | const Pathname & | path | ) | [inline] |
Set a new Pathname.
Definition at line 253 of file PathInfo.h.
References error_i, path(), and path_t.
Referenced by lstat(), operator()(), and stat().
| void zypp::filesystem::PathInfo::setMode | ( | Mode | mode | ) | [inline] |
| bool zypp::filesystem::PathInfo::stat | ( | const Pathname & | path | ) | [inline] |
STAT path.
Definition at line 258 of file PathInfo.h.
References operator()(), path(), setMode(), setPath(), and STAT.
| bool zypp::filesystem::PathInfo::lstat | ( | const Pathname & | path | ) | [inline] |
LSTAT path.
Definition at line 260 of file PathInfo.h.
References LSTAT, operator()(), path(), setMode(), and setPath().
| bool zypp::filesystem::PathInfo::operator() | ( | const Pathname & | path | ) | [inline] |
Restat path using current mode.
Definition at line 262 of file PathInfo.h.
References operator()(), path(), and setPath().
| bool zypp::filesystem::PathInfo::stat | ( | ) | [inline] |
STAT current path.
Definition at line 265 of file PathInfo.h.
References operator()(), setMode(), and STAT.
Referenced by operator()().
| bool zypp::filesystem::PathInfo::lstat | ( | ) | [inline] |
LSTAT current path.
Definition at line 267 of file PathInfo.h.
References LSTAT, operator()(), and setMode().
Referenced by operator()().
| bool zypp::filesystem::PathInfo::operator() | ( | ) |
Restat current path using current mode.
Definition at line 187 of file PathInfo.cc.
References zypp::filesystem::Pathname::asString(), zypp::filesystem::Pathname::empty(), error_i, lstat(), LSTAT, mode_e, path_t, stat(), STAT, and statbuf_C.
Referenced by lstat(), operator()(), PathInfo(), and stat().
| bool zypp::filesystem::PathInfo::isExist | ( | ) | const [inline] |
Return whether valid stat info exists.
That's usg. whether the file exist and you had permission to stat it.
Definition at line 277 of file PathInfo.h.
References error_i.
Referenced by atime(), blksize(), blocks(), zypp::filesystem::clean_dir(), ctime(), dev(), zypp::filesystem::erase(), fileType(), gperm(), group(), hasPerm(), ino(), isBlk(), isChr(), isDir(), isFifo(), isFile(), isGid(), isLink(), isPerm(), isRGrp(), isROth(), isRUsr(), isSock(), isUid(), isVtx(), isWGrp(), isWOth(), isWUsr(), isXGrp(), isXOth(), isXUsr(), mtime(), nlink(), zypp::filesystem::operator<<(), operm(), owner(), perm(), rdev(), zypp::filesystem::recursive_rmdir(), size(), st_mode(), uperm(), userMay(), and zypp::filesystem::TmpPath::Impl::~Impl().
| FileType zypp::filesystem::PathInfo::fileType | ( | ) | const |
Definition at line 211 of file PathInfo.cc.
References asStatMode(), zypp::filesystem::StatMode::fileType(), zypp::filesystem::FT_NOT_EXIST, and isExist().
| bool zypp::filesystem::PathInfo::isFile | ( | ) | const [inline] |
Definition at line 285 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::copy(), zypp::filesystem::copy_file2dir(), and zypp::filesystem::operator<<().
| bool zypp::filesystem::PathInfo::isDir | ( | ) | const [inline] |
Definition at line 286 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::clean_dir(), zypp::filesystem::copy(), zypp::filesystem::copy_dir(), zypp::filesystem::copy_dir_content(), zypp::filesystem::copy_file2dir(), zypp::filesystem::erase(), zypp::filesystem::recursive_rmdir(), zypp::filesystem::TmpDir::TmpDir(), zypp::filesystem::TmpFile::TmpFile(), and zypp::filesystem::TmpPath::Impl::~Impl().
| bool zypp::filesystem::PathInfo::isLink | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isChr | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isBlk | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isFifo | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isSock | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isRUsr | ( | ) | const [inline] |
Definition at line 294 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isR().
| bool zypp::filesystem::PathInfo::isWUsr | ( | ) | const [inline] |
Definition at line 295 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isW().
| bool zypp::filesystem::PathInfo::isXUsr | ( | ) | const [inline] |
Definition at line 296 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isX().
| bool zypp::filesystem::PathInfo::isR | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isRGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isWGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isXGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isROth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isWOth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isXOth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isUid | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isGid | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isVtx | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isPerm | ( | mode_t | m | ) | const [inline] |
| bool zypp::filesystem::PathInfo::hasPerm | ( | mode_t | m | ) | const [inline] |
| mode_t zypp::filesystem::PathInfo::uperm | ( | ) | const [inline] |
Definition at line 317 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::gperm | ( | ) | const [inline] |
Definition at line 318 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::operm | ( | ) | const [inline] |
Definition at line 319 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::perm | ( | ) | const [inline] |
| mode_t zypp::filesystem::PathInfo::st_mode | ( | ) | const [inline] |
Definition at line 322 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by asStatMode().
| StatMode zypp::filesystem::PathInfo::asStatMode | ( | ) | const [inline] |
Return st_mode() as filesystem::StatMode.
Definition at line 326 of file PathInfo.h.
References st_mode().
Referenced by fileType(), and zypp::filesystem::operator<<().
| nlink_t zypp::filesystem::PathInfo::nlink | ( | ) | const [inline] |
| uid_t zypp::filesystem::PathInfo::owner | ( | ) | const [inline] |
Definition at line 332 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<(), and userMay().
| gid_t zypp::filesystem::PathInfo::group | ( | ) | const [inline] |
Definition at line 333 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<(), and userMay().
| mode_t zypp::filesystem::PathInfo::userMay | ( | ) | const |
Returns current users permission ([0-7]).
Definition at line 223 of file PathInfo.cc.
References gperm(), group(), isExist(), operm(), owner(), and uperm().
Referenced by userMayR(), userMayRW(), userMayRWX(), userMayRX(), userMayW(), userMayWX(), and userMayX().
| bool zypp::filesystem::PathInfo::userMayR | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayWX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRWX | ( | ) | const [inline] |
| ino_t zypp::filesystem::PathInfo::ino | ( | ) | const [inline] |
| dev_t zypp::filesystem::PathInfo::dev | ( | ) | const [inline] |
| dev_t zypp::filesystem::PathInfo::rdev | ( | ) | const [inline] |
| unsigned int zypp::filesystem::PathInfo::major | ( | ) | const |
| unsigned int zypp::filesystem::PathInfo::minor | ( | ) | const |
| off_t zypp::filesystem::PathInfo::size | ( | ) | const [inline] |
Definition at line 364 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<().
| unsigned long zypp::filesystem::PathInfo::blksize | ( | ) | const [inline] |
| unsigned long zypp::filesystem::PathInfo::blocks | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::atime | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::mtime | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::ctime | ( | ) | const [inline] |
| FileType zypp::filesystem::PathInfo::fileType | ( | ) | const |
Definition at line 211 of file PathInfo.cc.
References asStatMode(), zypp::filesystem::StatMode::fileType(), zypp::filesystem::FT_NOT_EXIST, and isExist().
| bool zypp::filesystem::PathInfo::isFile | ( | ) | const [inline] |
Definition at line 285 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::copy(), zypp::filesystem::copy_file2dir(), and zypp::filesystem::operator<<().
| bool zypp::filesystem::PathInfo::isDir | ( | ) | const [inline] |
Definition at line 286 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::clean_dir(), zypp::filesystem::copy(), zypp::filesystem::copy_dir(), zypp::filesystem::copy_dir_content(), zypp::filesystem::copy_file2dir(), zypp::filesystem::erase(), zypp::filesystem::recursive_rmdir(), zypp::filesystem::TmpDir::TmpDir(), zypp::filesystem::TmpFile::TmpFile(), and zypp::filesystem::TmpPath::Impl::~Impl().
| bool zypp::filesystem::PathInfo::isLink | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isChr | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isBlk | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isFifo | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isSock | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isRUsr | ( | ) | const [inline] |
Definition at line 294 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isR().
| bool zypp::filesystem::PathInfo::isWUsr | ( | ) | const [inline] |
Definition at line 295 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isW().
| bool zypp::filesystem::PathInfo::isXUsr | ( | ) | const [inline] |
Definition at line 296 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by isX().
| bool zypp::filesystem::PathInfo::isR | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isRGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isWGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isXGrp | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isROth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isWOth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isXOth | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isUid | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isGid | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isVtx | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::isPerm | ( | mode_t | m | ) | const [inline] |
| bool zypp::filesystem::PathInfo::hasPerm | ( | mode_t | m | ) | const [inline] |
| mode_t zypp::filesystem::PathInfo::uperm | ( | ) | const [inline] |
Definition at line 317 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::gperm | ( | ) | const [inline] |
Definition at line 318 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::operm | ( | ) | const [inline] |
Definition at line 319 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by userMay().
| mode_t zypp::filesystem::PathInfo::perm | ( | ) | const [inline] |
| mode_t zypp::filesystem::PathInfo::st_mode | ( | ) | const [inline] |
Definition at line 322 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by asStatMode().
| uid_t zypp::filesystem::PathInfo::owner | ( | ) | const [inline] |
Definition at line 332 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<(), and userMay().
| gid_t zypp::filesystem::PathInfo::group | ( | ) | const [inline] |
Definition at line 333 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<(), and userMay().
| mode_t zypp::filesystem::PathInfo::userMay | ( | ) | const |
Returns current users permission ([0-7]).
Definition at line 223 of file PathInfo.cc.
References gperm(), group(), isExist(), operm(), owner(), and uperm().
Referenced by userMayR(), userMayRW(), userMayRWX(), userMayRX(), userMayW(), userMayWX(), and userMayX().
| bool zypp::filesystem::PathInfo::userMayR | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRW | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayWX | ( | ) | const [inline] |
| bool zypp::filesystem::PathInfo::userMayRWX | ( | ) | const [inline] |
| ino_t zypp::filesystem::PathInfo::ino | ( | ) | const [inline] |
| dev_t zypp::filesystem::PathInfo::dev | ( | ) | const [inline] |
| dev_t zypp::filesystem::PathInfo::rdev | ( | ) | const [inline] |
| unsigned int zypp::filesystem::PathInfo::major | ( | ) | const |
| unsigned int zypp::filesystem::PathInfo::minor | ( | ) | const |
| off_t zypp::filesystem::PathInfo::size | ( | ) | const [inline] |
Definition at line 364 of file PathInfo.h.
References isExist(), and statbuf_C.
Referenced by zypp::filesystem::operator<<().
| unsigned long zypp::filesystem::PathInfo::blksize | ( | ) | const [inline] |
| unsigned long zypp::filesystem::PathInfo::blocks | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::atime | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::mtime | ( | ) | const [inline] |
| time_t zypp::filesystem::PathInfo::ctime | ( | ) | const [inline] |
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const PathInfo & | obj | |||
| ) | [friend] |
Pathname zypp::filesystem::PathInfo::path_t [private] |
Definition at line 377 of file PathInfo.h.
Referenced by asString(), operator()(), path(), and setPath().
struct stat zypp::filesystem::PathInfo::statbuf_C [private] |
Definition at line 378 of file PathInfo.h.
Referenced by atime(), blksize(), blocks(), ctime(), dev(), gperm(), group(), ino(), isBlk(), isChr(), isDir(), isFifo(), isFile(), isGid(), isLink(), isRGrp(), isROth(), isRUsr(), isSock(), isUid(), isVtx(), isWGrp(), isWOth(), isWUsr(), isXGrp(), isXOth(), isXUsr(), major(), minor(), mtime(), nlink(), operator()(), operm(), owner(), perm(), rdev(), size(), st_mode(), and uperm().
Mode zypp::filesystem::PathInfo::mode_e [private] |
int zypp::filesystem::PathInfo::error_i [private] |
Definition at line 380 of file PathInfo.h.
Referenced by error(), isExist(), operator()(), setMode(), and setPath().
1.5.0