#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. | |
| const char * | c_str () 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. | |
| std::string | extension () const |
| Return all of the characters in name after and including the last dot in the last element of name. | |
| 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 std::string | extension (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(). |
|
|
|
String representation.
Definition at line 81 of file Pathname.h. References name_t. Referenced by zypp::filesystem::df(). |
|
|
|
Test for an absolute path.
Definition at line 87 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::media::MediaCurl::getDoesFileExist(), zypp::target::rpm::RpmDb::initDatabase(), zypp::target::rpm::librpmDb::newLibrpmDb(), and relativename(). |
|
|
Test for a relative path.
Definition at line 89 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 92 of file Pathname.h. Referenced by zypp::media::MediaAccess::getFile(), and zypp::source::susetags::SuseTagsImpl::initCacheDir(). |
|
|
Definition at line 189 of file Pathname.cc. |
|
|
Return the last component of this path.
Definition at line 96 of file Pathname.h. Referenced by extension(), and zypp::media::MediaAccess::getFile(). |
|
|
Definition at line 215 of file Pathname.cc. References asString(), empty(), and prfx_i. |
|
|
Return all of the characters in name after and including the last dot in the last element of name. If there is no dot in the last element of name then returns the empty string. Definition at line 103 of file Pathname.h. |
|
|
Definition at line 235 of file Pathname.cc. References basename(), and empty(). |
|
|
Return this path, adding a leading '/' if relative.
Definition at line 107 of file Pathname.h. Referenced by zypp::media::getShare(), zypp::media::MediaHandler::localPath(), and zypp::media::stripShare(). |
|
|
Definition at line 108 of file Pathname.h. References cat(), and relative(). |
|
|
Return this path, removing a leading '/' if absolute.
Definition at line 112 of file Pathname.h. |
|
|
Definition at line 113 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 124 of file Pathname.h. Referenced by absolutename(), operator+(), operator+=(), operator/(), operator/=(), and relativename(). |
|
||||||||||||
|
Definition at line 252 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 132 of file Pathname.h. Referenced by zypp::target::rpm::RpmDb::doRebuildDatabase(). |
|
||||||||||||
|
|
|
|
Referenced by Pathname(). |
|
||||||||||||
|
Definition at line 144 of file Pathname.h. References asString(). |
|
||||||||||||
|
Definition at line 148 of file Pathname.h. References asString(). |
|
||||||||||||
|
Concatenate two Pathname. Definition at line 152 of file Pathname.h. References cat(). |
|
||||||||||||
|
Concatenate two Pathname.
Definition at line 158 of file Pathname.h. References cat(). |
|
||||||||||||
|
Stream output Definition at line 164 of file Pathname.h. References asString(). |
|
|
Definition at line 136 of file Pathname.h. Referenced by absolute(), basename(), dirname(), operator=(), and relative(). |
|
|
Definition at line 137 of file Pathname.h. Referenced by absolute(), asString(), c_str(), dirname(), empty(), operator=(), and relative(). |
1.4.6