libept
|
Classes | |
struct | Split |
Split a string where a given substring is found. More... | |
Functions | |
std::string | basename (const std::string &pathname) |
Given a pathname, return the file name without its path. More... | |
std::string | dirname (const std::string &pathname) |
Given a pathname, return the directory name without the file name. More... | |
void | appendpath (std::string &dest, const char *path2) |
Append path2 to path1, adding slashes when appropriate. More... | |
void | appendpath (std::string &dest, const std::string &path2) |
Append path2 to path1, adding slashes when appropriate. More... | |
std::string | joinpath (const std::string &path1, const std::string &path2) |
std::string | normpath (const std::string &pathname) |
Normalise a pathname. More... | |
std::string | encode_cstring (const std::string &str) |
Escape the string so it can safely used as a C string inside double quotes. More... | |
std::string | decode_cstring (const std::string &str, size_t &lenParsed) |
Unescape a C string, stopping at the first double quotes or at the end of the string. More... | |
std::string | encode_url (const std::string &str) |
Urlencode a string. More... | |
std::string | decode_url (const std::string &str) |
Decode an urlencoded string. More... | |
std::string | encode_base64 (const std::string &str) |
Encode a string in Base64. More... | |
std::string | decode_base64 (const std::string &str) |
Decode a string encoded in Base64. More... | |
bool | startswith (const std::string &str, const std::string &part) |
Check if a string starts with the given substring. More... | |
bool | endswith (const std::string &str, const std::string &part) |
Check if a string ends with the given substring. More... | |
template<typename ITER > | |
std::string | join (const std::string &sep, const ITER &begin, const ITER &end) |
Stringify and join a sequence of objects. More... | |
template<typename ITEMS > | |
std::string | join (const std::string &sep, const ITEMS &items) |
Stringify and join an iterable container. More... | |
template<typename FUN > | |
std::string | lstrip (const std::string &str, const FUN &classifier) |
Return the substring of 'str' without all leading characters for which 'classifier' returns true. More... | |
std::string | lstrip (const std::string &str) |
Return the substring of 'str' without all leading spaces. More... | |
template<typename FUN > | |
std::string | rstrip (const std::string &str, const FUN &classifier) |
Return the substring of 'str' without all trailing characters for which 'classifier' returns true. More... | |
std::string | rstrip (const std::string &str) |
Return the substring of 'str' without all trailing spaces. More... | |
template<typename FUN > | |
std::string | strip (const std::string &str, const FUN &classifier) |
Return the substring of 'str' without all leading and trailing characters for which 'classifier' returns true. More... | |
std::string | strip (const std::string &str) |
Return the substring of 'str' without all leading and trailing spaces. More... | |
std::string | upper (const std::string &str) |
Return an uppercased copy of str. More... | |
std::string | lower (const std::string &str) |
Return a lowercased copy of str. More... | |
template<typename S1 , typename S2 , typename... Args> | |
void | appendpath (std::string &dest, S1 first, S2 second, Args... next) |
Append an arbitrary number of path components to dest. More... | |
template<typename... Args> | |
std::string | joinpath (Args... components) |
Join two or more paths, adding slashes when appropriate. More... | |
void ept::str::appendpath | ( | std::string & | dest, |
const char * | path2 | ||
) |
Append path2 to path1, adding slashes when appropriate.
Referenced by appendpath(), joinpath(), and lower().
void ept::str::appendpath | ( | std::string & | dest, |
const std::string & | path2 | ||
) |
Append path2 to path1, adding slashes when appropriate.
Referenced by joinpath(), and normpath().
void ept::str::appendpath | ( | std::string & | dest, |
S1 | first, | ||
S2 | second, | ||
Args... | next | ||
) |
Append an arbitrary number of path components to dest.
References appendpath().
std::string ept::str::basename | ( | const std::string & | pathname | ) |
Given a pathname, return the file name without its path.
Referenced by lower().
std::string ept::str::decode_base64 | ( | const std::string & | str | ) |
std::string ept::str::decode_cstring | ( | const std::string & | str, |
size_t & | lenParsed | ||
) |
Unescape a C string, stopping at the first double quotes or at the end of the string.
lenParsed is set to the number of characters that were pased (which can be greather than the size of the resulting string in case escapes were found)
References res.
Referenced by ept::str::Split::end().
std::string ept::str::decode_url | ( | const std::string & | str | ) |
std::string ept::str::dirname | ( | const std::string & | pathname | ) |
Given a pathname, return the directory name without the file name.
Referenced by lower(), and ept::sys::makedirs().
std::string ept::str::encode_base64 | ( | const std::string & | str | ) |
std::string ept::str::encode_cstring | ( | const std::string & | str | ) |
Escape the string so it can safely used as a C string inside double quotes.
References res.
Referenced by ept::str::Split::end(), and ept::tests::ActualCString::operator==().
std::string ept::str::encode_url | ( | const std::string & | str | ) |
|
inline |
Check if a string ends with the given substring.
Referenced by ept::tests::ActualStdString::ActualStdString(), ept::tests::assert_endswith(), and ept::tests::ActualCString::isfalse().
std::string ept::str::join | ( | const std::string & | sep, |
const ITER & | begin, | ||
const ITER & | end | ||
) |
Stringify and join a sequence of objects.
References res.
std::string ept::str::join | ( | const std::string & | sep, |
const ITEMS & | items | ||
) |
Stringify and join an iterable container.
References res.
std::string ept::str::joinpath | ( | const std::string & | path1, |
const std::string & | path2 | ||
) |
References appendpath(), and res.
Referenced by ept::sys::abspath(), ept::axi::path_db(), ept::axi::timestamp(), and ept::sys::which().
std::string ept::str::joinpath | ( | Args... | components | ) |
Join two or more paths, adding slashes when appropriate.
References appendpath(), normpath(), and res.
|
inline |
Return a lowercased copy of str.
References appendpath(), basename(), dirname(), and res.
|
inline |
Return the substring of 'str' without all leading characters for which 'classifier' returns true.
Referenced by lstrip().
|
inline |
Return the substring of 'str' without all leading spaces.
References lstrip().
std::string ept::str::normpath | ( | const std::string & | pathname | ) |
Normalise a pathname.
For example, A//B, A/./B and A/foo/../B all become A/B.
References appendpath(), and res.
Referenced by ept::sys::abspath(), and joinpath().
|
inline |
Return the substring of 'str' without all trailing characters for which 'classifier' returns true.
Referenced by rstrip().
|
inline |
Return the substring of 'str' without all trailing spaces.
References rstrip().
|
inline |
Check if a string starts with the given substring.
Referenced by ept::tests::ActualStdString::ActualStdString(), ept::tests::assert_startswith(), and ept::tests::ActualCString::isfalse().
|
inline |
Return the substring of 'str' without all leading and trailing characters for which 'classifier' returns true.
Referenced by strip().
|
inline |
Return the substring of 'str' without all leading and trailing spaces.
References strip().
|
inline |
Return an uppercased copy of str.
References res.