|
std::string | form (const char *format,...) __attribute__((format(printf |
| Printf style construction of std::string.
|
|
bool | regex_match (const std::string &s, smatch &matches, const regex ®ex) |
| \relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
|
|
bool | regex_match (const char *s, const regex ®ex) |
| \relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
|
|
bool | regex_match (const std::string &s, const regex ®ex) |
| \relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
|
|
std::string | regex_substitute (const std::string &s, const regex ®ex, const std::string &replacement, bool global=true) |
| Replaces the matched regex with the string passed in replacement.
|
|
std::string | strerror (int errno_r) |
| Return string describing the error_r code.
|
|
const std::string & | asString (const std::string &t) |
| Global asString() that works with std::string too.
|
|
std::string && | asString (std::string &&t) |
|
std::string | asString (const char *t) |
|
std::string | asString (char *t) |
|
template<class Tp > |
std::string | asString (const Tp &t) |
|
template<class Tp > |
std::string | asString (const intrusive_ptr< Tp > &p) |
|
template<class Tp > |
std::string | asString (const weak_ptr< Tp > &p) |
|
template<> |
std::string | asString (const bool &t) |
|
|
Optional second argument sets the minimal string width (0 padded).
Negative values will cause the number to be left adjusted within the string. Default width is 5 (4 for char).
octstring(42) -> "00052"
octstring(42, 4) -> "0052"
octstring(42,-4) -> "052 "
|
bool | strToTrue (const C_Str &str) |
| Parsing boolean from string.
|
|
bool | strToFalse (const C_Str &str) |
| Return false if str is 0, false, no, off, never .
|
|
TriBool | strToTriBool (const C_Str &str) |
| Parse str into a bool if it's a legal true or false string; else indeterminate .
|
|
std::string | gsub (const std::string &str_r, const std::string &from_r, const std::string &to_r) |
| Return a string with all occurrences of from_r replaced with to_r .
|
|
std::string & | replaceAll (std::string &str_r, const std::string &from_r, const std::string &to_r) |
| Replace all occurrences of from_r with to_r in str_r (inplace).
|
|
std::string | gsubFun (const std::string &str_r, const std::string &from_r, function< std::string()> to_r) |
|
std::string & | replaceAllFun (std::string &str_r, const std::string &from_r, function< std::string()> to_r) |
|
std::string | octstring (char n, int w=4) |
|
std::string | octstring (unsigned char n, int w=4) |
|
std::string | octstring (short n, int w=5) |
|
std::string | octstring (unsigned short n, int w=5) |
|
std::string | octstring (int n, int w=5) |
|
std::string | octstring (unsigned n, int w=5) |
|
std::string | octstring (long n, int w=5) |
|
std::string | octstring (unsigned long n, int w=5) |
|
std::string | octstring (long long n, int w=0) |
|
std::string | octstring (unsigned long long n, int w=0) |
|
template<typename TInt > |
std::string | binstring (TInt val_r) |
| String representation of number as bit-string with leading '0's.
|
|
template<typename TInt > |
TInt | strtonum (const C_Str &str) |
| Parsing numbers from string.
|
|
template<> |
short | strtonum (const C_Str &str) |
|
template<> |
int | strtonum (const C_Str &str) |
|
template<> |
long | strtonum (const C_Str &str) |
|
template<> |
long long | strtonum (const C_Str &str) |
|
template<> |
unsigned short | strtonum (const C_Str &str) |
|
template<> |
unsigned | strtonum (const C_Str &str) |
|
template<> |
unsigned long | strtonum (const C_Str &str) |
|
template<> |
unsigned long long | strtonum (const C_Str &str) |
|
template<typename TInt > |
TInt | strtonum (const C_Str &str, TInt &i) |
| String to integer type detemined 2nd function arg i.
|
|
bool | strToBool (const C_Str &str, bool default_r) |
| Parse str into a bool depending on the default value.
|
|
bool | strToBoolNodefault (const C_Str &str, bool &return_r) |
| Parse str into a bool if it's a legal true or false string.
|
|
std::string | gapify (std::string inp_r, std::string::size_type gap_r=1, char gapchar=' ') |
| Enhance readability: insert gaps at regular distance.
|
|
|
Encode all characters other than [a-zA-Z0-9] as XX.
- Todo:
- unsecape()
This includes the % character itself, which becomes %25.
|
std::string | hexencode (const C_Str &str_r) |
| Encode all characters other than [a-zA-Z0-9] as XX.
|
|
std::string | hexdecode (const C_Str &str_r) |
| Decode hexencoded XX sequences.
|
|
|
std::string | toLower (const std::string &s) |
| Return lowercase version of s.
|
|
std::string | toLower (std::string &&s) |
|
std::string | toUpper (const std::string &s) |
| Return uppercase version of s.
|
|
std::string | toUpper (std::string &&s) |
|
std::string | toLower (const char *s) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
std::string | toUpper (const char *s) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
|
std::string | stripFirstWord (std::string &line, const bool ltrim_first) |
|
std::string | stripLastWord (std::string &line, const bool rtrim_first) |
|
std::string | getline (std::istream &str, const Trim trim_r) |
| Return stream content up to (but not returning) the next newline.
|
|
std::string | getline (std::istream &str, bool trim=false) |
| Return stream content up to (but not returning) the next newline.
|
|
std::string | receiveUpTo (std::istream &str, const char delim_r, bool returnDelim_r=false) |
| Return stream content up to the next ocurrence of delim_r or EOF delim_r , if found, is always read from the stream.
|
|
bool | contains (const C_Str &str_r, const C_Str &val_r) |
| Locate substring case sensitive.
|
|
bool | containsCI (const C_Str &str_r, const C_Str &val_r) |
| Locate substring case insensitive.
|
|
|
std::string | escape (const C_Str &str_r, const char c=' ') |
| Escape desired character c using a backslash.
|
|
std::string | bEscape (std::string str_r, const C_Str &special_r) |
| Return str_r with '\'-escaped chars occurring in special_r (and '\').
|
|
std::string | rxEscapeStr (std::string str_r) |
| Escape plain STRING str_r for use in a regex (not anchored by "^" or "$").
|
|
std::string | rxEscapeGlob (std::string str_r) |
| Escape GLOB str_r for use in a regex (not anchored by "^" or "$").
|
|
void | appendEscaped (std::string &str_r, const C_Str &next_r, const char sep_r=' ') |
| Escape next_r and append it to str_r using separator sep_r.
|
|
|
Optional second argument sets the minimal string width (' ' padded).
Negative values will cause the number to be left adjusted within the string.
Default width is 0.
std::string numstring(char n, int w=0)
|
std::string | numstring (char n, int w=0) |
|
std::string | numstring (unsigned char n, int w=0) |
|
std::string | numstring (short n, int w=0) |
|
std::string | numstring (unsigned short n, int w=0) |
|
std::string | numstring (int n, int w=0) |
|
std::string | numstring (unsigned n, int w=0) |
|
std::string | numstring (long n, int w=0) |
|
std::string | numstring (unsigned long n, int w=0) |
|
std::string | numstring (long long n, int w=0) |
|
std::string | numstring (unsigned long long n, int w=0) |
|
template<> |
std::string | asString (const char &t) |
|
template<> |
std::string | asString (const unsigned char &t) |
|
template<> |
std::string | asString (const short &t) |
|
template<> |
std::string | asString (const unsigned short &t) |
|
template<> |
std::string | asString (const int &t) |
|
template<> |
std::string | asString (const unsigned &t) |
|
template<> |
std::string | asString (const long &t) |
|
template<> |
std::string | asString (const unsigned long &t) |
|
template<> |
std::string | asString (const long long &t) |
|
template<> |
std::string | asString (const unsigned long long &t) |
|
|
Optional second argument sets the minimal string width (0 padded).
Negative values will cause the number to be left adjusted within the string. Default width is 10 (4 for char).
hexstring(42) -> "0x0000002a"
hexstring(42, 4) -> "0x2a"
hexstring(42,-4) -> "0x2a"
|
std::string | hexstring (char n, int w=4) |
|
std::string | hexstring (unsigned char n, int w=4) |
|
std::string | hexstring (short n, int w=10) |
|
std::string | hexstring (unsigned short n, int w=10) |
|
std::string | hexstring (int n, int w=10) |
|
std::string | hexstring (unsigned n, int w=10) |
|
std::string | hexstring (long n, int w=10) |
|
std::string | hexstring (unsigned long n, int w=10) |
|
std::string | hexstring (long long n, int w=0) |
|
std::string | hexstring (unsigned long long n, int w=0) |
|
|
template<class TOutputIterator > |
unsigned | split (const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM) |
| Split line_r into words.
|
|
template<class TOutputIterator > |
unsigned | split (const C_Str &line_r, TOutputIterator result_r, const Trim trim_r) |
|
template<class TOutputIterator > |
unsigned | splitEscaped (const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", bool withEmpty=false) |
| Split line_r into words with respect to escape delimeters.
|
|
template<class TOutputIterator > |
unsigned | splitFields (const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=":") |
| Split line_r into fields.
|
|
template<class TOutputIterator > |
unsigned | splitFieldsEscaped (const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=":") |
| Split line_r into fields handling also escaped separators.
|
|
|
template<class TIterator > |
std::string | join (TIterator begin, TIterator end, const C_Str &sep_r=" ") |
| Join strings using separator sep_r (defaults to BLANK).
|
|
template<class TContainer > |
std::string | join (const TContainer &cont_r, const C_Str &sep_r=" ") |
| Join strings using separator sep_r (defaults to BLANK).
|
|
template<class TIterator > |
std::string | joinEscaped (TIterator begin, TIterator end, const char sep_r=' ') |
| Join strings using separator sep_r, quoting or escaping the values.
|
|
|
std::ostream & | printIndented (std::ostream &str, const std::string &text_r, const std::string &indent_r=" ", unsigned maxWitdh_r=0) |
| Indent by string [" "] optionally wrap.
|
|
std::ostream & | printIndented (std::ostream &str, const std::string &text_r, unsigned indent_r, char indentch_r=' ', unsigned maxWitdh_r=0) |
|
std::ostream & | printIndented (std::ostream &str, const std::string &text_r, unsigned indent_r, unsigned maxWitdh_r, char indentch_r=' ') |
|
std::ostream & | autoPrefix (std::ostream &str, const std::string &text_r, function< std::string(const char *, const char *)> fnc_r) |
| Prefix lines by string computed by function taking line begin/end [std::string(const char*, const char*)] Prints nothing for an empty string.
|
|
std::ostream & | autoPrefix0 (std::ostream &str, const std::string &text_r, function< std::string()> fnc_r) |
|
|
int | compareCI (const C_Str &lhs, const C_Str &rhs) |
|
|
bool | hasPrefix (const C_Str &str_r, const C_Str &prefix_r) |
| Return whether str_r has prefix prefix_r.
|
|
bool | hasPrefixCI (const C_Str &str_r, const C_Str &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.
|
|
std::string | stripPrefixCI (const C_Str &str_r, const C_Str &prefix_r) |
|
bool | hasSuffix (const C_Str &str_r, const C_Str &suffix_r) |
| Return whether str_r has suffix suffix_r.
|
|
bool | hasSuffixCI (const C_Str &str_r, const C_Str &suffix_r) |
|
std::string | stripSuffix (const C_Str &str_r, const C_Str &suffix_r) |
| Strip a suffix_r from str_r and return the resulting string.
|
|
std::string | stripSuffixCI (const C_Str &str_r, const C_Str &suffix_r) |
|
std::string::size_type | commonPrefix (const C_Str &lhs, const C_Str &rhs) |
| Return size of the common prefix of lhs and rhs.
|
|
std::string::size_type | commonPrefixCI (const C_Str &lhs, const C_Str &rhs) |
|
bool | startsWith (const C_Str &str_r, const C_Str &prefix_r) |
| alias for hasPrefix
|
|
bool | startsWithCI (const C_Str &str_r, const C_Str &prefix_r) |
|
bool | endsWith (const C_Str &str_r, const C_Str &prefix_r) |
| alias for hasSuffix
|
|
bool | endsWithCI (const C_Str &str_r, const C_Str &prefix_r) |
|