Classes | |
| struct | SafeBuf |
Assert free called for allocated char *. More... | |
Trimming whitepace. | |
| |
| enum | Trim { NO_TRIM = 0x00, L_TRIM = 0x01, R_TRIM = 0x02, TRIM = (L_TRIM|R_TRIM) } |
| To define how to trim. More... | |
| std::string | trim (const std::string &s, const Trim trim_r) |
| std::string | ltrim (const std::string &s) |
| std::string | rtrim (const std::string &s) |
| bool | strToTrue (const std::string &str) |
Return true if str is 1, true, yes, on. | |
| bool | strToFalse (const std::string &str) |
Return false if str is 0, false, no, off. | |
| bool | strToBool (const std::string &str, bool default_r) |
Parse str into a bool depending on the default value. | |
Hexencode. | |
| Encode all characters other than [a-zA-Z0-9] as XX. This includes the % character itself, which becomes 25. | |
| std::string | hexencode (const std::string &str_r) |
| Encode all characters other than [a-zA-Z0-9] as XX. | |
| std::string | hexdecode (const std::string &str_r) |
| Decode hexencoded XX sequences. | |
Case conversion. | |
| std::string | toLower (const std::string &s) |
| Return lowercase version of s. | |
| std::string | toUpper (const std::string &s) |
| Return uppercase version of s. | |
String representation of number. | |
| 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 (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) |
String representation of number as hex value with leading '0x'. | |
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) |
String representation of number as octal value with leading '0'. | |
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 " | |
| 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 _It> | |
| _It | strtonum (const std::string &str) |
| String to integer type determined by template arg. | |
| template<typename _It> | |
| _It | strtonum (const std::string &str, _It &i) |
| String to integer type detemined 2nd function arg i. | |
Split. | |
| template<class _OutputIterator> | |
| unsigned | split (const std::string &line_r, _OutputIterator result_r, const std::string &sepchars_r=" \t") |
| Split line_r into words. | |
| template<class _OutputIterator> | |
| unsigned | splitFields (const std::string &line_r, _OutputIterator result_r, const std::string &sepchars_r=":") |
| Split line_r into fields. | |
Join. | |
| template<class _Iterator> | |
| std::string | join (_Iterator begin, _Iterator end, const std::string &sep_r=" ") |
| Join strings using separator sep_r (defaults to BLANK). | |
| template<class _Container> | |
| std::string | join (const _Container &cont_r, const std::string &sep_r=" ") |
| Join strings using separator sep_r (defaults to BLANK). | |
String prefix handling. | |
| bool | hasPrefix (const std::string &str_r, const std::string &prefix_r) |
| Return whether str_r has prefix prefix_r. | |
| std::string | stripPrefix (const std::string &str_r, const std::string &prefix_r) |
| Strip a prefix_r from str_r and return the resulting string. | |
Functions | |
| std::string | form (const char *format,...) __attribute__((format(printf |
| Printf style construction of std::string. | |
| std::string | strerror (int errno_r) |
| Return string describing the error_r code. | |
| bool | heIsAlNum (char ch) |
| What's not decoded. | |
| int | heDecodeCh (char ch) |
| Hex-digit to number or -1. | |
| std::string | stripFirstWord (std::string &line, const bool ltrim_first) |
| static std::string | _getline (std::istream &str, const Trim trim_r) |
| std::string | getline (std::istream &str, const Trim trim_r) |
| std::string | getline (std::istream &str, bool trim) |
| std::string & | replace_all (std::string &str, const std::string &from, const std::string &to) |
| Looks for text in string and replaces it in place. | |
|
|
To define how to trim.
|
|
||||||||||||
|
|
Return string describing the error_r code. Like strerror, but the numerical value is included in the string as well. Definition at line 48 of file String.cc. References form(). Referenced by zypp::media::MediaCD::closeTray(), zypp::media::MediaCD::openTray(), zypp::ExternalProgram::running(), zypp::externalprogram::ExternalDataSource::setBlocking(), and zypp::Exception::strErrno(). |
|
|
Return
Definition at line 58 of file String.cc. References toLower(). Referenced by strToBool(). |
|
|
Return
Definition at line 73 of file String.cc. References toLower(). Referenced by strToBool(). |
|
|
What's not decoded.
Definition at line 88 of file String.cc. Referenced by hexencode(). |
|
|
Hex-digit to number or -1.
Definition at line 95 of file String.cc. Referenced by hexdecode(). |
|
|
Encode all characters other than [a-zA-Z0-9] as XX. This includes the % character itself, which becomes 25. Definition at line 107 of file String.cc. References heIsAlNum(). |
|
|
Decode hexencoded XX sequences.
Definition at line 128 of file String.cc. References heDecodeCh(). Referenced by zypp::capability::ModaliasCap::evaluate(). |
|
|
Return lowercase version of s.
Definition at line 160 of file String.cc. Referenced by zypp::addTrustedVendor(), zypp::CheckSum::CheckSum(), zypp::url::UrlBase::cleanupPathName(), zypp::solver::detail::HelixControl::deleteResolvable(), zypp::solver::detail::helixXML(), zypp::solver::detail::HelixControl::installResolvable(), zypp::url::UrlBase::isKnownScheme(), zypp::url::UrlBase::isValidScheme(), zypp::KindOf< _Tp >::operator==(), zypp::url::UrlBase::setScheme(), strToFalse(), strToTrue(), and zypp::trusted(). |
|
|
Return uppercase version of s.
Definition at line 179 of file String.cc. Referenced by zypp::target::rpm::RpmDb::exportTrustedKeysInZyppKeyRing(), and zypp::target::rpm::RpmDb::importPubkey(). |
|
||||||||||||
|
Definition at line 198 of file String.cc. References L_TRIM, NO_TRIM, and R_TRIM. Referenced by _getline(), zypp::addTrustedVendor(), ltrim(), zypp::parser::IniParser::parse(), and rtrim(). |
|
||||||||||||
|
Definition at line 232 of file String.cc. References ltrim(). |
|
||||||||||||
|
Definition at line 268 of file String.cc. References trim(). Referenced by getline(). |
|
||||||||||||
|
Definition at line 283 of file String.cc. References _getline(). Referenced by zypp::SourceFactory::scanProductsFile(). |
|
||||||||||||
|
Definition at line 288 of file String.cc. References _getline(), NO_TRIM, and TRIM. |
|
||||||||||||
|
||||||||||||
|
Definition at line 108 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 109 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 110 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 111 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 112 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 113 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 114 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 115 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 116 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 131 of file String.h. References form(). Referenced by zypp::PublicKey::Impl::asString(), zypp::SourceCache::removeSource(), and zypp::SourceCache::storeSource(). |
|
||||||||||||
|
Definition at line 132 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 133 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 134 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 135 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 136 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 137 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 138 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 139 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 140 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 155 of file String.h. References form(). Referenced by zypp::filesystem::chmod(), and zypp::filesystem::mkdir(). |
|
||||||||||||
|
Definition at line 156 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 157 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 158 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 159 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 160 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 161 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 162 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 163 of file String.h. References form(). |
|
||||||||||||
|
Definition at line 164 of file String.h. References form(). |
|
||||||||||
|
String to integer type determined by template arg.
Definition at line 181 of file String.h. Referenced by zypp::Date::Date(), and zypp::source::susetags::MediaMetadataParser::parse(). |
|
||||||||||||||||
|
String to integer type detemined 2nd function arg i.
time_t t; strtonum( "42", t ); |
|
||||||||||||
|
Parse
If the Definition at line 222 of file String.h. References strToFalse(), and strToTrue(). Referenced by zypp::ZConfig::Impl::Impl(). |
|
||||||||||||||||
|
Looks for text in string and replaces it in place.
|
|
||||||||||||||||||||
|
Split line_r into words. Any sequence of characters in sepchars_r is treated as delimiter. The words are passed to OutputIterator result_r. std::vector<std::string> words; str::split( "some line", std::back_inserter(words) ) Definition at line 256 of file String.h. Referenced by zypp::source::susetags::SelectionTagFileParser::consume(), zypp::source::susetags::PatternTagFileParser::consume(), zypp::source::susetags::PackagesParser::consume(), zypp::source::susetags::PackageDiskUsageParser::consume(), zypp::source::susetags::PackagesLangParser::consume(), zypp::DiskUsageCounter::detectMountPoints(), log_curl(), zypp::source::susetags::ProductMetadataParser::parse(), zypp::source::susetags::ProductMetadataParser::parseFileCheckSum(), zypp::media::ProxyInfoSysconfig::ProxyInfoSysconfig(), and zypp::kvmap::KVMapBase::split(). |
|
||||||||||||||||||||
|
Split line_r into fields. Any single character in sepchars_r is treated as a field separator. The words are passed to OutputIterator result_r. "" -> words 0 ":" -> words 2 ||| "a" -> words 1 |a| ":a" -> words 2 ||a| "a:" -> words 2 |a|| ":a:" -> words 3 ||a||
std::vector<std::string> words; str::split( "some line", std::back_inserter(words) ) Definition at line 301 of file String.h. Referenced by zypp::PublicKey::Impl::readFromFile(). |
|
||||||||||||||||||||
|
Join strings using separator sep_r (defaults to BLANK).
Definition at line 337 of file String.h. Referenced by zypp::KVMap< KVMapOpts >::asString(), zypp::Arch::asString(), join(), zypp::parser::yum::operator<<(), and zypp::TranslatedText::Impl::setText(). |
|
||||||||||||||||
|
Join strings using separator sep_r (defaults to BLANK).
Definition at line 352 of file String.h. References join(). |
|
|
Definition at line 401 of file String.h. References L_TRIM, and trim(). Referenced by zypp::parser::IniParser::parse(), and stripFirstWord(). |
|
|
Definition at line 404 of file String.h. References R_TRIM, and trim(). Referenced by zypp::parser::IniParser::parse(). |
|
||||||||||||
|
Return whether str_r has prefix prefix_r.
Definition at line 420 of file String.h. Referenced by stripPrefix(). |
|
||||||||||||
|
Strip a prefix_r from str_r and return the resulting string.
Definition at line 424 of file String.h. References hasPrefix(). |
1.4.6