cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Namespaces | Functions
string_helpers.hpp File Reference

Implementation of global string accessors for C++.This header adds global functions to access the functionality of the following std::string and sibling members: More...

Namespaces

 cxxomfort
 Namespace of the cxxomfort library.
 

Functions

template<typename Ch , typename ChT , typename A >
Ch const * c_str (std::basic_string< Ch, ChT, A > const &str) CXXO_NOEXCEPT
 Calls str.c_str() More...
 
template<typename Ch , typename ChT , typename A >
void clear (std::basic_string< Ch, ChT, A > &str) CXXO_NOEXCEPT
 Calls str.clear() More...
 
template<typename Ch , typename ChT >
int compare (std::basic_string_view< Ch, ChT > const str1, std::basic_string_view< Ch, ChT > const str2) CXXO_NOEXCEPT
 Calls str1.compare(str2) More...
 
template<typename Ch , typename ChT >
int compare (std::basic_string_view< Ch, ChT > const str1, Ch c) CXXO_NOEXCEPT
 
template<typename Ch , typename ChT , typename R >
int compare (std::basic_string_view< Ch, ChT > const str1, R const &str2)
 Calls str1.compare(str2) More...
 
template<typename Ch , typename ChT >
int compare (std::basic_string_view< Ch, ChT > const str1, size_t pos, size_t count, std::basic_string_view< Ch, ChT > const str2) CXXO_NOEXCEPT
 Calls str1.compare(pos,count,str2) More...
 
template<typename Ch , typename ChT , typename A >
int compare (std::basic_string< Ch, ChT, A > const &str1, std::basic_string< Ch, ChT, A > const &str2) CXXO_NOEXCEPT
 
template<typename Ch , typename ChT , typename A >
std::basic_string< Ch, ChT, A >::size_type find (std::basic_string< Ch, ChT, A > const &str1, std::basic_string_view< Ch, ChT > const str2, size_t pos=0) CXXO_NOEXCEPT
 Calls str1.find(str2, pos, str2.size() ) More...
 
template<typename Ch , typename ChT , typename A , typename R >
std::basic_string< Ch, ChT, A >::size_type find (std::basic_string< Ch, ChT, A > const &str1, R const &str2, size_t pos=0) CXXO_NOEXCEPT
 Finds string str2 (converted to basic_string_view ) in str1 starting from index pos .
 
template<typename Ch , typename ChT >
std::basic_string< Ch, ChT >::size_type find (std::basic_string_view< Ch, ChT > const str1, std::basic_string_view< Ch, ChT > const str2, size_t pos=0) CXXO_NOEXCEPT
 Calls str1.find(str2, pos) More...
 
template<typename Ch , typename ChT , typename R >
std::basic_string< Ch, ChT >::size_type find (std::basic_string_view< Ch, ChT > const str1, R const &str2, size_t pos=0) CXXO_NOEXCEPT
 Finds string str2 (converted to basic_string_view ) in str1 starting from index pos .
 

Detailed Description

Implementation of global string accessors for C++.

This header adds global functions to access the functionality of the following std::string and sibling members:

See Nonmember helpers for string types for more informatin

Function Documentation

◆ c_str()

Ch const* cxxomfort::string::c_str ( std::basic_string< Ch, ChT, A > const &  str)

Calls str.c_str()

Nonmember string helpers
See also
C++11 Backports

Referenced by cxxomfort::string::c_str().

◆ clear()

void cxxomfort::string::clear ( std::basic_string< Ch, ChT, A > &  str)

Calls str.clear()

Nonmember string helpers
<string>:
Nonmember string helpers
See also
C++11 Backports

Referenced by cxxomfort::string::clear().

◆ compare() [1/5]

int cxxomfort::string::compare ( std::basic_string_view< Ch, ChT > const  str1,
std::basic_string_view< Ch, ChT > const  str2 
)

Calls str1.compare(str2)

Nonmember string helpers std0string_view "" "" nonmember string helpers
See also
C++20 Backports

Referenced by cxxomfort::string::compare().

◆ compare() [2/5]

int cxxomfort::string::compare ( std::basic_string_view< Ch, ChT > const  str1,
Ch  c 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ compare() [3/5]

int cxxomfort::string::compare ( std::basic_string_view< Ch, ChT > const  str1,
R const &  str2 
)

Calls str1.compare(str2)

Nonmember string helpers
See also
C++17 Backports

◆ compare() [4/5]

int cxxomfort::string::compare ( std::basic_string_view< Ch, ChT > const  str1,
size_t  pos,
size_t  count,
std::basic_string_view< Ch, ChT > const  str2 
)

Calls str1.compare(pos,count,str2)

Nonmember string helpers
See also
C++17 Backports

◆ compare() [5/5]

int cxxomfort::string::compare ( std::basic_string< Ch, ChT, A > const &  str1,
std::basic_string< Ch, ChT, A > const &  str2 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ find() [1/2]

std::basic_string<Ch,ChT,A>::size_type cxxomfort::string::find ( std::basic_string< Ch, ChT, A > const &  str1,
std::basic_string_view< Ch, ChT > const  str2,
size_t  pos = 0 
)

Calls str1.find(str2, pos, str2.size() )

Nonmember string helpers
See also
C++11 Backports

◆ find() [2/2]

std::basic_string<Ch,ChT>::size_type cxxomfort::string::find ( std::basic_string_view< Ch, ChT > const  str1,
std::basic_string_view< Ch, ChT > const  str2,
size_t  pos = 0 
)

Calls str1.find(str2, pos)

Nonmember string helpers
See also
C++17 Backports