libzypp 17.37.17
|
#include <zypp-core/Pathname.h>
Public Member Functions | |
Pathname () | |
Default ctor: an empty path. | |
Pathname (const std::string &name_r) | |
Ctor from string. | |
Pathname (const char *name_r) | |
Ctor from char*. | |
Pathname (const Pathname &rhs) | |
Copy Ctor. | |
Pathname (Pathname &&tmp) noexcept | |
Move Ctor. | |
Pathname & | operator= (Pathname rhs) |
Assign. | |
Pathname & | operator/= (const Pathname &path_tv) |
Concatenate and assign. | |
Pathname & | operator+= (const Pathname &path_tv) |
Concatenate and assign. | |
const std::string & | asString () const |
String representation. | |
Url | asUrl (const std::string &scheme_r) const |
Url representation using scheme_r schema . | |
Url | asUrl () const |
Url | asDirUrl () const |
Url | asFileUrl () const |
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. | |
bool | emptyOrRoot () const |
Test for "" or "/". | |
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 | realpath () const |
Returns this path as the absolute canonical pathname. | |
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 std::string | showRoot (const Pathname &root_r, const Pathname &path_r) |
String representation as "(root)/path". | |
static std::string | showRootIf (const Pathname &root_r, const Pathname &path_r) |
String representation as "(root)/path", unless root is "/" or empty. | |
static Pathname | dirname (const Pathname &name_r) |
static std::string | basename (const Pathname &name_r) |
static std::string | extension (const Pathname &name_r) |
static Pathname | absolutename (const Pathname &name_r) |
static Pathname | relativename (const Pathname &name_r) |
static Pathname | assertprefix (const Pathname &root_r, const Pathname &path_r) |
Return path_r prefixed with root_r , unless it is already prefixed. | |
static Pathname | stripprefix (const Pathname &root_r, const Pathname &path_r) |
Return path_r with any root_r dir prefix striped. | |
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_r) |
Private Attributes | |
std::string | _name |
Friends | |
void | swap (Pathname &lhs, Pathname &rhs) noexcept |
Swap. |
Related Symbols | |
(Note that these are not member symbols.) | |
bool | operator== (const Pathname &l, const Pathname &r) |
bool | operator!= (const Pathname &l, const Pathname &r) |
Pathname | operator/ (const Pathname &l, const Pathname &r) |
Concatenate two Pathname. | |
Pathname | operator+ (const Pathname &l, const Pathname &r) |
Concatenate two Pathname. | |
bool | operator< (const Pathname &l, const Pathname &r) |
std::ostream & | operator<< (std::ostream &str, const Pathname &obj) |
Stream output. |
Always stores normalized paths (no inner '.' or '..' components and no consecutive '/'es). Concatenation automatically adds the path separator '/'.
Definition at line 46 of file Pathname.h.
|
inline |
Default ctor: an empty path.
Definition at line 50 of file Pathname.h.
|
inline |
Ctor from string.
Definition at line 54 of file Pathname.h.
|
inline |
Ctor from char*.
Definition at line 58 of file Pathname.h.
|
inline |
Copy Ctor.
Definition at line 62 of file Pathname.h.
|
inlinenoexcept |
Move Ctor.
Definition at line 74 of file Pathname.h.
Assign.
Definition at line 79 of file Pathname.h.
|
inline |
String representation.
Definition at line 93 of file Pathname.h.
|
static |
String representation as "(root)/path".
Definition at line 190 of file Pathname.cc.
|
static |
String representation as "(root)/path", unless root is "/"
or empty.
Definition at line 195 of file Pathname.cc.
Url zypp::filesystem::Pathname::asUrl | ( | const std::string & | scheme_r | ) | const |
Url representation using scheme_r
schema .
Definition at line 172 of file Pathname.cc.
Url zypp::filesystem::Pathname::asUrl | ( | ) | const |
Definition at line 180 of file Pathname.cc.
Url zypp::filesystem::Pathname::asDirUrl | ( | ) | const |
Definition at line 183 of file Pathname.cc.
Url zypp::filesystem::Pathname::asFileUrl | ( | ) | const |
Definition at line 186 of file Pathname.cc.
|
inline |
String representation.
Definition at line 112 of file Pathname.h.
|
inline |
Test for an empty path.
Definition at line 116 of file Pathname.h.
|
inline |
Test for an absolute path.
Definition at line 118 of file Pathname.h.
|
inline |
Test for a relative path.
Definition at line 120 of file Pathname.h.
|
inline |
Test for "" or "/".
Definition at line 123 of file Pathname.h.
|
inline |
Return all but the last component od this path.
Definition at line 126 of file Pathname.h.
Definition at line 129 of file Pathname.cc.
|
inline |
Return the last component of this path.
Definition at line 130 of file Pathname.h.
|
static |
Definition at line 153 of file Pathname.cc.
|
inline |
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 137 of file Pathname.h.
|
static |
Definition at line 207 of file Pathname.cc.
|
inline |
Return this path, adding a leading '/' if relative.
Definition at line 141 of file Pathname.h.
Definition at line 142 of file Pathname.h.
|
inline |
Return this path, removing a leading '/' if absolute.
Definition at line 146 of file Pathname.h.
Definition at line 147 of file Pathname.h.
Pathname zypp::filesystem::Pathname::realpath | ( | ) | const |
Returns this path as the absolute canonical pathname.
Definition at line 231 of file Pathname.cc.
|
static |
Return path_r
prefixed with root_r
, unless it is already prefixed.
Definition at line 272 of file Pathname.cc.
|
static |
Return path_r
with any root_r
dir prefix striped.
Definition at line 281 of file Pathname.cc.
Concatenation of pathnames.
Definition at line 167 of file Pathname.h.
Definition at line 298 of file Pathname.cc.
|
inline |
Append string r to the last component of the path.
Definition at line 175 of file Pathname.h.
|
private |
Definition at line 33 of file Pathname.cc.
Swap.
Definition at line 67 of file Pathname.h.
Definition at line 185 of file Pathname.h.
Definition at line 189 of file Pathname.h.
Concatenate two Pathname.
Definition at line 193 of file Pathname.h.
Definition at line 203 of file Pathname.h.
|
Stream output.
Definition at line 209 of file Pathname.h.
|
private |
Definition at line 179 of file Pathname.h.