OMW  0.1.0
Public Member Functions | List of all members
omw::string Class Reference
Inheritance diagram for omw::string:
std::string

Public Member Functions

 string (const char *str)
 
 string (const std::string &str)
 
 string (const char *first, const char *last)
 
bool isInteger () const
 
bool isUInteger () const
 
omw::stringreplaceFirst (const omw::string &search, const omw::string &replace, size_type startPos=0)
 
omw::stringreplaceFirst (const omw::StringReplacePair &pair, size_type startPos=0)
 
omw::stringreplaceAll (const omw::string &search, const omw::string &replace, size_type startPos=0, size_type *nReplacements=nullptr)
 
omw::stringreplaceAll (const omw::StringReplacePair &pair, size_type startPos=0, size_type *nReplacements=nullptr)
 
omw::stringreplaceAll (const std::vector< omw::StringReplacePair > &pairs, size_type startPos=0, size_type *nReplacementsTotal=nullptr, std::vector< size_type > *nReplacements=nullptr)
 
omw::stringreplaceAll (const omw::StringReplacePair *pairsBegin, const omw::StringReplacePair *pairsEnd, size_type startPos=0, size_type *nReplacementsTotal=nullptr, std::vector< size_type > *nReplacements=nullptr)
 
omw::stringmakeUrlEncoded ()
 
omw::string toUrlEncoded () const
 
Case Conversion

Methods named .._ascii convert only A-Z and a-z. Those named .._asciiExt additionally convert some UTF-8 code points too.

omw::stringmakeLower_ascii ()
 
omw::stringmakeLower_asciiExt ()
 
omw::stringmakeUpper_ascii ()
 
omw::stringmakeUpper_asciiExt ()
 
omw::string toLower_ascii () const
 
omw::string toLower_asciiExt () const
 
omw::string toUpper_ascii () const
 
omw::string toUpper_asciiExt () const
 

Detailed Description

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.

Member Function Documentation

◆ replaceAll() [1/4]

omw::string & omw::string::replaceAll ( const omw::string search,
const omw::string replace,
size_type  startPos = 0,
size_type *  nReplacements = nullptr 
)
Parameters
searchSubstring to be replaced
replaceString for replacement
startPosFrom where to start searching
[out]nReplacementsNumber of occurrences
Returns
*this

◆ replaceAll() [2/4]

omw::string & omw::string::replaceAll ( const omw::StringReplacePair pair,
size_type  startPos = 0,
size_type *  nReplacements = nullptr 
)
Parameters
pairSearch and replace string pair
startPosFrom where to start searching
[out]nReplacementsNumber of occurrences
Returns
*this

◆ replaceAll() [3/4]

omw::string & omw::string::replaceAll ( const omw::StringReplacePair pairsBegin,
const omw::StringReplacePair pairsEnd,
size_type  startPos = 0,
size_type *  nReplacementsTotal = nullptr,
std::vector< size_type > *  nReplacements = nullptr 
)
Parameters
pairsBeginPointer to first replace pair in array
pairsEndPointer to first replace pair behind the array
startPosFrom where to start searching
[out]nReplacementsTotalTotal number of occurrences
[out]nReplacementsNumber of occurrences of specific replace pair
Returns
*this

Processes all replace pairs in range [pairsBegin, pairsEnd).

◆ replaceAll() [4/4]

omw::string & omw::string::replaceAll ( const std::vector< omw::StringReplacePair > &  pairs,
size_type  startPos = 0,
size_type *  nReplacementsTotal = nullptr,
std::vector< size_type > *  nReplacements = nullptr 
)
Parameters
pairsSearch and replace string pair vector
startPosFrom where to start searching
[out]nReplacementsTotalTotal number of occurrences
[out]nReplacementsNumber of occurrences of specific replace pair
Returns
*this

◆ replaceFirst() [1/2]

omw::string & omw::string::replaceFirst ( const omw::string search,
const omw::string replace,
size_type  startPos = 0 
)
Parameters
searchSubstring to be replaced
replaceString for replacement
startPosFrom where to start searching
Returns
*this

◆ replaceFirst() [2/2]

omw::string & omw::string::replaceFirst ( const omw::StringReplacePair pair,
size_type  startPos = 0 
)
Parameters
pairSearch and replace string pair
startPosFrom where to start searching
Returns
*this

The documentation for this class was generated from the following files: