65 else if (
_name.size() == 1 )
69 std::string::size_type pos =
_name.rfind(
'/' );
70 if ( pos ==
_name.size() - 3 &&
_name[pos+1] ==
'.' &&
_name[pos+2] ==
'.' )
135 std::string::size_type
idx =
ret_t._name.find_last_of(
'/' );
137 if (
idx == std::string::npos ) {
139 }
else if (
idx == 0 ) {
159 std::string::size_type
idx =
ret_t.find_last_of(
'/' );
160 if (
idx != std::string::npos && (
idx != 0 ||
ret_t.size() != 1 ) ) {
181 {
return asUrl(
"dir" ); }
184 {
return asUrl(
"dir" ); }
187 {
return asUrl(
"file" ); }
213 std::string::size_type pos = base.rfind(
'.' );
217 if ( base.size() == 1 )
221 if ( base.size() == 2 && base[0] ==
'.' )
224 case std::string::npos:
228 return base.substr( pos );
283 if (
root_r.emptyOrRoot() )
288 if (
rest[0] ==
'/' )
306 if(
add_tv._name[0] !=
'/' )
318 return l.asString() +
r;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
static std::string showRoot(const Pathname &root_r, const Pathname &path_r)
String representation as "(root)/path".
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
static Pathname stripprefix(const Pathname &root_r, const Pathname &path_r)
Return path_r with any root_r dir prefix striped.
Pathname dirname() const
Return all but the last component od this path.
Pathname cat(const Pathname &r) const
Concatenation of pathnames.
Pathname()
Default ctor: an empty path.
const std::string & asString() const
String representation.
std::string basename() const
Return the last component of this path.
bool empty() const
Test for an empty path.
static Pathname assertprefix(const Pathname &root_r, const Pathname &path_r)
Return path_r prefixed with root_r, unless it is already prefixed.
void _assign(const std::string &name_r)
Pathname realpath() const
Returns this path as the absolute canonical pathname.
static std::string showRootIf(const Pathname &root_r, const Pathname &path_r)
String representation as "(root)/path", unless root is "/" or empty.
std::string extension() const
Return all of the characters in name after and including the last dot in the last element of name.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::string stripPrefix(const C_Str &str_r, const C_Str &prefix_r)
Strip a prefix_r from str_r and return the resulting string.
Easy-to use interface to the ZYPP dependency resolver.
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...