omw
0.2.0
|
Public Member Functions | |
string (omw::string::size_type count, char c) | |
string (const char *str) | |
string (const char *str, omw::string::size_type count) | |
string (const std::string &other) | |
string (const std::string &other, std::string::size_type pos, std::string::size_type count=std::string::npos) | |
string (const char *first, const char *last) | |
std::string & | std () |
const std::string & | std () const |
bool | contains (char ch) const |
bool | contains (const char *str) const |
bool | contains (const std::string &str) const |
bool | contains (std::string_view sv) const |
omw::string & | replaceFirst (const std::string &search, const std::string &replace, size_type startPos=0) |
omw::string & | replaceFirst (const omw::StringReplacePair &pair, size_type startPos=0) |
omw::string & | replaceAll (char search, char replace, size_type startPos=0, size_t *nReplacements=nullptr) |
omw::string & | replaceAll (char search, const std::string &replace, size_type startPos=0, size_t *nReplacements=nullptr) |
omw::string & | replaceAll (const std::string &search, char replace, size_type startPos=0, size_t *nReplacements=nullptr) |
omw::string & | replaceAll (const std::string &search, const std::string &replace, size_type startPos=0, size_t *nReplacements=nullptr) |
omw::string & | replaceAll (const omw::StringReplacePair &pair, size_type startPos=0, size_t *nReplacements=nullptr) |
omw::string & | replaceAll (const std::vector< omw::StringReplacePair > &pairs, size_type startPos=0, size_t *nReplacementsTotal=nullptr, std::vector< size_t > *nReplacements=nullptr) |
omw::string & | replaceAll (const omw::StringReplacePair *pairs, size_t count, size_type startPos=0, size_t *nReplacementsTotal=nullptr, std::vector< size_t > *nReplacements=nullptr) |
omw::stringVector_t | split (char delimiter, omw::stringVector_t::size_type maxTokenCount=omw::stringVector_npos) const |
omw::stringVector_t | splitLen (omw::string::size_type tokenLength, omw::stringVector_t::size_type maxTokenCount=omw::stringVector_npos) const |
Case Conversion | |
Methods named | |
omw::string & | lower_ascii () |
omw::string & | lower_asciiExt () |
omw::string & | upper_ascii () |
omw::string & | upper_asciiExt () |
omw::string | toLower_ascii () const |
omw::string | toLower_asciiExt () const |
omw::string | toUpper_ascii () const |
omw::string | toUpper_asciiExt () const |
A with std::string
interchangeable class to add more functionalities. This class does not override/implement any (virtual) methods of the base class and has no attributes. It's basically a std::string
with some more methods. However the two constructors which take the other string as a char
pointer behave defined if a null pointer is passed.
omw::string::contains | ( | char | ch | ) | const |
until C++23
since C++23 Defined in std::string
Defined in the header.
omw::string::contains | ( | const char * | str | ) | const |
until C++23
since C++23 Defined in std::string
Defined in the header.
omw::string::contains | ( | const std::string & | str | ) | const |
until C++17
Defined in the header.
omw::string::contains | ( | std::string_view | sv | ) | const |
since C++17
until C++23
since C++23 Defined in std::string
Defined in the header.
omw::string & omw::string::replaceAll | ( | char | search, |
char | replace, | ||
size_type | startPos = 0 , |
||
size_t * | nReplacements = nullptr |
||
) |
search | Character to be replaced | |
replace | Character for replacement | |
startPos | From where to start searching | |
[out] | nReplacements | Number of occurrences |
*this
omw::string & omw::string::replaceAll | ( | char | search, |
const std::string & | replace, | ||
size_type | startPos = 0 , |
||
size_t * | nReplacements = nullptr |
||
) |
search | Character to be replaced | |
replace | String for replacement | |
startPos | From where to start searching | |
[out] | nReplacements | Number of occurrences |
*this
omw::string & omw::string::replaceAll | ( | const omw::StringReplacePair & | pair, |
size_type | startPos = 0 , |
||
size_t * | nReplacements = nullptr |
||
) |
pair | Search and replace string pair | |
startPos | From where to start searching | |
[out] | nReplacements | Number of occurrences |
*this
omw::string & omw::string::replaceAll | ( | const omw::StringReplacePair * | pairs, |
size_t | count, | ||
size_type | startPos = 0 , |
||
size_t * | nReplacementsTotal = nullptr , |
||
std::vector< size_t > * | nReplacements = nullptr |
||
) |
pairs | Pointer to a replace pair array | |
count | ||
startPos | From where to start searching | |
[out] | nReplacementsTotal | Total number of occurrences |
[out] | nReplacements | Number of occurrences of specific replace pair |
*this
omw::string & omw::string::replaceAll | ( | const std::string & | search, |
char | replace, | ||
size_type | startPos = 0 , |
||
size_t * | nReplacements = nullptr |
||
) |
search | Substring to be replaced | |
replace | Character for replacement | |
startPos | From where to start searching | |
[out] | nReplacements | Number of occurrences |
*this
omw::string & omw::string::replaceAll | ( | const std::string & | search, |
const std::string & | replace, | ||
size_type | startPos = 0 , |
||
size_t * | nReplacements = nullptr |
||
) |
search | Substring to be replaced | |
replace | String for replacement | |
startPos | From where to start searching | |
[out] | nReplacements | Number of occurrences |
*this
omw::string & omw::string::replaceAll | ( | const std::vector< omw::StringReplacePair > & | pairs, |
size_type | startPos = 0 , |
||
size_t * | nReplacementsTotal = nullptr , |
||
std::vector< size_t > * | nReplacements = nullptr |
||
) |
pairs | Search and replace string pair vector | |
startPos | From where to start searching | |
[out] | nReplacementsTotal | Total number of occurrences |
[out] | nReplacements | Number of occurrences of specific replace pair |
*this
omw::string & omw::string::replaceFirst | ( | const omw::StringReplacePair & | pair, |
size_type | startPos = 0 |
||
) |
pair | Search and replace string pair |
startPos | From where to start searching |
*this
omw::string & omw::string::replaceFirst | ( | const std::string & | search, |
const std::string & | replace, | ||
size_type | startPos = 0 |
||
) |
search | Substring to be replaced |
replace | String for replacement |
startPos | From where to start searching |
*this
std::string & omw::string::std | ( | ) |
Used if an implicit conversion to std::string
is not possible (e.g. passing an omw::string
to a function parameter of type std::filesystem::path
).