String related utilities and Regular expression matching.
More...
|
class | Format |
| Convenient building of std::string with boost::format. Basically a boost::format autoconvertible to std::string for building string arguments. More...
|
|
class | regex |
| Regular expression. More...
|
|
struct | SafeBuf |
| Assert free called for allocated char * . More...
|
|
class | smatch |
| Regular expression match result. More...
|
|
class | Str |
| Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconvertible to std::string for building string arguments. More...
|
|
|
- Todo:
- optimize l/r trim.
|
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 | trim (std::string &&s, const Trim trim_r) |
|
std::string | ltrim (const std::string &s) |
|
std::string | ltrim (std::string &&s) |
|
std::string | rtrim (const std::string &s) |
|
std::string | rtrim (std::string &&s) |
|
◆ regex_error
◆ Trim
To define how to trim.
Enumerator |
---|
NO_TRIM | |
L_TRIM | |
R_TRIM | |
TRIM | |
Definition at line 493 of file String.h.
◆ form()
std::string zypp::str::form |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Printf style construction of std::string.
Definition at line 36 of file String.cc.
◆ regex_match() [1/3]
bool zypp::str::regex_match |
( |
const std::string & |
s, |
|
|
smatch & |
matches, |
|
|
const regex & |
regex |
|
) |
| |
|
inline |
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Definition at line 70 of file Regex.h.
◆ regex_match() [2/3]
bool zypp::str::regex_match |
( |
const char * |
s, |
|
|
const regex & |
regex |
|
) |
| |
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Definition at line 82 of file Regex.cc.
◆ regex_match() [3/3]
bool zypp::str::regex_match |
( |
const std::string & |
s, |
|
|
const regex & |
regex |
|
) |
| |
|
inline |
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Definition at line 77 of file Regex.h.
◆ regex_substitute()
std::string zypp::str::regex_substitute |
( |
const std::string & |
s, |
|
|
const regex & |
regex, |
|
|
const std::string & |
replacement, |
|
|
bool |
global = true |
|
) |
| |
Replaces the matched regex with the string passed in replacement.
If global is set the search continues after the first match
- Note
- Using backreferences in the replacement string is NOT supported.
Definition at line 121 of file Regex.cc.
◆ strerror()
std::string std::string zypp::str::strerror |
( |
int |
errno_r | ) |
|
Return string describing the error_r code.
Like strerror, but the numerical value is included in the string as well.
Definition at line 53 of file String.cc.
◆ strToTrue()
bool zypp::str::strToTrue |
( |
const C_Str & |
str | ) |
|
Parsing boolean from string.
Return true
if str is 1, true, yes, on, always
(or a nonzero number).
Definition at line 63 of file String.cc.
◆ strToFalse()
bool zypp::str::strToFalse |
( |
const C_Str & |
str | ) |
|
Return false
if str is 0, false, no, off, never
.
Definition at line 81 of file String.cc.
◆ strToTriBool()
Parse str
into a bool if it's a legal true
or false
string; else indterminate
.
Definition at line 93 of file String.cc.
◆ hexencode()
std::string zypp::str::hexencode |
( |
const C_Str & |
str_r | ) |
|
Encode all characters other than [a-zA-Z0-9] as XX.
This includes the % character itself, which becomes %25.
Definition at line 124 of file String.cc.
◆ hexdecode()
std::string zypp::str::hexdecode |
( |
const C_Str & |
str_r | ) |
|
Decode hexencoded XX sequences.
Definition at line 145 of file String.cc.
◆ toLower() [1/3]
std::string zypp::str::toLower |
( |
const std::string & |
s | ) |
|
Return lowercase version of s.
- Todo:
- improve
Definition at line 177 of file String.cc.
◆ toLower() [2/3]
std::string zypp::str::toLower |
( |
std::string && |
s | ) |
|
◆ toUpper() [1/3]
std::string zypp::str::toUpper |
( |
const std::string & |
s | ) |
|
Return uppercase version of s.
- Todo:
- improve
Definition at line 200 of file String.cc.
◆ toUpper() [2/3]
std::string zypp::str::toUpper |
( |
std::string && |
s | ) |
|
◆ trim() [1/2]
std::string zypp::str::trim |
( |
const std::string & |
s, |
|
|
const Trim |
trim_r |
|
) |
| |
◆ trim() [2/2]
std::string zypp::str::trim |
( |
std::string && |
s, |
|
|
const Trim |
trim_r |
|
) |
| |
◆ stripFirstWord()
std::string zypp::str::stripFirstWord |
( |
std::string & |
line, |
|
|
const bool |
ltrim_first |
|
) |
| |
◆ stripLastWord()
std::string zypp::str::stripLastWord |
( |
std::string & |
line, |
|
|
const bool |
rtrim_first |
|
) |
| |
◆ gsub()
std::string zypp::str::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
.
Definition at line 324 of file String.cc.
◆ replaceAll()
std::string & zypp::str::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).
A reference to str_r
is also returned for convenience.
Definition at line 330 of file String.cc.
◆ gsubFun()
std::string zypp::str::gsubFun |
( |
const std::string & |
str_r, |
|
|
const std::string & |
from_r, |
|
|
function< std::string()> |
to_r |
|
) |
| |
◆ replaceAllFun()
std::string & zypp::str::replaceAllFun |
( |
std::string & |
str_r, |
|
|
const std::string & |
from_r, |
|
|
function< std::string()> |
to_r |
|
) |
| |
◆ escape()
std::string zypp::str::escape |
( |
const C_Str & |
str_r, |
|
|
const char |
c = ' ' |
|
) |
| |
Escape desired character c using a backslash.
For use when printing c separated values, and where joinEscaped() is too heavy.
Definition at line 371 of file String.cc.
◆ bEscape()
std::string zypp::str::bEscape |
( |
std::string |
str_r, |
|
|
const C_Str & |
special_r |
|
) |
| |
Return str_r with '\'-escaped chars occurring in special_r (and '\').
Definition at line 394 of file String.cc.
◆ rxEscapeStr()
std::string zypp::str::rxEscapeStr |
( |
std::string |
str_r | ) |
|
Escape plain STRING str_r for use in a regex (not anchored by "^" or "$").
Definition at line 415 of file String.cc.
◆ rxEscapeGlob()
std::string zypp::str::rxEscapeGlob |
( |
std::string |
str_r | ) |
|
Escape GLOB str_r for use in a regex (not anchored by "^" or "$").
Definition at line 420 of file String.cc.
◆ getline() [1/2]
std::string zypp::str::getline |
( |
std::istream & |
str, |
|
|
const Trim |
trim_r |
|
) |
| |
Return stream content up to (but not returning) the next newline.
- See also
- receiveUpTo
Definition at line 478 of file String.cc.
◆ getline() [2/2]
std::string zypp::str::getline |
( |
std::istream & |
str, |
|
|
bool |
trim = false |
|
) |
| |
Return stream content up to (but not returning) the next newline.
- See also
- receiveUpTo
Definition at line 483 of file String.cc.
◆ receiveUpTo()
std::string zypp::str::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.
Whether it is also returned in the string depends on returnDelim_r
. If the stream status is good
, delim_r
was found in the stream. If we reached EOF while looking for delim_r
, eof
is set; and also fail
, if we did not read any data before.
Definition at line 488 of file String.cc.
◆ asString() [1/18]
const std::string& zypp::str::asString |
( |
const std::string & |
t | ) |
|
|
inline |
◆ asString() [2/18]
std::string&& zypp::str::asString |
( |
std::string && |
t | ) |
|
|
inline |
◆ asString() [3/18]
std::string zypp::str::asString |
( |
const char * |
t | ) |
|
|
inline |
◆ asString() [4/18]
std::string zypp::str::asString |
( |
char * |
t | ) |
|
|
inline |
◆ asString() [5/18]
template<class Tp >
std::string zypp::str::asString |
( |
const Tp & |
t | ) |
|
|
inline |
◆ asString() [6/18]
◆ asString() [7/18]
template<class Tp >
std::string zypp::str::asString |
( |
const weak_ptr< Tp > & |
p | ) |
|
|
inline |
◆ asString() [8/18]
template<>
std::string zypp::str::asString |
( |
const bool & |
t | ) |
|
|
inline |
◆ numstring() [1/10]
std::string zypp::str::numstring |
( |
char |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [2/10]
std::string zypp::str::numstring |
( |
unsigned char |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [3/10]
std::string zypp::str::numstring |
( |
short |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [4/10]
std::string zypp::str::numstring |
( |
unsigned short |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [5/10]
std::string zypp::str::numstring |
( |
int |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [6/10]
std::string zypp::str::numstring |
( |
unsigned |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [7/10]
std::string zypp::str::numstring |
( |
long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [8/10]
std::string zypp::str::numstring |
( |
unsigned long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [9/10]
std::string zypp::str::numstring |
( |
long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ numstring() [10/10]
std::string zypp::str::numstring |
( |
unsigned long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ asString() [9/18]
template<>
std::string zypp::str::asString |
( |
const char & |
t | ) |
|
|
inline |
◆ asString() [10/18]
template<>
std::string zypp::str::asString |
( |
const unsigned char & |
t | ) |
|
|
inline |
◆ asString() [11/18]
template<>
std::string zypp::str::asString |
( |
const short & |
t | ) |
|
|
inline |
◆ asString() [12/18]
template<>
std::string zypp::str::asString |
( |
const unsigned short & |
t | ) |
|
|
inline |
◆ asString() [13/18]
template<>
std::string zypp::str::asString |
( |
const int & |
t | ) |
|
|
inline |
◆ asString() [14/18]
template<>
std::string zypp::str::asString |
( |
const unsigned & |
t | ) |
|
|
inline |
◆ asString() [15/18]
template<>
std::string zypp::str::asString |
( |
const long & |
t | ) |
|
|
inline |
◆ asString() [16/18]
template<>
std::string zypp::str::asString |
( |
const unsigned long & |
t | ) |
|
|
inline |
◆ asString() [17/18]
template<>
std::string zypp::str::asString |
( |
const long long & |
t | ) |
|
|
inline |
◆ asString() [18/18]
template<>
std::string zypp::str::asString |
( |
const unsigned long long & |
t | ) |
|
|
inline |
◆ hexstring() [1/10]
std::string zypp::str::hexstring |
( |
char |
n, |
|
|
int |
w = 4 |
|
) |
| |
|
inline |
◆ hexstring() [2/10]
std::string zypp::str::hexstring |
( |
unsigned char |
n, |
|
|
int |
w = 4 |
|
) |
| |
|
inline |
◆ hexstring() [3/10]
std::string zypp::str::hexstring |
( |
short |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [4/10]
std::string zypp::str::hexstring |
( |
unsigned short |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [5/10]
std::string zypp::str::hexstring |
( |
int |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [6/10]
std::string zypp::str::hexstring |
( |
unsigned |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [7/10]
std::string zypp::str::hexstring |
( |
long |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [8/10]
std::string zypp::str::hexstring |
( |
unsigned long |
n, |
|
|
int |
w = 10 |
|
) |
| |
|
inline |
◆ hexstring() [9/10]
std::string zypp::str::hexstring |
( |
long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ hexstring() [10/10]
std::string zypp::str::hexstring |
( |
unsigned long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ octstring() [1/10]
std::string zypp::str::octstring |
( |
char |
n, |
|
|
int |
w = 4 |
|
) |
| |
|
inline |
◆ octstring() [2/10]
std::string zypp::str::octstring |
( |
unsigned char |
n, |
|
|
int |
w = 4 |
|
) |
| |
|
inline |
◆ octstring() [3/10]
std::string zypp::str::octstring |
( |
short |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [4/10]
std::string zypp::str::octstring |
( |
unsigned short |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [5/10]
std::string zypp::str::octstring |
( |
int |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [6/10]
std::string zypp::str::octstring |
( |
unsigned |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [7/10]
std::string zypp::str::octstring |
( |
long |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [8/10]
std::string zypp::str::octstring |
( |
unsigned long |
n, |
|
|
int |
w = 5 |
|
) |
| |
|
inline |
◆ octstring() [9/10]
std::string zypp::str::octstring |
( |
long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ octstring() [10/10]
std::string zypp::str::octstring |
( |
unsigned long long |
n, |
|
|
int |
w = 0 |
|
) |
| |
|
inline |
◆ binstring()
template<typename TInt >
std::string zypp::str::binstring |
( |
TInt |
val_r | ) |
|
String representation of number as bit-string with leading '0's.
Definition at line 361 of file String.h.
◆ strtonum() [1/3]
template<typename TInt >
TInt zypp::str::strtonum |
( |
const C_Str & |
str | ) |
|
|
inline |
Parsing numbers from string.
String to integer type determined by template arg.
- Note
- Only specializations are defined.
time_t t = strtonum<time_t>( "42" );
Definition at line 385 of file String.h.
◆ strtonum() [2/3]
template<>
unsigned long long zypp::str::strtonum |
( |
const C_Str & |
str | ) |
|
|
inline |
Parsing numbers from string.
String to integer type determined by template arg.
- Note
- Only specializations are defined.
time_t t = strtonum<time_t>( "42" );
Definition at line 385 of file String.h.
◆ strtonum() [3/3]
template<typename TInt >
TInt zypp::str::strtonum |
( |
const C_Str & |
str, |
|
|
TInt & |
i |
|
) |
| |
|
inline |
String to integer type detemined 2nd function arg i.
Definition at line 408 of file String.h.
◆ strToBool()
Parse str
into a bool depending on the default value.
If the default
is true, look for a legal false
string. If the default
is false, look for a legal true
string.
Definition at line 426 of file String.h.
◆ strToBoolNodefault()
bool zypp::str::strToBoolNodefault |
( |
const C_Str & |
str, |
|
|
bool & |
return_r |
|
) |
| |
|
inline |
Parse str
into a bool if it's a legal true
or false
string.
If str
is not a recognized true
or false
string, return_r is left unchanged.
Definition at line 433 of file String.h.
◆ gapify()
std::string zypp::str::gapify |
( |
std::string |
inp_r, |
|
|
std::string::size_type |
gap_r = 1 , |
|
|
char |
gapchar = ' ' |
|
) |
| |
|
inline |
Enhance readability: insert gaps at regular distance.
Key Fingerprint: 22C07BA534178CD02EFE22AAB88B2FD43DBDC284
Key Fingerprint: 22C07BA5 34178CD0 2EFE22AA B88B2FD4 3DBDC284
Key Fingerprint: 22C0 7BA5 3417 8CD0 2EFE 22AA B88B 2FD4 3DBD C284
Key Fingerprint: 22C0-7BA5-3417-8CD0-2EFE-22AA-B88B-2FD4-3DBD-C284
Definition at line 476 of file String.h.
◆ ltrim() [1/2]
std::string zypp::str::ltrim |
( |
const std::string & |
s | ) |
|
|
inline |
◆ ltrim() [2/2]
std::string zypp::str::ltrim |
( |
std::string && |
s | ) |
|
|
inline |
◆ rtrim() [1/2]
std::string zypp::str::rtrim |
( |
const std::string & |
s | ) |
|
|
inline |
◆ rtrim() [2/2]
std::string zypp::str::rtrim |
( |
std::string && |
s | ) |
|
|
inline |
◆ split() [1/2]
template<class TOutputIterator >
unsigned zypp::str::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.
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 527 of file String.h.
◆ split() [2/2]
template<class TOutputIterator >
unsigned zypp::str::split |
( |
const C_Str & |
line_r, |
|
|
TOutputIterator |
result_r, |
|
|
const Trim |
trim_r |
|
) |
| |
◆ splitEscaped()
template<class TOutputIterator >
unsigned zypp::str::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.
Any sequence of characters in sepchars_r is treated as delimiter if not inside ""
or ''
or escaped by .
- A non-quoted backslash () preserves the literal value of the next character.
- Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
- Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of
.
The backslash retains its special meaning only when followed by "
or .
The words are passed to OutputIterator result_r.
- See also
- splitEscaped
std::vector<std::string> words;
example splitted strings
normal line -> 2 elements ( "normal", "line" )
escaped\ line -> 1 element(escaped line)
"quoted line" -> 1 element same as above
'quoted line' -> 1 element same as above
"escaped quote\"" -> 1 element (escaped quote")
\param line_r The string to parse.
\param result_r
\param sepchars_r String of separator characters.
\param withEmpty Whether to include empty fields between separators in the result.
Definition at line 591 of file String.h.
◆ splitFields()
template<class TOutputIterator >
unsigned zypp::str::splitFields |
( |
const C_Str & |
line_r, |
|
|
TOutputIterator |
result_r, |
|
|
const C_Str & |
sepchars_r = ":" |
|
) |
| |
Split line_r into fields.
Any single character in sepchars_r is treated as a field separator unless -escaped. 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 721 of file String.h.
◆ splitFieldsEscaped()
template<class TOutputIterator >
unsigned zypp::str::splitFieldsEscaped |
( |
const C_Str & |
line_r, |
|
|
TOutputIterator |
result_r, |
|
|
const C_Str & |
sepchars_r = ":" |
|
) |
| |
◆ join() [1/2]
template<class TIterator >
std::string zypp::str::join |
( |
TIterator |
begin, |
|
|
TIterator |
end, |
|
|
const C_Str & |
sep_r = " " |
|
) |
| |
Join strings using separator sep_r (defaults to BLANK).
Definition at line 772 of file String.h.
◆ join() [2/2]
template<class TContainer >
std::string zypp::str::join |
( |
const TContainer & |
cont_r, |
|
|
const C_Str & |
sep_r = " " |
|
) |
| |
Join strings using separator sep_r (defaults to BLANK).
Definition at line 786 of file String.h.
◆ joinEscaped()
template<class TIterator >
std::string zypp::str::joinEscaped |
( |
TIterator |
begin, |
|
|
TIterator |
end, |
|
|
const char |
sep_r = ' ' |
|
) |
| |
Join strings using separator sep_r, quoting or escaping the values.
Separator defaults to BLANK. Use splitEscaped to restore the values.
Definition at line 794 of file String.h.
◆ printIndented() [1/3]
std::ostream& zypp::str::printIndented |
( |
std::ostream & |
str, |
|
|
const std::string & |
text_r, |
|
|
const std::string & |
indent_r = " " , |
|
|
unsigned |
maxWitdh_r = 0 |
|
) |
| |
|
inline |
Indent by string [" "] optionally wrap.
Prints nothing for an empty string. Asserts a trainling '
' on the last line. Optionally wrap lines at ' ' at a given length.
Definition at line 841 of file String.h.
◆ printIndented() [2/3]
std::ostream& zypp::str::printIndented |
( |
std::ostream & |
str, |
|
|
const std::string & |
text_r, |
|
|
unsigned |
indent_r, |
|
|
char |
indentch_r = ' ' , |
|
|
unsigned |
maxWitdh_r = 0 |
|
) |
| |
|
inline |
◆ printIndented() [3/3]
std::ostream& zypp::str::printIndented |
( |
std::ostream & |
str, |
|
|
const std::string & |
text_r, |
|
|
unsigned |
indent_r, |
|
|
unsigned |
maxWitdh_r, |
|
|
char |
indentch_r = ' ' |
|
) |
| |
|
inline |
◆ autoPrefix()
std::ostream& zypp::str::autoPrefix |
( |
std::ostream & |
str, |
|
|
const std::string & |
text_r, |
|
|
function< std::string(const char *, const char *)> |
fnc_r |
|
) |
| |
|
inline |
Prefix lines by string computed by function taking line begin/end [std::string(const char*, const char*)] Prints nothing for an empty string.
Asserts a trainling '
' on the last line.
Definition at line 883 of file String.h.
◆ autoPrefix0()
std::ostream& zypp::str::autoPrefix0 |
( |
std::ostream & |
str, |
|
|
const std::string & |
text_r, |
|
|
function< std::string()> |
fnc_r |
|
) |
| |
|
inline |
◆ appendEscaped()
void zypp::str::appendEscaped |
( |
std::string & |
str_r, |
|
|
const C_Str & |
next_r, |
|
|
const char |
sep_r = ' ' |
|
) |
| |
|
inline |
Escape next_r and append it to str_r using separator sep_r.
Definition at line 918 of file String.h.
◆ toLower() [3/3]
std::string zypp::str::toLower |
( |
const char * |
s | ) |
|
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 964 of file String.h.
◆ toUpper() [3/3]
std::string zypp::str::toUpper |
( |
const char * |
s | ) |
|
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 973 of file String.h.
◆ compareCI()
int zypp::str::compareCI |
( |
const C_Str & |
lhs, |
|
|
const C_Str & |
rhs |
|
) |
| |
|
inline |
◆ contains()
Locate substring case sensitive.
Definition at line 987 of file String.h.
◆ containsCI()
bool zypp::str::containsCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
val_r |
|
) |
| |
|
inline |
Locate substring case insensitive.
Definition at line 990 of file String.h.
◆ hasPrefix()
bool zypp::str::hasPrefix |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
Return whether str_r has prefix prefix_r.
Definition at line 1023 of file String.h.
◆ hasPrefixCI()
bool zypp::str::hasPrefixCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
◆ stripPrefix()
std::string zypp::str::stripPrefix |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
Strip a prefix_r from str_r and return the resulting string.
Definition at line 1030 of file String.h.
◆ stripPrefixCI()
std::string zypp::str::stripPrefixCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
◆ hasSuffix()
bool zypp::str::hasSuffix |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
suffix_r |
|
) |
| |
|
inline |
Return whether str_r has suffix suffix_r.
Definition at line 1037 of file String.h.
◆ hasSuffixCI()
bool zypp::str::hasSuffixCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
suffix_r |
|
) |
| |
|
inline |
◆ stripSuffix()
std::string zypp::str::stripSuffix |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
suffix_r |
|
) |
| |
|
inline |
Strip a suffix_r from str_r and return the resulting string.
Definition at line 1044 of file String.h.
◆ stripSuffixCI()
std::string zypp::str::stripSuffixCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
suffix_r |
|
) |
| |
|
inline |
◆ commonPrefix()
std::string::size_type zypp::str::commonPrefix |
( |
const C_Str & |
lhs, |
|
|
const C_Str & |
rhs |
|
) |
| |
|
inline |
Return size of the common prefix of lhs and rhs.
Definition at line 1059 of file String.h.
◆ commonPrefixCI()
std::string::size_type zypp::str::commonPrefixCI |
( |
const C_Str & |
lhs, |
|
|
const C_Str & |
rhs |
|
) |
| |
|
inline |
◆ startsWith()
bool zypp::str::startsWith |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
◆ startsWithCI()
bool zypp::str::startsWithCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
◆ endsWith()
bool zypp::str::endsWith |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |
◆ endsWithCI()
bool zypp::str::endsWithCI |
( |
const C_Str & |
str_r, |
|
|
const C_Str & |
prefix_r |
|
) |
| |
|
inline |