Castor3D 0.16.0
Multiplatform 3D engine
Namespaces | Functions
castor::string Namespace Reference

String functions namespace. More...

Namespaces

namespace  details
 
namespace  utf8
 Utf8 functions namespace.
 

Functions

CU_API bool isInteger (String const &toTest, std::locale const &locale=std::locale("C"))
 Tests if the given String represents an integer.
 
CU_API bool isFloating (String const &toTest, std::locale const &locale=std::locale("C"))
 Tests if the given String represents a floating number.
 
CU_API short toShort (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a short from a given String.
 
CU_API int toInt (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves an int from a given String.
 
CU_API long toLong (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a long from a given String.
 
CU_API long long toLongLong (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a long long from a given String.
 
CU_API unsigned short toUShort (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves an unsigned short from a given String.
 
CU_API unsigned int toUInt (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves an unsigned int from a given String.
 
CU_API unsigned long toULong (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves an unsigned long from a given String.
 
CU_API unsigned long long toULongLong (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves an unsigned long long from a given String.
 
CU_API float toFloat (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a float from a given String.
 
CU_API double toDouble (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a double from a given String.
 
CU_API long double toLongDouble (String const &str, std::locale const &locale=std::locale("C"))
 Retrieves a double from a given String.
 
CU_API bool isUpperCase (String const &toTest)
 Tests if the given String is upper case.
 
CU_API bool isLowerCase (String const &toTest)
 Tests if the given String is lower case.
 
CU_API String upperCase (String const &str)
 sets all characters in a String to upper case
 
CU_API String lowerCase (String const &str)
 sets all characters in a String to lower case
 
CU_API String snakeToCamelCase (String const &str)
 Converts given string from snake_case to CamelCase.
 
CU_API StringtoUpperCase (String &str)
 sets all characters in a String to upper case
 
CU_API StringtoLowerCase (String &str)
 sets all characters in a String to lower case
 
template<typename CharT >
Vector< std::basic_string< CharT > > split (std::basic_string< CharT > const &str, std::basic_string_view< CharT > delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
Vector< std::basic_string< CharT > > split (std::basic_string< CharT > const &str, std::basic_string< CharT > delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
Vector< std::basic_string< CharT > > split (std::basic_string< CharT > const &str, CharT const *delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
Vector< std::basic_string_view< CharT > > split (std::basic_string_view< CharT > str, std::basic_string_view< CharT > delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
Vector< std::basic_string_view< CharT > > split (std::basic_string_view< CharT > str, std::basic_string< CharT > delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
Vector< std::basic_string_view< CharT > > split (std::basic_string_view< CharT > str, CharT const *delims, uint32_t maxSplits=10, bool keepEmpty=true)
 Cuts a String into substrings, using delimiter(s)
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, CharT toFind, CharT replacement)
 Replaces all occurences of a xchar by another one in a String.
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, CharT const *toFind, CharT const *replacement)
 Replaces all occurences of a xchar by another one in a String.
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, std::basic_string_view< CharT > toFind, CharT replacement)
 Replaces all occurences of a String by a xchar in a String.
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, CharT toFind, std::basic_string_view< CharT > replacement)
 Replaces all occurences of a xchar by a String in a String.
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, std::basic_string< CharT > toFind, std::basic_string< CharT > replacement)
 Replaces all occurences of a String in another one by a third one.
 
template<typename CharT >
std::basic_string< CharT > & replace (std::basic_string< CharT > &str, std::basic_string_view< CharT > toFind, std::basic_string_view< CharT > replacement)
 Replaces all occurences of a String in another one by a third one.
 
template<typename CharT >
std::basic_string< CharT > & trim (std::basic_string< CharT > &text, bool left=true, bool right=true, std::basic_string_view< CharT > seps=details::trimDefaultArgs< CharT >)
 Removes spaces on the left and/or on the right of the given String.
 
template<typename CharT >
std::basic_string_view< CharT > & trim (std::basic_string_view< CharT > &text, bool left=true, bool right=true, std::basic_string_view< CharT > seps=details::trimDefaultArgs< CharT >)
 Removes spaces on the left and/or on the right of the given String.
 
template<typename CharT >
std::basic_string< CharT > getLongestCommonSubstring (std::basic_string< CharT > const &lhs, std::basic_string< CharT > const &rhs)
 
CU_API String toString (char32_t value)
 Puts a value into a String.
 
CU_API String toString (uint8_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (int16_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (uint16_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (int32_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (uint32_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (int64_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API String toString (uint64_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (char32_t value)
 Puts a value into a String.
 
CU_API MbString toMbString (uint8_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (int16_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (uint16_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (int32_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (uint32_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (int64_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API MbString toMbString (uint64_t value, int base=10, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< char >()))
 Puts a value into a String.
 
CU_API bool endsWith (StringView value, StringView suffix)
 
CU_API bool startsWith (StringView value, StringView prefix)
 
template<typename T >
void parse (String const &str, T &value, std::locale const &locale=std::locale("C"))
 Retrieves a value from the given String.
 
template<typename T >
void extract (String &str, T &value, std::locale const &locale=std::locale("C"))
 Retrieves a value from the given String.
 
template<typename T >
String toString (T const &value, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< xchar >()))
 Puts a value into a String.
 
template<typename T >
MbString toMbString (T const &value, std::locale const &locale=std::locale(std::locale("C"), new manip::BaseNumPut< xchar >()))
 Puts a value into a String.
 

Detailed Description

String functions namespace.

Function Documentation

◆ endsWith()

CU_API bool castor::string::endsWith ( StringView value,
StringView suffix )
Parameters
[in]valueThe value.
[in]suffixThe suffix.
Returns
true if value ends with suffix.

◆ extract()

template<typename T >
void castor::string::extract ( String & str,
T & value,
std::locale const & locale = std::locale("C") )
inline

Retrieves a value from the given String.

Parameters
[in]strThe String supposedly containing the value
[out]valueReceives the retrieved value
[in]localeThe locale used in the conversion

◆ getLongestCommonSubstring()

template<typename CharT >
std::basic_string< CharT > castor::string::getLongestCommonSubstring ( std::basic_string< CharT > const & lhs,
std::basic_string< CharT > const & rhs )
Parameters
[in]lhs,rhsThe input strings.
Returns
The longest string common to the input strings.

◆ isFloating()

CU_API bool castor::string::isFloating ( String const & toTest,
std::locale const & locale = std::locale("C") )

Tests if the given String represents a floating number.

Parameters
[in]toTestThe String to test
[in]localeThe locale used to determine the dot format
Returns
false if toTest contains any character other than '0123456789.,' or more than one '.'/','

◆ isInteger()

CU_API bool castor::string::isInteger ( String const & toTest,
std::locale const & locale = std::locale("C") )

Tests if the given String represents an integer.

Parameters
[in]toTestThe String to test
[in]localeThe locale (unused)
Returns
false if toTest contains any character other than '0123456789'

◆ isLowerCase()

CU_API bool castor::string::isLowerCase ( String const & toTest)

Tests if the given String is lower case.

Parameters
[in]toTestThe String to test
Returns
true if toTest is lower case

◆ isUpperCase()

CU_API bool castor::string::isUpperCase ( String const & toTest)

Tests if the given String is upper case.

Parameters
[in]toTestThe String to test
Returns
true if toTest is upper case

◆ lowerCase()

CU_API String castor::string::lowerCase ( String const & str)

sets all characters in a String to lower case

Parameters
[in]strThe String to modify
Returns
The modified String

◆ parse()

template<typename T >
void castor::string::parse ( String const & str,
T & value,
std::locale const & locale = std::locale("C") )
inline

Retrieves a value from the given String.

Parameters
[in]strThe String supposedly containing the value
[in]localeThe locale used in the conversion
[out]valueReceives the retrieved value

◆ replace() [1/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
CharT const * toFind,
CharT const * replacement )

Replaces all occurences of a xchar by another one in a String.

Parameters
[in,out]strThe String to modify
[in]toFindThe xchar to replace
[in]replacementThe replacement xchar
Returns
A reference on the modified string

◆ replace() [2/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
CharT toFind,
CharT replacement )

Replaces all occurences of a xchar by another one in a String.

Parameters
[in,out]strThe String to modify
[in]toFindThe xchar to replace
[in]replacementThe replacement xchar
Returns
A reference on the modified string

◆ replace() [3/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
CharT toFind,
std::basic_string_view< CharT > replacement )

Replaces all occurences of a xchar by a String in a String.

Parameters
[in,out]strThe String to modify
[in]toFindThe xchar to replace
[in]replacementThe replacement String
Returns
A reference on the modified string

◆ replace() [4/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
std::basic_string< CharT > toFind,
std::basic_string< CharT > replacement )

Replaces all occurences of a String in another one by a third one.

Parameters
[in,out]strThe String to modify
[in]toFindThe String to replace
[in]replacementThe replacement String
Returns
A reference on the modified string

◆ replace() [5/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
std::basic_string_view< CharT > toFind,
CharT replacement )

Replaces all occurences of a String by a xchar in a String.

Parameters
[in,out]strThe String to modify
[in]toFindThe String to replace
[in]replacementThe replacement xchar
Returns
A reference on the modified string

◆ replace() [6/6]

template<typename CharT >
std::basic_string< CharT > & castor::string::replace ( std::basic_string< CharT > & str,
std::basic_string_view< CharT > toFind,
std::basic_string_view< CharT > replacement )

Replaces all occurences of a String in another one by a third one.

Parameters
[in,out]strThe String to modify
[in]toFindThe String to replace
[in]replacementThe replacement String
Returns
A reference on the modified string

◆ snakeToCamelCase()

CU_API String castor::string::snakeToCamelCase ( String const & str)

Converts given string from snake_case to CamelCase.

◆ split() [1/6]

template<typename CharT >
Vector< std::basic_string< CharT > > castor::string::split ( std::basic_string< CharT > const & str,
CharT const * delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

◆ split() [2/6]

template<typename CharT >
Vector< std::basic_string< CharT > > castor::string::split ( std::basic_string< CharT > const & str,
std::basic_string< CharT > delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

◆ split() [3/6]

template<typename CharT >
Vector< std::basic_string< CharT > > castor::string::split ( std::basic_string< CharT > const & str,
std::basic_string_view< CharT > delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

Referenced by castor3d::ParametersT< KeyT >::parse().

Here is the caller graph for this function:

◆ split() [4/6]

template<typename CharT >
Vector< std::basic_string_view< CharT > > castor::string::split ( std::basic_string_view< CharT > str,
CharT const * delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

◆ split() [5/6]

template<typename CharT >
Vector< std::basic_string_view< CharT > > castor::string::split ( std::basic_string_view< CharT > str,
std::basic_string< CharT > delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

◆ split() [6/6]

template<typename CharT >
Vector< std::basic_string_view< CharT > > castor::string::split ( std::basic_string_view< CharT > str,
std::basic_string_view< CharT > delims,
uint32_t maxSplits = 10,
bool keepEmpty = true )

Cuts a String into substrings, using delimiter(s)

Parameters
[in]strThe String to cut
[in]delimsThe delimiter(s)
[in]maxSplitsThe max splits count (the return will contain 0 < x < maxSplits substrings)
[in]keepEmptyTells if the function keeps empty substrings or not
Returns
The array containing the substrings

◆ startsWith()

CU_API bool castor::string::startsWith ( StringView value,
StringView prefix )
Parameters
[in]valueThe value.
[in]prefixThe suffix.
Returns
true if value starts with prefix.

◆ toDouble()

CU_API double castor::string::toDouble ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a double from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The double contained in the String

◆ toFloat()

CU_API float castor::string::toFloat ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a float from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The float contained in the String

◆ toInt()

CU_API int castor::string::toInt ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves an int from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The int contained in the String

◆ toLong()

CU_API long castor::string::toLong ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a long from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The long contained in the String

◆ toLongDouble()

CU_API long double castor::string::toLongDouble ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a double from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The double contained in the String

◆ toLongLong()

CU_API long long castor::string::toLongLong ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a long long from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The long long contained in the String

◆ toLowerCase()

CU_API String & castor::string::toLowerCase ( String & str)

sets all characters in a String to lower case

Parameters
[in,out]strThe String to modify, receives the modified String
Returns
The modified String

◆ toMbString() [1/9]

CU_API MbString castor::string::toMbString ( char32_t value)

Puts a value into a String.

Parameters
[in]valueThe value
Returns
The String containing the value

◆ toMbString() [2/9]

CU_API MbString castor::string::toMbString ( int16_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [3/9]

CU_API MbString castor::string::toMbString ( int32_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [4/9]

CU_API MbString castor::string::toMbString ( int64_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [5/9]

template<typename T >
MbString castor::string::toMbString ( T const & value,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPutxchar >()) )
inline

Puts a value into a String.

Parameters
[in]valueThe value
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [6/9]

CU_API MbString castor::string::toMbString ( uint16_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [7/9]

CU_API MbString castor::string::toMbString ( uint32_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [8/9]

CU_API MbString castor::string::toMbString ( uint64_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toMbString() [9/9]

CU_API MbString castor::string::toMbString ( uint8_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toShort()

CU_API short castor::string::toShort ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves a short from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The short contained in the String

◆ toString() [1/9]

CU_API String castor::string::toString ( char32_t value)

Puts a value into a String.

Parameters
[in]valueThe value
Returns
The String containing the value

◆ toString() [2/9]

CU_API String castor::string::toString ( int16_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [3/9]

CU_API String castor::string::toString ( int32_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [4/9]

CU_API String castor::string::toString ( int64_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [5/9]

template<typename T >
String castor::string::toString ( T const & value,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPutxchar >()) )
inline

Puts a value into a String.

Parameters
[in]valueThe value
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [6/9]

CU_API String castor::string::toString ( uint16_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [7/9]

CU_API String castor::string::toString ( uint32_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [8/9]

CU_API String castor::string::toString ( uint64_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toString() [9/9]

CU_API String castor::string::toString ( uint8_t value,
int base = 10,
std::locale const & locale = std::locale(std::locale("C"), new manip::BaseNumPut< char >()) )

Puts a value into a String.

Parameters
[in]valueThe value
[in]baseThe numeric base
[in]localeThe locale used in the conversion
Returns
The String containing the value

◆ toUInt()

CU_API unsigned int castor::string::toUInt ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves an unsigned int from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The unsigned int contained in the String

◆ toULong()

CU_API unsigned long castor::string::toULong ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves an unsigned long from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The unsigned long contained in the String

◆ toULongLong()

CU_API unsigned long long castor::string::toULongLong ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves an unsigned long long from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The unsigned long long contained in the String

◆ toUpperCase()

CU_API String & castor::string::toUpperCase ( String & str)

sets all characters in a String to upper case

Parameters
[in,out]strThe String to modify, receives the modified String
Returns
The modified String

◆ toUShort()

CU_API unsigned short castor::string::toUShort ( String const & str,
std::locale const & locale = std::locale("C") )

Retrieves an unsigned short from a given String.

Parameters
[in]strThe String
[in]localeThe locale used in the conversion
Returns
The unsigned short contained in the String

◆ trim() [1/2]

template<typename CharT >
std::basic_string< CharT > & castor::string::trim ( std::basic_string< CharT > & text,
bool left = true,
bool right = true,
std::basic_string_view< CharT > seps = details::trimDefaultArgs< CharT > )

Removes spaces on the left and/or on the right of the given String.

Parameters
[in,out]textThe String to trim, receives the trimmed string
[in]leftTells if we remove the left spaces
[in]rightTells if we remove the right spaces
[in]sepsThe characters to trim
Returns
The trimmed String

◆ trim() [2/2]

template<typename CharT >
std::basic_string_view< CharT > & castor::string::trim ( std::basic_string_view< CharT > & text,
bool left = true,
bool right = true,
std::basic_string_view< CharT > seps = details::trimDefaultArgs< CharT > )

Removes spaces on the left and/or on the right of the given String.

Parameters
[in,out]textThe String to trim, receives the trimmed string
[in]leftTells if we remove the left spaces
[in]rightTells if we remove the right spaces
[in]sepsThe characters to trim
Returns
The trimmed String

◆ upperCase()

CU_API String castor::string::upperCase ( String const & str)

sets all characters in a String to upper case

Parameters
[in]strThe String to modify
Returns
The modified String