#include <Pathname.h>
Public Member Functions | |
Pathname () | |
Default ctor: an empty path. | |
Pathname (const std::string &name_tv) | |
Ctor from string. | |
Pathname (const char *name_tv) | |
Ctor from char*. | |
Pathname & | operator= (const Pathname &path_tv) |
Assign. | |
Pathname & | operator/= (const Pathname &path_tv) |
Concatenate and assing. | |
Pathname & | operator+= (const Pathname &path_tv) |
Concatenate and assing. | |
const std::string & | asString () const |
String representation. | |
bool | empty () const |
Test for an empty path. | |
bool | absolute () const |
Test for an absolute path. | |
bool | relative () const |
Test for a relative path. | |
Pathname | dirname () const |
Return all but the last component od this path. | |
std::string | basename () const |
Return the last component of this path. | |
Pathname | absolutename () const |
Return this path, adding a leading '/' if relative. | |
Pathname | relativename () const |
Return this path, removing a leading '/' if absolute. | |
Pathname | cat (const Pathname &r) const |
Concatenation of pathnames. | |
Pathname | extend (const std::string &r) const |
Append string r to the last component of the path. | |
Static Public Member Functions | |
static Pathname | dirname (const Pathname &name_tv) |
static std::string | basename (const Pathname &name_tv) |
static Pathname | absolutename (const Pathname &name_tv) |
static Pathname | relativename (const Pathname &name_tv) |
static Pathname | cat (const Pathname &l, const Pathname &r) |
static Pathname | extend (const Pathname &l, const std::string &r) |
Private Member Functions | |
void | _assign (const std::string &name_tv) |
Private Attributes | |
std::string::size_type | prfx_i |
std::string | name_t |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const Pathname &l, const Pathname &r) |
bool | operator!= (const Pathname &l, const Pathname &r) |
Pathname | operator/ (const Pathname &l, const Pathname &r) |
Pathname | operator+ (const Pathname &l, const Pathname &r) |
std::ostream & | operator<< (std::ostream &str, const Pathname &obj) |
Review. Maybe use COW pimpl, ckeck storage.
EXPLICIT ctors.
Definition at line 42 of file Pathname.h.
|
Default ctor: an empty path.
Definition at line 46 of file Pathname.h. |
|
Ctor from string.
Definition at line 51 of file Pathname.h. References _assign(). |
|
Ctor from char*.
Definition at line 55 of file Pathname.h. References _assign(). |
|
Assign.
Definition at line 59 of file Pathname.h. |
|
Concatenate and assing.
Definition at line 67 of file Pathname.h. References cat(). |
|
Concatenate and assing.
Definition at line 73 of file Pathname.h. References cat(). |
|
|
|
Test for an absolute path.
Definition at line 83 of file Pathname.h. References empty(), name_t, and prfx_i. Referenced by zypp::media::MediaHandler::checkAttachPoint(), zypp::media::MediaHandler::createAttachPoint(), zypp::target::rpm::librpmDb::dbAccess(), zypp::target::rpm::librpmDb::DbDirInfo::DbDirInfo(), zypp::media::MediaCurl::doGetFileCopy(), zypp::target::rpm::RpmDb::initDatabase(), zypp::target::rpm::librpmDb::newLibrpmDb(), and relativename(). |
|
Test for a relative path.
Definition at line 85 of file Pathname.h. References empty(), name_t, and prfx_i. Referenced by absolutename(), zypp::filesystem::assert_dir(), and zypp::media::ProxyInfoSysconfig::ProxyInfoSysconfig(). |
|
Return all but the last component od this path.
Definition at line 88 of file Pathname.h. Referenced by zypp::media::MediaAccess::getFile(), and zypp::source::susetags::SuseTagsImpl::initCacheDir(). |
|
Definition at line 187 of file Pathname.cc. |
|
Return the last component of this path.
Definition at line 92 of file Pathname.h. Referenced by zypp::media::MediaAccess::getFile(). |
|
Definition at line 213 of file Pathname.cc. References asString(), empty(), and prfx_i. |
|
Return this path, adding a leading '/' if relative.
Definition at line 96 of file Pathname.h. Referenced by zypp::media::getShare(), zypp::media::MediaHandler::localPath(), and zypp::media::stripShare(). |
|
Definition at line 97 of file Pathname.h. References cat(), and relative(). |
|
Return this path, removing a leading '/' if absolute.
Definition at line 101 of file Pathname.h. |
|
Definition at line 102 of file Pathname.h. References absolute(), and cat(). |
|
Concatenation of pathnames.
"foo" / "baa" ==> "foo/baa" "foo/" / "baa" ==> "foo/baa" "foo" / "/baa" ==> "foo/baa" "foo/" / "/baa" ==> "foo/baa" Definition at line 113 of file Pathname.h. Referenced by absolutename(), operator+(), operator+=(), operator/(), operator/=(), and relativename(). |
|
Definition at line 233 of file Pathname.cc. References asString(), and empty(). |
|
Append string r to the last component of the path.
"foo/baa".extend( ".h" ) ==> "foo/baa.h" Definition at line 121 of file Pathname.h. Referenced by zypp::target::rpm::RpmDb::doRebuildDatabase(). |
|
|
|
Referenced by Pathname(). |
|
Definition at line 133 of file Pathname.h. References asString(). |
|
Definition at line 137 of file Pathname.h. References asString(). |
|
Concatenate two Pathname. Definition at line 141 of file Pathname.h. References cat(). |
|
Concatenate two Pathname.
Definition at line 147 of file Pathname.h. References cat(). |
|
Stream output Definition at line 153 of file Pathname.h. References asString(). |
|
Definition at line 125 of file Pathname.h. Referenced by absolute(), basename(), dirname(), operator=(), and relative(). |
|
Definition at line 126 of file Pathname.h. Referenced by absolute(), asString(), dirname(), empty(), operator=(), and relative(). |