PLCnext API Documentation 25.0.2.69
|
This class represents the Arp String. The implementation is based on std::string
.
More...
#include <String.hpp>
Public Types | |
using | CharType = char |
The character type. | |
using | Allocator = std::allocator< CharType > |
The characters allocator type. | |
using | AllocatorTraits = std::allocator_traits< Allocator > |
The allocator traits type. | |
using | Char8uType = Arp::Base::Core::char8u |
The UTF8 character type. | |
using | BaseString = BasicString< CharType, Allocator > |
The type of the basic string. | |
using | StdString = BaseString::StdString |
The type of the basic std string. | |
using | Reference = typename BaseString::reference |
The reference type of this type. | |
using | ConstReference = typename BaseString::const_reference |
The const reference type of this type. | |
using | Iterator = typename BaseString::iterator |
The iterator type of this type. | |
using | ConstIterator = typename BaseString::const_iterator |
The const iterator type of this type. | |
using | ReverseIterator = typename BaseString::reverse_iterator |
The reverse iterator type of this type. | |
using | ConstReverseIterator = typename BaseString::const_reverse_iterator |
Used by Split() operations. | |
using | ThreeWayCompareResult = decltype(StdString()<=> StdString()) |
Used by operator<=> | |
using | Tokens = std::vector< String > |
Used by initializing operations. | |
using | Bytes = std::vector< byte > |
using | allocator_type = Allocator |
The allocator type of this type. | |
using | value_type = CharType |
The char type of this type. | |
using | size_type = typename BaseString::size_type |
The size type of this type. | |
using | difference_type = typename BaseString::difference_type |
The difference type of this type. | |
using | reference = typename BaseString::reference |
The reference type of this type. | |
using | const_reference = typename BaseString::const_reference |
The const reference type of this type. | |
using | pointer = typename AllocatorTraits::pointer |
The pointer type of this type. | |
using | const_pointer = typename AllocatorTraits::const_pointer |
The const pointer type of this type. | |
using | iterator = typename BaseString::iterator |
The iterator type of this type. | |
using | const_iterator = typename BaseString::const_iterator |
The const iterator type of this type. | |
using | reverse_iterator = typename BaseString::reverse_iterator |
The reverse iterator type of this type. | |
using | const_reverse_iterator = typename BaseString::const_reverse_iterator |
The const reverse iterator type of this type. | |
Public Member Functions | |
String (void) | |
The default constructor constructs an empty string instance. | |
String (const String &arg) | |
The copy constructor copies the as argument passed string deeply. More... | |
String (String &&arg) noexcept | |
This move constructor moves the as argument passed string to this string. More... | |
String & | operator= (const String &arg) |
This assignment operator copies the right-hand-side operand to this string. More... | |
String & | operator= (String &&arg) noexcept |
This move assignment operator moves the right-hand-side operand to this string. More... | |
~String (void) | |
The destructor deallocates all memory of this instance. | |
String (const BaseString &arg) | |
This constructor copies the as argument passed string. More... | |
String (BaseString &&arg) | |
This constructor moves the as argument passed string. More... | |
String (const StdString &arg) | |
This constructor copies the as argument passed string. More... | |
String (StdString &&arg) | |
This constructor moves the as argument passed string. More... | |
String (const String &arg, size_type offset, size_type count=NPos) | |
This constructor copies the as argument passed string partially. More... | |
String (const CharType *pChars, size_type count) | |
This constructor copies the as argument passed C-string. More... | |
String (const CharType *pChars) | |
This constructor copies the as argument passed C-string. More... | |
String (const Char8uType *pChars) | |
This constructor copies the as argument passed C-string. More... | |
String (size_type count, CharType c) | |
Fills the string with count consecutive copies of character c . More... | |
String (std::initializer_list< CharType > arg) | |
Copies each of the characters in initList , in the same order. More... | |
String (Iterator first, Iterator last) | |
Copies the sequence of characters in the range [first,last) , in the same order.. More... | |
String (ConstIterator first, ConstIterator last) | |
Copies the sequence of characters in the range [first,last) , in the same order.. More... | |
String (const Bytes &bytes) | |
Copies the as arguments passed bytes to this string. More... | |
operator const CharType * (void) const | |
Converts this string implicitly to a C-string. More... | |
operator const StdString & (void) const | |
Converts this string implicitly to a std string. More... | |
String & | operator= (std::initializer_list< CharType > right) |
This assignment operator copies each of the characters in the right-hand-side operand to this string, in the same order. More... | |
String & | operator= (const CharType *right) |
This assignment operator copies the right-hand-side operand to this string. More... | |
String & | operator= (CharType c) |
This assignment operator copies the right-hand-side operand to this string. More... | |
String & | operator+= (std::initializer_list< CharType > right) |
This assignment operator appends each of the characters in the right-hand-side operand to this string, in the same order. More... | |
String & | operator+= (const String &right) |
This assignment operator appends the right-hand-side operand to this string. More... | |
String & | operator+= (const CharType *right) |
This assignment operator appends the right-hand-side operand to this string. More... | |
String & | operator+= (CharType c) |
This assignment operator appends the right-hand-side operand to this string. More... | |
String & | Assign (const String &arg) |
This operation copies the argument to this string. More... | |
String & | Assign (String &&arg) |
This operation moves the as argument passed string to this string. More... | |
String & | Assign (const StdString &arg) |
This operation copies the argument to this string. More... | |
String & | Assign (StdString &&arg) |
This operation moves the argument to this string. More... | |
String & | Assign (std::initializer_list< CharType > arg) |
This operation copies each of the characters in the argument to this string, in the same order. More... | |
String & | Assign (const String &arg, size_type offset, size_type count=NPos) |
This operation copies the as argument passed string partially. More... | |
String & | Assign (const CharType *pChars, size_type count) |
This operation copies the as argument passed C-string partially. More... | |
String & | Assign (const CharType *pChars) |
This operation copies the as argument passed C-string. More... | |
String & | Assign (size_type count, CharType c) |
Fills this string with count consecutive copies of character c . More... | |
String & | Assign (Iterator first, Iterator last) |
Copies the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Assign (ConstIterator first, ConstIterator last) |
Copies the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Assign (const_pointer first, const_pointer last) |
Copies the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Append (std::initializer_list< CharType > arg) |
This operation appends each of the characters in the argument to this string, in the same order. More... | |
String & | Append (const String &arg) |
This operation appends the argument to this string. More... | |
String & | Append (const String &arg, size_type offset, size_type count=NPos) |
This operation appends the as argument passed string partially. More... | |
String & | Append (const CharType *pChars, size_type count) |
This operation appends the as argument passed C-string partially. More... | |
String & | Append (const CharType *pChars) |
This operation appends the as argument passed C-string. More... | |
String & | Append (size_type count, CharType c) |
Appends to this string count consecutive copies of character c . More... | |
String & | Append (Iterator first, Iterator last) |
Appends the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Append (ConstIterator first, ConstIterator last) |
Appends the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Append (const_pointer first, const_pointer last) |
Appends the sequence of characters in the range [first,last) , in the same order. More... | |
String & | Insert (size_type offset, const String &arg) |
This operation inserts the argument at the given position. More... | |
String & | Insert (size_type offset, const String &arg, size_type argOffset, size_type count=NPos) |
This operation inserts the as argument passed string partially. More... | |
String & | Insert (size_type offset, const CharType *pChars, size_type count) |
This operation inserts the as argument passed string partially. More... | |
String & | Insert (size_type offset, const CharType *pChars) |
This operation inserts the as argument passed string. More... | |
String & | Insert (size_type offset, size_type count, CharType c) |
Inserts count consecutive copies of character c at position offset . More... | |
Iterator | Insert (ConstIterator where, CharType c) |
Inserts character c at position where . More... | |
Iterator | Insert (ConstIterator where, size_type count, CharType c) |
Inserts character c at position where . More... | |
Iterator | Insert (ConstIterator where, Iterator first, Iterator last) |
Inserts a range of chars [first;last) at position where . More... | |
Iterator | Insert (ConstIterator where, ConstIterator first, ConstIterator last) |
Inserts a range of chars [first;last) at position where . More... | |
Iterator | Insert (ConstIterator where, const_pointer first, const_pointer last) |
Inserts a range of chars [first;last) at position where . More... | |
Iterator | Insert (ConstIterator where, std::initializer_list< CharType > chars) |
This operation inserts each of the characters in the argument to this string, in the same order. More... | |
String & | Erase (size_type offset=0) |
This operation erases chars from this string. More... | |
String & | Erase (size_type offset, size_type count) |
This operation erases chars from this string. More... | |
Iterator | Erase (ConstIterator where) |
This operation erases chars from this string. More... | |
Iterator | Erase (ConstIterator first, ConstIterator last) |
Erases a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, std::initializer_list< CharType > chars) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (size_type offset, size_type length, const String &arg) |
Replaces a range of chars. More... | |
String & | Replace (size_type offset, size_type length, const String &arg, size_type offsetArg, size_type count=NPos) |
Replaces a range of chars. More... | |
String & | Replace (size_type offset, size_type length, const CharType *pChars, size_type count) |
Replaces a range of chars. More... | |
String & | Replace (size_type offset, size_type length, const CharType *pChars) |
Replaces a range of chars. More... | |
String & | Replace (size_type offset, size_type length, size_type count, CharType c) |
Replaces a range of chars by a character. More... | |
String & | Replace (ConstIterator first, ConstIterator last, const String &arg) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, const CharType *pChars, size_type count) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, const CharType *pChars) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, size_type count, CharType c) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, Iterator first2, Iterator last2) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, ConstIterator first2, ConstIterator last2) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, const_pointer first2, const_pointer last2) |
Replaces a range of chars [first;last) . More... | |
String & | Replace (ConstIterator first, ConstIterator last, pointer first2, pointer last2) |
Replaces a range of chars [first;last) . More... | |
Iterator | begin (void) |
Returns the begin iterator of this string. More... | |
ConstIterator | begin (void) const |
Iterator | end (void) |
Returns the end iterator of this string. More... | |
ConstIterator | end (void) const |
void | ShrinkToFit (void) |
May reduce the capacity of this string to its size. | |
void | PushBack (CharType c) |
Appends the character c to this string. More... | |
void | PopBack (void) |
Removes the character at the end of this string. More... | |
Iterator | Begin (void) |
Returns the begin iterator of this string. More... | |
ConstIterator | Begin (void) const |
Iterator | End (void) |
Returns the end iterator of this string. More... | |
ConstIterator | End (void) const |
ReverseIterator | ReverseBegin (void) |
Returns the begin iterator of this string for reverse iterating. More... | |
ConstReverseIterator | ReverseBegin (void) const |
ReverseIterator | ReverseEnd (void) |
Returns the end iterator of this string for reverse iterating. More... | |
ConstReverseIterator | ReverseEnd (void) const |
ConstIterator | ConstBegin (void) const |
Returns the begin iterator of this const string. More... | |
ConstIterator | ConstEnd (void) const |
Returns the end iterator of this const string. More... | |
ConstReverseIterator | ConstReverseBegin (void) const |
Returns the begin iterator of this const string for reverse iterating. More... | |
ConstReverseIterator | ConstReverseEnd (void) const |
Returns the end iterator of this const string for reverse iterating. More... | |
Reference | Front (void) |
Returns a reference to the first character in the string. More... | |
ConstReference | Front (void) const |
Reference | Back (void) |
Returns a reference to the last character in the string. More... | |
ConstReference | Back (void) const |
Reference | At (size_type offset) |
Returns a const reference to the character at position offset . More... | |
ConstReference | At (size_type offset) const |
Returns a const reference to the character at position offset . More... | |
Reference | operator[] (size_type offset) |
Returns a reference to the character at position offset . More... | |
ConstReference | operator[] (size_type offset) const |
Returns a const reference to the character at position offset . More... | |
size_type | Length (void) const |
Returns the number of char elements in this string. More... | |
size_type | Size (void) const |
Returns the number of char elements in this string. More... | |
size_type | MaxSize (void) const |
Returns the number maximum size any string might have. | |
size_type | Capacity (void) const |
Returns the capacity of this string. More... | |
bool | IsEmpty (void) const |
Determines if this string is empty. More... | |
void | Resize (size_type newSize) |
Resizes this string to the specified new size. More... | |
void | Resize (size_type newSize, CharType c) |
Resizes this string to the specified new size. More... | |
void | Reserve (size_type newCapacity=0) |
Reserves memory up to the specified newCapacity . More... | |
void | Clear (void) |
Clears the content of this string, but does not modify the capacity. | |
size_type | Find (const String &pattern, size_type offset=0) const |
Finds the first substring which equal to pattern . More... | |
size_type | Find (const CharType *pChars, size_type offset, size_type count) const |
Finds the first substring which equal to pChars . More... | |
size_type | Find (const CharType *pChars, size_type offset=0) const |
Finds the first substring which equal to pChars . More... | |
size_type | Find (CharType c, size_type offset=0) const |
Finds the first char which equal to c . More... | |
size_type | ReverseFind (const String &pattern, size_type offset=NPos) const |
Finds the last substring which equal to pattern . More... | |
size_type | ReverseFind (const CharType *pChars, size_type offset, size_type count) const |
Finds the last substring which equal to pChars . More... | |
size_type | ReverseFind (const CharType *pChars, size_type offset=NPos) const |
Finds the last substring which equal to pChars . More... | |
size_type | ReverseFind (CharType c, size_type offset=NPos) const |
Finds the last char which equal to c . More... | |
size_type | FindFirstOf (const String &chars, size_type offset=0) const |
Finds the first occurrence of any character in chars . More... | |
size_type | FindFirstOf (const CharType *pChars, size_type offset, size_type count) const |
Finds the first occurrence of any character in pChars . More... | |
size_type | FindFirstOf (const CharType *pChars, size_type offset=0) const |
Finds the first occurrence of any character in pChars . More... | |
size_type | FindFirstOf (CharType c, size_type offset=0) const |
Finds the first occurrence of character c . More... | |
size_type | FindLastOf (const String &chars, size_type offset=NPos) const |
Finds the last occurrence of any character in chars . More... | |
size_type | FindLastOf (const CharType *pChars, size_type offset, size_type count) const |
Finds the last occurrence of any character in pChars . More... | |
size_type | FindLastOf (const CharType *pChars, size_type offset=NPos) const |
Finds the last occurrence of any character in pChars . More... | |
size_type | FindLastOf (CharType c, size_type offset=NPos) const |
Finds the last occurrence of character c . More... | |
size_type | FindFirstNotOf (const String &chars, size_type offset=0) const |
Finds the first occurrence of any character which is not in chars . More... | |
size_type | FindFirstNotOf (const CharType *pChars, size_type offset, size_type count) const |
Finds the first occurrence of any character which is not in pChars . More... | |
size_type | FindFirstNotOf (const CharType *pChars, size_type offset=0) const |
Finds the first occurrence of any character which is not in pChars . More... | |
size_type | FindFirstNotOf (CharType c, size_type offset=0) const |
Finds the first occurrence of any character which is not equal to c . More... | |
size_type | FindLastNotOf (const String &chars, size_type offset=NPos) const |
Finds the last occurrence of any character which is not in chars . More... | |
size_type | FindLastNotOf (const CharType *pChars, size_type offset, size_type count) const |
Finds the last occurrence of any character which is not in pChars . More... | |
size_type | FindLastNotOf (const CharType *pChars, size_type offset=NPos) const |
Finds the last occurrence of any character which is not in pChars . More... | |
size_type | FindLastNotOf (CharType c, size_type offset=NPos) const |
Finds the last occurrence of any character which is not equal to c . More... | |
bool | StartsWith (const CharType *pChars) const |
Determines if this string starts with the pChars C-string. More... | |
bool | StartsWith (const String &pattern) const |
Determines if this string starts with the pattern string. More... | |
bool | EndsWith (const CharType *pChars) const |
Determines if this string ends with the pChars C-string. More... | |
bool | EndsWith (const String &pattern) const |
Determines if this string starts with the pattern string. More... | |
int | Compare (const String &other) const |
Compares this string to the other string lexicographical. More... | |
int | Compare (size_type offset, size_type count, const String &other) const |
Compares this string to the other string lexicographical. More... | |
int | Compare (size_type offset, size_type count, const String &other, size_type offsetOther, size_type countOther=NPos) const |
Compares a substring of this string to a substring of the other string lexicographical. More... | |
int | Compare (const CharType *pOther) const |
Compares this string to the pOther string lexicographical. More... | |
int | Compare (size_type offset, size_type count, const CharType *pOther) const |
Compares this string to the pOther string lexicographical. More... | |
int | Compare (size_type offset, size_type count, const CharType *pOther, size_type countOther) const |
Compares a substring of this string to a substring of the pOther string lexicographical. More... | |
Allocator | GetAllocator (void) const |
Gets the allocator of this string. More... | |
const CharType * | CStr (void) const |
Gets the character data of this string. More... | |
String | Substr (size_type offset=0, size_type count=NPos) const |
Gets a substring of this string. More... | |
void | Swap (String &other) |
Swaps the content of this string with the content of the other string. More... | |
Bytes | ToBytes (void) const |
Copies this string to a byte array. More... | |
String & | ReplaceAll (const String &pattern, const String &replacement) |
Replaces a given pattern by a replacement string. More... | |
const StdString & | GetStdString (void) const |
Gets the std::string of this string. More... | |
StdString & | GetStdString (void) |
String | TrimLeft (void) const |
Removes all whites spaces at the begin of the string. More... | |
String | TrimLeft (CharType trim) const |
Removes all characters specified by trim at the begin of the string. More... | |
String | TrimRight (void) const |
Removes all whites spaces at the end of the string. More... | |
String | TrimRight (CharType trim) const |
Removes all characters specified by trim at the end of the string. More... | |
String | Trim (void) const |
Removes all whites spaces from at the begin and end of the string. More... | |
String | Trim (CharType trim) const |
Removes all characters specified by trim at the begin and the end of the string. More... | |
Tokens | Split (CharType delimiter, bool trimTokens=true, bool removeEmptyTokens=true) const |
Splits this string into tokens using the specified delimiter characters (multiple). More... | |
Tokens | Split (std::span< const CharType > delimiters, bool trimTokens=true, bool removeEmptyTokens=true) const |
Splits this string into tokens using the specified delimiter characters (multiple). More... | |
Tokens | SplitByWord (const String &delimiter, bool trimTokens=true, bool removeEmptyTokens=true) const |
Splits this string into tokens using the specified (single) delimiter string. More... | |
const StdString & | GetBaseString (void) const |
DEPRECATED More... | |
bool | StartWith (const CharType *pChars) const |
Determines if this string starts with the pChars C-string. More... | |
bool | StartWith (const String &pattern) const |
Determines if this string starts with the pattern string. More... | |
bool | EndWith (const CharType *pChars) const |
Determines if this string ends with the pChars C-string. More... | |
bool | EndWith (const String &pattern) const |
Determines if this string starts with the pattern string. More... | |
Static Public Member Functions | |
template<typename... Args> | |
static String | Format (const String &format, const Args &... args) |
Formats the format string using the .NET/Python syntax with the given variadic arguments. More... | |
template<typename... Args> | |
static String | Format (const char *format, const Args &... args) |
Formats the format C-string using the .NET/Python syntax with the given variadic arguments. More... | |
template<typename... Args> | |
static String | FormatPrintf (const char *format, const Args &... args) |
Formats the format C-string using the printf syntax with the given variadic arguments. More... | |
Static Public Attributes | |
static const size_type | NPos = size_type(-1) |
static const String | Empty |
static const String | NewLine |
Friends | |
ARP_STRING_EXPORT_DECL String | operator+ (const String &left, const String &right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (const String &left, const String::CharType *right) |
Concatenates the right C-string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (const String &left, String::CharType right) |
Concatenates the right character to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (const String::CharType *left, const String &right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String::CharType left, const String &right) |
Concatenates the right string to the left character. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String &&left, String &&right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String &&left, const String &right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String &&left, const String::CharType *right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String &&left, String::CharType right) |
Concatenates the right character to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (const String &left, String &&right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (const String::CharType *left, String &&right) |
Concatenates the right string to the left string. More... | |
ARP_STRING_EXPORT_DECL String | operator+ (String::CharType left, String &&right) |
Concatenates the right string to the left character. More... | |
This class represents the Arp String. The implementation is based on std::string
.
All std::string
operations are implemented using Pascal casing. Furthermore, the functionality was extended by several operations:
|
default |
The copy constructor copies the as argument passed string deeply.
arg | The argument to copy. |
|
defaultnoexcept |
This move constructor moves the as argument passed string to this string.
arg | The argument to move. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | const BaseString & | arg | ) |
This constructor copies the as argument passed string.
arg | The argument to copy. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | BaseString && | arg | ) |
This constructor moves the as argument passed string.
arg | The argument to move. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | const StdString & | arg | ) |
This constructor copies the as argument passed string.
arg | The argument to copy. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | StdString && | arg | ) |
This constructor moves the as argument passed string.
arg | The argument to move. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | const String & | arg, |
size_type | offset, | ||
size_type | count = NPos |
||
) |
This constructor copies the as argument passed string partially.
arg | The argument to copy partially. |
offset | The offset of arg to copy the chars from. |
count | The number of chars to copy from arg . |
This constructor copies the as argument passed C-string.
pChars | The C-string to copy. |
count | The number of chars to copy from pChars . |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | const CharType * | pChars | ) |
This constructor copies the as argument passed C-string.
pChars | The C-string to copy. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | const Char8uType * | pChars | ) |
This constructor copies the as argument passed C-string.
pChars | The UTF8 string to copy. |
Fills the string with count consecutive copies of character c .
count | The number of chars to fill this string with. |
c | The char used to fill this string. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | std::initializer_list< CharType > | arg | ) |
Copies each of the characters in initList , in the same order.
arg | The initializer list of chars to copy. |
Copies the sequence of characters in the range [first,last)
, in the same order..
first | The begin iterator specifying the range of chars to copy. |
last | The end iterator specifying the range of chars to copy. |
ARP_STRING_INLINE Arp::Base::Core::String::String | ( | ConstIterator | first, |
ConstIterator | last | ||
) |
Copies the sequence of characters in the range [first,last)
, in the same order..
first | The begin Iterator specifying the range of chars to copy. |
last | The end iterator specifying the range of chars to copy. |
|
explicit |
Copies the as arguments passed bytes to this string.
bytes | The bytes to copy to this string. |
This operation appends the as argument passed C-string.
pChars | The argument to append. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Append | ( | const CharType * | pChars, |
size_type | count | ||
) |
This operation appends the as argument passed C-string partially.
pChars | The argument to append partially. |
count | The number of chars to append from pChars . |
This operation appends the argument to this string.
arg | The argument to append. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Append | ( | const String & | arg, |
size_type | offset, | ||
size_type | count = NPos |
||
) |
This operation appends the as argument passed string partially.
arg | The argument to append partially. |
offset | The offset of arg to append the chars from. |
count | The number of chars to append from arg . |
ARP_STRING_INLINE String & Arp::Base::Core::String::Append | ( | const_pointer | first, |
const_pointer | last | ||
) |
Appends the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to append. |
last | The end iterator specifying the range of chars to append. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Append | ( | ConstIterator | first, |
ConstIterator | last | ||
) |
Appends the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to append. |
last | The end iterator specifying the range of chars to append. |
Appends the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to append. |
last | The end iterator specifying the range of chars to append. |
Appends to this string count consecutive copies of character c .
count | The number of chars to append to this string. |
c | The char used to append this string. |
This operation appends each of the characters in the argument to this string, in the same order.
arg | The initializer list of chars to append. |
This operation copies the as argument passed C-string.
pChars | The argument to copy. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Assign | ( | const CharType * | pChars, |
size_type | count | ||
) |
This operation copies the as argument passed C-string partially.
pChars | The argument to copy partially. |
count | The number of chars to copy from pChars . |
This operation copies the argument to this string.
arg | The argument to copy. |
This operation copies the argument to this string.
arg | The argument to copy. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Assign | ( | const String & | arg, |
size_type | offset, | ||
size_type | count = NPos |
||
) |
This operation copies the as argument passed string partially.
arg | The argument to copy partially. |
offset | The offset of arg to copy the chars from. |
count | The number of chars to copy from arg . |
ARP_STRING_INLINE String & Arp::Base::Core::String::Assign | ( | const_pointer | first, |
const_pointer | last | ||
) |
Copies the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to copy. |
last | The end iterator specifying the range of chars to copy. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Assign | ( | ConstIterator | first, |
ConstIterator | last | ||
) |
Copies the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to copy. |
last | The end iterator specifying the range of chars to copy. |
Copies the sequence of characters in the range [first,last)
, in the same order.
first | The begin iterator specifying the range of chars to copy. |
last | The end iterator specifying the range of chars to copy. |
Fills this string with count consecutive copies of character c .
count | The number of chars to fill this string with. |
c | The char used to fill this string. |
This operation copies each of the characters in the argument to this string, in the same order.
arg | The initializer list of chars to copy. |
This operation moves the argument to this string.
arg | The argument to move. |
This operation moves the as argument passed string to this string.
arg | The right-hand-side argument to move. |
ARP_STRING_INLINE String::Reference Arp::Base::Core::String::At | ( | size_type | offset | ) |
Returns a const reference to the character at position offset .
offset | The index of the character to refer. |
std::out_of_range | If offset is out of range. |
ARP_STRING_INLINE String::ConstReference Arp::Base::Core::String::At | ( | size_type | offset | ) | const |
Returns a const reference to the character at position offset .
offset | The index of the character to refer. |
std::out_of_range | If offset is out of range. |
ARP_STRING_INLINE String::ConstReference Arp::Base::Core::String::Back | ( | void | ) |
Returns a reference to the last character in the string.
Returns a const reference to the last character in the string.
The behavior is undefined if this string is empty.
The behavior is undefined if this string is empty.
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::begin | ( | void | ) |
Returns the begin iterator of this string.
This implementation is intended to support range base for loops and is required by C++ compilers. Do not use this operation directly.
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::Begin | ( | void | ) |
Returns the begin iterator of this string.
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Capacity | ( | void | ) | const |
Returns the capacity of this string.
The capacity of a string might differ from its size, because the string class acts like any other container class. If it is desired that a the capacity of string should be reduced to its size, call ShrinkToFit operation.
Use ShrinkToFit operation to reduce the capacity of a string to its size.
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | const CharType * | pOther | ) | const |
Compares this string to the pOther string lexicographical.
pOther | The other C-string to compare this string to. |
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | const String & | other | ) | const |
Compares this string to the other string lexicographical.
other | The other string to compare this string to. |
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | size_type | offset, |
size_type | count, | ||
const CharType * | pOther | ||
) | const |
Compares this string to the pOther string lexicographical.
pOther | The other C-string to compare this string to. |
offset | The position of the first character in this string to compare. |
count | The number of characters of this string to compare. |
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | size_type | offset, |
size_type | count, | ||
const CharType * | pOther, | ||
size_type | countOther | ||
) | const |
Compares a substring of this string to a substring of the pOther string lexicographical.
pOther | The other C-string to compare this string to. |
offset | The position of the first character in this string to compare. |
count | The number of characters of this string to compare. |
countOther | The number of characters of the other string to compare. |
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | size_type | offset, |
size_type | count, | ||
const String & | other | ||
) | const |
Compares this string to the other string lexicographical.
other | The other string to compare this string to. |
offset | The position of the first character in this string to compare. |
count | The number of characters of this string to compare. |
ARP_STRING_INLINE int Arp::Base::Core::String::Compare | ( | size_type | offset, |
size_type | count, | ||
const String & | other, | ||
size_type | offsetOther, | ||
size_type | countOther = NPos |
||
) | const |
Compares a substring of this string to a substring of the other string lexicographical.
other | The other string to compare this string to. |
offset | The position of the first character in this string to compare. |
count | The number of characters of this string to compare. |
offsetOther | The position of the first character in the other string to compare. |
countOther | The number of characters of the other string to compare. |
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::ConstBegin | ( | void | ) | const |
Returns the begin iterator of this const string.
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::ConstEnd | ( | void | ) | const |
Returns the end iterator of this const string.
ARP_STRING_INLINE String::ConstReverseIterator Arp::Base::Core::String::ConstReverseBegin | ( | void | ) | const |
Returns the begin iterator of this const string for reverse iterating.
ARP_STRING_INLINE String::ConstReverseIterator Arp::Base::Core::String::ConstReverseEnd | ( | void | ) | const |
Returns the end iterator of this const string for reverse iterating.
ARP_STRING_INLINE const String::CharType * Arp::Base::Core::String::CStr | ( | void | ) | const |
Gets the character data of this string.
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::end | ( | void | ) |
Returns the end iterator of this string.
This implementation is intended to support range base for loops and is required by C++ compilers. Do not use this operation directly.
ARP_STRING_INLINE String::ConstIterator Arp::Base::Core::String::End | ( | void | ) |
Returns the end iterator of this string.
ARP_STRING_INLINE bool Arp::Base::Core::String::EndsWith | ( | const CharType * | pChars | ) | const |
Determines if this string ends with the pChars C-string.
pChars | The C-string to compare this string to. |
true
if this string ends with the pChars C-string, otherwise false
.ARP_STRING_INLINE bool Arp::Base::Core::String::EndsWith | ( | const String & | pattern | ) | const |
Determines if this string starts with the pattern string.
pattern | The string to compare this string to. |
true
if this string starts with the pattern string, otherwise false
.bool Arp::Base::Core::String::EndWith | ( | const CharType * | pChars | ) | const |
Determines if this string ends with the pChars C-string.
pChars | The C-string to compare this string to. |
true
if this string ends with the pChars C-string, otherwise false
.bool Arp::Base::Core::String::EndWith | ( | const String & | pattern | ) | const |
Determines if this string starts with the pattern string.
pattern | The string to compare this string to. |
true
if this string starts with the pattern string, otherwise false
.ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Erase | ( | ConstIterator | first, |
ConstIterator | last | ||
) |
Erases a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to insert. |
last | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Erase | ( | ConstIterator | where | ) |
This operation erases chars from this string.
where | The start position from where the chars are erased. If this is the begin iterator the entire string is cleared. |
This operation erases chars from this string.
offset | The start position from where the chars are erased. |
count | The number of chars to erase. |
This operation erases chars from this string.
offset | The start position from where the chars are erased. If this is 0 the entire string is cleared. |
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Find | ( | CharType | c, |
size_type | offset = 0 |
||
) | const |
Finds the first char which equal to c .
c | The char to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Find | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the first substring which equal to pChars .
pChars | The C-string to search for. |
offset | The position at which to start the search. |
count | The length of the substring to search for. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Find | ( | const CharType * | pChars, |
size_type | offset = 0 |
||
) | const |
Finds the first substring which equal to pChars .
pChars | The C-string to search for. |
offset | The position at which to start the search. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Find | ( | const String & | pattern, |
size_type | offset = 0 |
||
) | const |
Finds the first substring which equal to pattern .
pattern | The pattern to search for. |
offset | The position at which to start the search. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstNotOf | ( | CharType | c, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of any character which is not equal to c .
c | The character not to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.This operation is equivalent to the corresponding Find operation
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstNotOf | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the first occurrence of any character which is not in pChars .
pChars | The characters not to search for. |
offset | The position at which to start the search. |
count | The length of the C-string identifying characters to search for. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstNotOf | ( | const CharType * | pChars, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of any character which is not in pChars .
pChars | The characters not to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstNotOf | ( | const String & | chars, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of any character which is not in chars .
chars | The characters not to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstOf | ( | CharType | c, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of character c .
c | The character to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.This operation is equivalent to the corresponding Find operation
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstOf | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the first occurrence of any character in pChars .
pChars | The characters to search for. |
offset | The position at which to start the search. |
count | The length of the C-string identifying characters to search for. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstOf | ( | const CharType * | pChars, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of any character in pChars .
pChars | The characters to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindFirstOf | ( | const String & | chars, |
size_type | offset = 0 |
||
) | const |
Finds the first occurrence of any character in chars .
chars | The characters to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastNotOf | ( | CharType | c, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of any character which is not equal to c .
c | The character not to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.This operation is equivalent to the corresponding Find operation
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastNotOf | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the last occurrence of any character which is not in pChars .
pChars | The characters not to search for. |
offset | The position at which to start the search. |
count | The length of the C-string identifying characters to search for. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastNotOf | ( | const CharType * | pChars, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of any character which is not in pChars .
pChars | The characters not to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastNotOf | ( | const String & | chars, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of any character which is not in chars .
chars | The characters not to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastOf | ( | CharType | c, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of character c .
c | The character to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.This operation is equivalent to the corresponding ReverseFind operation.
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastOf | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the last occurrence of any character in pChars .
pChars | The characters to search for. |
offset | The position at which to start the search. |
count | The length of the C-string identifying characters to search for. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastOf | ( | const CharType * | pChars, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of any character in pChars .
pChars | The characters to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::FindLastOf | ( | const String & | chars, |
size_type | offset = NPos |
||
) | const |
Finds the last occurrence of any character in chars .
chars | The characters to search for. |
offset | The position at which to start the search. |
NPos
if none of the chars could not be found.
|
inlinestatic |
Formats the format C-string using the .NET/Python syntax with the given variadic arguments.
format | The C-string to format using .NET/Python syntax for placeholders like {} , {1} or {2} . |
args | The variadic arguments to format into the format string. |
|
inlinestatic |
Formats the format string using the .NET/Python syntax with the given variadic arguments.
format | The string to format using .NET/Python syntax for placeholders like {} , {1} or {2} . |
args | The variadic arguments to format into the format string. |
|
inlinestatic |
Formats the format C-string using the printf
syntax with the given variadic arguments.
format | The C-string to formating printf syntax for placeholders like d , f or i . |
args | The variadic arguments to format into the format string. |
ARP_STRING_INLINE String::ConstReference Arp::Base::Core::String::Front | ( | void | ) |
Returns a reference to the first character in the string.
Returns a const reference to the first character in the string.
The behavior is undefined if this string is empty.
The behavior is undefined if this string is empty.
ARP_STRING_INLINE String::Allocator Arp::Base::Core::String::GetAllocator | ( | void | ) | const |
Gets the allocator of this string.
ARP_STRING_INLINE const String::StdString & Arp::Base::Core::String::GetBaseString | ( | void | ) | const |
DEPRECATED
Use String::GetImpl()
instead.
ARP_STRING_INLINE String::StdString & Arp::Base::Core::String::GetStdString | ( | void | ) | const |
Gets the std::string
of this string.
std::string
.ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
CharType | c | ||
) |
Inserts character c at position where .
where | The position where to insert the char. |
c | The char to insert into this string. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
const_pointer | first, | ||
const_pointer | last | ||
) |
Inserts a range of chars [first;last)
at position where .
where | The position where to insert the char. |
first | The begin iterator specifying the range of chars to insert. |
last | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
ConstIterator | first, | ||
ConstIterator | last | ||
) |
Inserts a range of chars [first;last)
at position where .
where | The position where to insert the char. |
first | The begin iterator specifying the range of chars to insert. |
last | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
Iterator | first, | ||
Iterator | last | ||
) |
Inserts a range of chars [first;last)
at position where .
where | The position where to insert the char. |
first | The begin iterator specifying the range of chars to insert. |
last | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
size_type | count, | ||
CharType | c | ||
) |
Inserts character c at position where .
where | The position where to insert the char. |
count | The number of chars to insert. |
c | The char used to insert into this string. |
ARP_STRING_INLINE String::Iterator Arp::Base::Core::String::Insert | ( | ConstIterator | where, |
std::initializer_list< CharType > | chars | ||
) |
This operation inserts each of the characters in the argument to this string, in the same order.
where | The position to insert the character at. |
chars | The initializer list of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Insert | ( | size_type | offset, |
const CharType * | pChars | ||
) |
This operation inserts the as argument passed string.
offset | The start position where to insert the chars. |
pChars | The C-string to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Insert | ( | size_type | offset, |
const CharType * | pChars, | ||
size_type | count | ||
) |
This operation inserts the as argument passed string partially.
offset | The start position where to insert the chars. |
pChars | The C-string to insert partially. |
count | The number of chars to insert from pChars . |
This operation inserts the argument at the given position.
arg | The argument to insert. |
offset | The position to insert argument at. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Insert | ( | size_type | offset, |
const String & | arg, | ||
size_type | argOffset, | ||
size_type | count = NPos |
||
) |
This operation inserts the as argument passed string partially.
offset | The start position where to insert the chars. |
arg | The argument to insert partially. |
argOffset | The offset of arg to insert the chars from. |
count | The number of chars to insert from arg . |
ARP_STRING_INLINE String & Arp::Base::Core::String::Insert | ( | size_type | offset, |
size_type | count, | ||
CharType | c | ||
) |
Inserts count consecutive copies of character c at position offset .
offset | The start position where to insert the chars. |
count | The number of chars to insert. |
c | The char used to insert into this string. |
ARP_STRING_INLINE bool Arp::Base::Core::String::IsEmpty | ( | void | ) | const |
Determines if this string is empty.
true
if this string is empty, otherwise false
.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Length | ( | void | ) | const |
Returns the number of char elements in this string.
This operation does not count the null terminator. Furthermore it does not return the number of characters for other encodings than ASCII encoding. E.g. if the encoding is UTF8, the number of characters might differs from the length or size of the string.
Returns the same value than the Size operation.
ARP_STRING_INLINE Arp::Base::Core::String::operator const String::CharType * | ( | void | ) | const |
Converts this string implicitly to a C-string.
ARP_STRING_INLINE Arp::Base::Core::String::operator const String::StdString & | ( | void | ) | const |
Converts this string implicitly to a std string.
This assignment operator appends the right-hand-side operand to this string.
c | The character to append. |
This assignment operator appends the right-hand-side operand to this string.
right | The argument to append. |
This assignment operator appends the right-hand-side operand to this string.
right | The argument to append. |
ARP_STRING_INLINE String & Arp::Base::Core::String::operator+= | ( | std::initializer_list< CharType > | right | ) |
This assignment operator appends each of the characters in the right-hand-side operand to this string, in the same order.
right | The initializer list of chars to append. |
This assignment operator copies the right-hand-side operand to this string.
c | The character to copy. |
This assignment operator copies the right-hand-side operand to this string.
right | The argument to copy. |
This assignment operator copies the right-hand-side operand to this string.
arg | The argument to copy. |
ARP_STRING_INLINE String & Arp::Base::Core::String::operator= | ( | std::initializer_list< CharType > | right | ) |
This assignment operator copies each of the characters in the right-hand-side operand to this string, in the same order.
right | The initializer list of chars to copy. |
This move assignment operator moves the right-hand-side operand to this string.
arg | The argument to move. |
ARP_STRING_INLINE String::Reference Arp::Base::Core::String::operator[] | ( | size_type | offset | ) |
Returns a reference to the character at position offset .
offset | The index of the character to refer. |
The behavior is undefined offset is out of range.
ARP_STRING_INLINE String::ConstReference Arp::Base::Core::String::operator[] | ( | size_type | offset | ) | const |
Returns a const reference to the character at position offset .
offset | The index of the character to refer. |
The behavior is undefined offset is out of range.
ARP_STRING_INLINE void Arp::Base::Core::String::PopBack | ( | void | ) |
Removes the character at the end of this string.
if this string is empty, the operation has no effect.
ARP_STRING_INLINE void Arp::Base::Core::String::PushBack | ( | CharType | c | ) |
Appends the character c to this string.
c | The char to append to this string. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
const CharType * | pChars | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
pChars | The C-string to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
const CharType * | pChars, | ||
size_type | count | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
pChars | The C-string to insert. |
count | The number of chars of pChars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
const String & | arg | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
arg | The string to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
const_pointer | first2, | ||
const_pointer | last2 | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
first2 | The begin pointer specifying the range of chars to insert. |
last2 | The end pointer specifying the range of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
ConstIterator | first2, | ||
ConstIterator | last2 | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
first2 | The begin iterator specifying the range of chars to insert. |
last2 | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
Iterator | first2, | ||
Iterator | last2 | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
first2 | The begin iterator specifying the range of chars to insert. |
last2 | The end iterator specifying the range of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
pointer | first2, | ||
pointer | last2 | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
first2 | The begin pointer specifying the range of chars to insert. |
last2 | The end pointer specifying the range of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
size_type | count, | ||
CharType | c | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
count | The number of characters c to insert. |
c | The character to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | ConstIterator | first, |
ConstIterator | last, | ||
std::initializer_list< CharType > | chars | ||
) |
Replaces a range of chars [first;last)
.
first | The begin iterator specifying the range of chars to replace. |
last | The end iterator specifying the range of chars to replace. |
chars | The list of chars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | size_type | offset, |
size_type | length, | ||
const CharType * | pChars | ||
) |
Replaces a range of chars.
offset | The start position of the chars to replace. |
length | The number of chars to replace. |
pChars | The C-string to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | size_type | offset, |
size_type | length, | ||
const CharType * | pChars, | ||
size_type | count | ||
) |
Replaces a range of chars.
offset | The start position of the chars to replace. |
length | The number of chars to replace. |
pChars | The C-string to insert partially. |
count | The number of chars of pChars to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | size_type | offset, |
size_type | length, | ||
const String & | arg | ||
) |
Replaces a range of chars.
offset | The start position of the chars to replace. |
length | The number of chars to replace. |
arg | The string to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | size_type | offset, |
size_type | length, | ||
const String & | arg, | ||
size_type | offsetArg, | ||
size_type | count = NPos |
||
) |
Replaces a range of chars.
offset | The start position of the chars to replace. |
length | The number of chars to replace. |
arg | The string to insert partially. |
offsetArg | The start position of the chars of the string to insert. |
count | The number of chars of arg to insert. |
ARP_STRING_INLINE String & Arp::Base::Core::String::Replace | ( | size_type | offset, |
size_type | length, | ||
size_type | count, | ||
CharType | c | ||
) |
Replaces a range of chars by a character.
offset | The start position of the chars to replace. |
length | The number of chars to replace. |
count | The number of chars c to insert. |
c | The character to insert count times. |
Replaces a given pattern by a replacement string.
pattern | The pattern to search for replacing. |
replacement | The replacement string for all matches. |
This is an extension to the C++ standard operations
ARP_STRING_INLINE void Arp::Base::Core::String::Reserve | ( | size_type | newCapacity = 0 | ) |
Reserves memory up to the specified newCapacity .
newCapacity | The new capacity of this string. |
If the actual capacity is less than newCapacity than the internal storage is reallocated to fit the new capacity. If the actual capacity is greater than newCapacity and greater than the current size, this is a non-binding shrink request. If the actual capacity is greater than newCapacity and less than the current size, this is a non-binding shrink-to-fit request.
ARP_STRING_INLINE void Arp::Base::Core::String::Resize | ( | size_type | newSize | ) |
Resizes this string to the specified new size.
newSize | The new size of this string. |
If the actual size is less than newSize than zero'ed characters are appended. If the actual size is greater than newSize than the size of the string is shrinked to the new size.
Resizes this string to the specified new size.
newSize | The new size of this string. |
c | The character to use for initializing added chars. |
If the actual size is less than newSize than the new characters are appended and initialized to c . If the actual size is greater than newSize than the size of the string is shrinked to the new size.
ARP_STRING_INLINE String::ConstReverseIterator Arp::Base::Core::String::ReverseBegin | ( | void | ) |
Returns the begin iterator of this string for reverse iterating.
ARP_STRING_INLINE String::ConstReverseIterator Arp::Base::Core::String::ReverseEnd | ( | void | ) |
Returns the end iterator of this string for reverse iterating.
ARP_STRING_INLINE String::size_type Arp::Base::Core::String::ReverseFind | ( | CharType | c, |
size_type | offset = NPos |
||
) | const |
Finds the last char which equal to c .
c | The char to search for. |
offset | The position at which to start the search. |
NPos
if the char could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::ReverseFind | ( | const CharType * | pChars, |
size_type | offset, | ||
size_type | count | ||
) | const |
Finds the last substring which equal to pChars .
pChars | The C-string to search for. |
offset | The position at which to start the search. |
count | The length of the substring to search for. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::ReverseFind | ( | const CharType * | pChars, |
size_type | offset = NPos |
||
) | const |
Finds the last substring which equal to pChars .
pChars | The C-string to search for. |
offset | The position at which to start the search. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::ReverseFind | ( | const String & | pattern, |
size_type | offset = NPos |
||
) | const |
Finds the last substring which equal to pattern .
pattern | The pattern to search for. |
offset | The position at which to start the search. |
NPos
if the substring could not be found.ARP_STRING_INLINE String::size_type Arp::Base::Core::String::Size | ( | void | ) | const |
Returns the number of char elements in this string.
This operation does not count the null terminator. Furthermore it does not return the number of characters for other encodings than ASCII encoding. E.g. if the encoding is UTF8, the number of characters might differs from the length or size of the string.
Returns the same value than the Length operation.
String::Tokens Arp::Base::Core::String::Split | ( | CharType | delimiter, |
bool | trimTokens = true , |
||
bool | removeEmptyTokens = true |
||
) | const |
Splits this string into tokens using the specified delimiter characters (multiple).
delimiter | The delimiter character to search for when splitting this string. |
trimTokens | If set to true , the resulting tokens are trimmed from white-spaces. |
removeEmptyTokens | If set to true , the empty tokens are omitted. |
String::Tokens Arp::Base::Core::String::Split | ( | std::span< const CharType > | delimiters, |
bool | trimTokens = true , |
||
bool | removeEmptyTokens = true |
||
) | const |
Splits this string into tokens using the specified delimiter characters (multiple).
delimiters | The delimiters to search for when splitting this string. |
trimTokens | If set to true , the resulting tokens are trimmed from white-spaces. |
removeEmptyTokens | If set to true , the empty tokens are omitted. |
String::Tokens Arp::Base::Core::String::SplitByWord | ( | const String & | delimiter, |
bool | trimTokens = true , |
||
bool | removeEmptyTokens = true |
||
) | const |
Splits this string into tokens using the specified (single) delimiter string.
delimiter | The (single) delimiter string to search for when splitting this string. |
trimTokens | If set to true , the resulting tokens are trimmed from white-spaces. |
removeEmptyTokens | If set to true , the empty tokens are omitted. |
ARP_STRING_INLINE bool Arp::Base::Core::String::StartsWith | ( | const CharType * | pChars | ) | const |
Determines if this string starts with the pChars C-string.
pChars | The C-string to compare this string to. |
true
if this string starts with the pChars C-string, otherwise false
.ARP_STRING_INLINE bool Arp::Base::Core::String::StartsWith | ( | const String & | pattern | ) | const |
Determines if this string starts with the pattern string.
pattern | The string to compare this string to. |
true
if this string starts with the pattern string, otherwise false
.bool Arp::Base::Core::String::StartWith | ( | const CharType * | pChars | ) | const |
Determines if this string starts with the pChars C-string.
pChars | The C-string to compare this string to. |
true
if this string starts with the pChars C-string, otherwise false
.bool Arp::Base::Core::String::StartWith | ( | const String & | pattern | ) | const |
Determines if this string starts with the pattern string.
pattern | The string to compare this string to. |
true
if this string starts with the pattern string, otherwise false
.ARP_STRING_INLINE String Arp::Base::Core::String::Substr | ( | size_type | offset = 0 , |
size_type | count = NPos |
||
) | const |
Gets a substring of this string.
offset | The position of the first character in this string to return as substring. |
count | The number of characters of this string to return as substring. |
ARP_STRING_INLINE void Arp::Base::Core::String::Swap | ( | String & | other | ) |
Swaps the content of this string with the content of the other string.
other | The position of the first character in this string to return as substring. |
String::Bytes Arp::Base::Core::String::ToBytes | ( | void | ) | const |
Copies this string to a byte array.
Removes all characters specified by trim at the begin and the end of the string.
trim | The char to remove. |
String Arp::Base::Core::String::Trim | ( | void | ) | const |
Removes all whites spaces from at the begin and end of the string.
Removes all characters specified by trim at the begin of the string.
trim | The char to remove. |
String Arp::Base::Core::String::TrimLeft | ( | void | ) | const |
Removes all whites spaces at the begin of the string.
Removes all characters specified by trim at the end of the string.
trim | The char to remove. |
String Arp::Base::Core::String::TrimRight | ( | void | ) | const |
Removes all whites spaces at the end of the string.
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
|
friend |
Concatenates the right C-string to the left string.
left | The string to append the right C-string to. |
right | The C-string to append to the left string. |
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
|
friend |
Concatenates the right character to the left string.
left | The string to append the right character to. |
right | The character to append to the left string. |
|
friend |
Concatenates the right string to the left string.
left | The C-string to append the right string to. |
right | The string to append to the left C-string. |
|
friend |
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
|
friend |
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
Concatenates the right string to the left string.
left | The string to append the right string to. |
right | The string to append to the left string. |
|
friend |
Concatenates the right character to the left string.
left | The string to append the right character to. |
right | The character to append to the left string. |
|
friend |
Concatenates the right string to the left character.
left | The character to append the right string to. |
right | The string to append to the left character. |
|
friend |
Concatenates the right string to the left character.
left | The character to append the right string to. |
right | The string to append to the left character. |