String class used across the library. Is a substitute for C# System.String when translating code. For optimization reasons, isn't considered an Object subclass. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type. More...
Public Types | |
using | reverse_iterator = std::reverse_iterator< const char16_t * > |
Reverse iterator type. More... | |
Public Member Functions | |
ASPOSECPP_SHARED_API | String () |
Default constructor. Creates string object which is considered null. More... | |
template<typename T > | |
String (T &value, typename std::enable_if< IsStringLiteral< T, char16_t >::value >::type *=nullptr) | |
Constructs string based on string literal. Considers literal a null-terminated string, calculates target string length based on literal size. More... | |
template<typename T > | |
String (const T &value, typename std::enable_if< IsStringPointer< T, char16_t >::value >::type *=nullptr) | |
Constructs string based on character string pointer. Treats pointed string as null-terminated, calculates target string length based on null character. More... | |
template<typename T > | |
String (T &value, typename std::enable_if< IsStringLiteral< T, char >::value >::type *=nullptr) | |
Constructs string based on string literal. Considers literal a null-terminated string in UTF8, calculates target string length based on literal size. More... | |
template<typename T > | |
String (const T &value, typename std::enable_if< IsStringPointer< T, char >::value >::type *=nullptr) | |
Constructs string based on character string pointer. Treats pointed string as null-terminated in UTF8, calculates target string length based on null character. More... | |
ASPOSECPP_SHARED_API | String (const char16_t *str, int length) |
Constructs string from character string pointer and explicit length. More... | |
ASPOSECPP_SHARED_API | String (const char *str, int length) |
Constructs string from character string pointer and explicit length. More... | |
ASPOSECPP_SHARED_API | String (const char16_t *str, int start, int length) |
Constructs string from character string pointer from starting position using length. More... | |
ASPOSECPP_SHARED_API | String (const char16_t ch, int count) |
Fill constructor. More... | |
template<typename T > | |
String (const T &value, typename std::enable_if< std::is_same< T, std::nullptr_t >::value >::type *=nullptr) | |
Nullptr constructor. Declared as template to resolve priorities with other template constructors. More... | |
template<typename T > | |
String (T &value, typename std::enable_if< IsStringLiteral< T, wchar_t >::value >::type *=nullptr) | |
Constructs string based on widestring literal. Considers literal a null-terminated string, calculates target string length based on literal size. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed. More... | |
template<typename T > | |
String (const T &value, typename std::enable_if< IsStringPointer< T, wchar_t >::value >::type *=nullptr) | |
Constructs string based on widecharacter string pointer. Treats pointed string as null-terminated, calculates target string length based on null character. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed. More... | |
ASPOSECPP_SHARED_API | String (const wchar_t *str, int length) |
Constructs string from widecharacter string pointer and explicit length. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed. More... | |
ASPOSECPP_SHARED_API | String (const wchar_t ch, int count=1) |
Fill constructor. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed. More... | |
ASPOSECPP_SHARED_API | String (const String &str) |
Copy constructor. More... | |
ASPOSECPP_SHARED_API | String (String &&str) noexcept |
Move constructor. More... | |
ASPOSECPP_SHARED_API | String (const ArrayPtr< char16_t > &arr) |
Converts whole character array to string. More... | |
ASPOSECPP_SHARED_API | String (const ArrayPtr< char16_t > &arr, int offset, int len) |
Converts character array subrange to string. If parameters are out of array bounds, empty string is constructed. More... | |
ASPOSECPP_SHARED_API | ~String () |
Destructor. More... | |
ASPOSECPP_SHARED_API const UChar * | u_str () const |
Returns ICU-styled null-terminated buffer. May reallocate the string. More... | |
ASPOSECPP_SHARED_API const UChar * | begin () const |
Returns pointer to the beginning of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated. More... | |
ASPOSECPP_SHARED_API const UChar * | end () const |
Returns pointer to the end of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated. More... | |
ASPOSECPP_SHARED_API reverse_iterator | rbegin () const |
Returns reverse iterator to the last character (if any) of actual string buffer. More... | |
ASPOSECPP_SHARED_API reverse_iterator | rend () const |
Returns reverse iterator to the before first character (if any) of actual string buffer. More... | |
ASPOSECPP_SHARED_API bool | IsNullOrEmpty () const |
Checks if string is empty or is considered null. More... | |
bool | IsNull () const |
Checks if string is considered null. String is null and only if it is constructed via String() constructor, moved, copied or assigned from null string or reset() method was called. More... | |
ASPOSECPP_SHARED_API bool | IsEmpty () const |
Checks if string is both non-null and empty. More... | |
ASPOSECPP_SHARED_API std::string | ToUtf8String () const |
Converts string to std::string. Uses UTF-8 encoding. More... | |
ASPOSECPP_SHARED_API std::wstring | ToWCS () const |
Converts string to std::wstring. More... | |
ASPOSECPP_SHARED_API std::u16string | ToU16Str () const |
Converts string to std::u16string. More... | |
ASPOSECPP_SHARED_API std::u32string | ToU32Str () const |
Converts string to std::u32string. More... | |
ASPOSECPP_SHARED_API std::string | ToAsciiString () const |
Converts string to std::string. Uses ASCII encoding. More... | |
ASPOSECPP_SHARED_API String & | reset () |
Sets string to null. Is analogous to 'string_variable_name = null' in C#. More... | |
ASPOSECPP_SHARED_API int | get_Length () const |
Gets string length. More... | |
ASPOSECPP_SHARED_API char_t | operator[] (int index) const |
Gets character at specified position. More... | |
ASPOSECPP_SHARED_API String & | SetCharAt (int index, char_t ch) |
Sets character at specified position. More... | |
ASPOSECPP_SHARED_API String & | operator= (const String &str) |
Assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator= (String &&str) noexcept |
Move assignment operator. More... | |
ASPOSECPP_SHARED_API String | operator+ (const String &str) const |
String concatenation operator. More... | |
template<typename T , std::enable_if_t< IsStringLiteral< T, char_t >::value > * = nullptr> | |
String | operator+ (const T &arg) const |
String concatenation with string literal or character string pointer. More... | |
ASPOSECPP_SHARED_API String | operator+ (char_t x) const |
Adds character to the end of the string. More... | |
ASPOSECPP_SHARED_API String | operator+ (int i) const |
Adds integer value string representation to the end of the string. More... | |
ASPOSECPP_SHARED_API String | operator+ (uint32_t i) const |
Adds unsigned integer value string representation to the end of the string. More... | |
ASPOSECPP_SHARED_API String | operator+ (double d) const |
Adds floating point value string representation to the end of the string. More... | |
ASPOSECPP_SHARED_API String | operator+ (int64_t v) const |
Adds integer value string representation to the end of the string. More... | |
template<typename T , std::enable_if_t< IsSmartPtr< T >::value > * = nullptr> | |
String | operator+ (const T &value) const |
Adds reference type object string representation to the end of the string. More... | |
template<typename T , std::enable_if_t<!IsSmartPtr< T >::value &&!std::is_scalar< T >::value &&!std::is_array< T >::value > * = nullptr> | |
String | operator+ (const T &value) const |
Adds value type object string representation to the end of the string. More... | |
template<typename T , std::enable_if_t< std::is_same< T, bool >::value > * = nullptr> | |
String | operator+ (T arg) const |
Adds boolean value string representation to the end of the string. More... | |
ASPOSECPP_SHARED_API String & | operator+= (char_t c) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (const String &str) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (double value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (uint8_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (int16_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (uint16_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (int32_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (uint32_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (int64_t value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API String & | operator+= (uint64_t value) |
Concatenation assignment operator. More... | |
template<typename T , std::enable_if_t< std::is_same< T, bool >::value > * = nullptr> | |
String & | operator+= (T value) |
Concatenation assignment operator. More... | |
ASPOSECPP_SHARED_API bool | operator== (const String &str) const |
Equality comparison operator. More... | |
ASPOSECPP_SHARED_API bool | operator== (std::nullptr_t) const |
Checks if string is null. Applies same logic as IsNull() call. More... | |
ASPOSECPP_SHARED_API bool | operator!= (const String &str) const |
Non-equality comparison operator. More... | |
ASPOSECPP_SHARED_API bool | operator!= (std::nullptr_t) const |
Checks if string is not null. Applies same logic as IsNull() call. More... | |
ASPOSECPP_SHARED_API bool | operator< (const String &str) const |
Order-compares strings. More... | |
ASPOSECPP_SHARED_API String | Clone () const |
Creates a copy of current string. More... | |
String | ToString () const |
Wrapper for handling String class in contexts where ToString() is being called on value type objects. More... | |
String | ToString (const SharedPtr< IFormatProvider > &) const |
Wrapper for handling String class in contexts where ToString() is being called on value type objects. More... | |
ASPOSECPP_SHARED_API int | GetHashCode () const |
Hashes contained string. Implemented in ICU, doesn't match hashes in C#. More... | |
ASPOSECPP_SHARED_API bool | Equals (const String &str, System::StringComparison comparison_type) const |
String equality comparison. Several modes provided by StringComparison enumeration are supported. More... | |
ASPOSECPP_SHARED_API bool | Equals (const String &str) const |
String equality comparison. Uses System::StringComparison::Ordinal comparison mode. More... | |
ASPOSECPP_SHARED_API bool | Contains (const String &str) const |
Checks if str is a substring of current string. More... | |
ASPOSECPP_SHARED_API int | CompareTo (const String &str) const |
Compares two strings in 'less-equals-more' style. Uses current culture. More... | |
ASPOSECPP_SHARED_API void | CopyTo (int sourceIndex, const ArrayPtr< char_t > &destination, int destinationIndex, int count) const |
Copies string characters into existing array elements. No resize is being done. More... | |
ASPOSECPP_SHARED_API String | Normalize (System::Text::NormalizationForm form) const |
Normalizes unicode string using normalization form specified. More... | |
ASPOSECPP_SHARED_API bool | IsNormalized (System::Text::NormalizationForm form) const |
Checks if unicode string is normalized using normalization form specified. More... | |
ASPOSECPP_SHARED_API bool | StartsWith (const String &value) const |
Checks if string begins with specified substring. More... | |
ASPOSECPP_SHARED_API bool | StartsWith (const String &value, System::StringComparison comparisonType) const |
Checks if string begins with specified substring. More... | |
ASPOSECPP_SHARED_API bool | StartsWith (const String &value, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &culture=nullptr) const |
Checks if string begins with specified substring. More... | |
ASPOSECPP_SHARED_API bool | EndsWith (const String &value) const |
Checks if string ends with specified substring. More... | |
ASPOSECPP_SHARED_API bool | EndsWith (const String &value, System::StringComparison comparisonType) const |
Checks if string ends with specified substring. More... | |
ASPOSECPP_SHARED_API bool | EndsWith (const String &value, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &culture=nullptr) const |
Checks if string ends with specified substring. More... | |
ASPOSECPP_SHARED_API ArrayPtr< char_t > | ToCharArray (int32_t startIndex=0, int32_t length=INT32_MAX) const |
Converts string or substring to array of characters. More... | |
ASPOSECPP_SHARED_API ArrayPtr< uint8_t > | ToByteArray (int32_t startIndex=0, int32_t length=INT32_MAX, bool LE=true) const |
Converts string or substring to array of bytes. More... | |
ASPOSECPP_SHARED_API String | ToUpper () const |
Converts all string's characters to upper case. More... | |
ASPOSECPP_SHARED_API String | ToLower () const |
Converts all string's characters to lower case. More... | |
ASPOSECPP_SHARED_API String | ToLower (const SharedPtr< System::Globalization::CultureInfo > &cultureInfo) const |
Converts all string's characters to lower case using specific culture. More... | |
ASPOSECPP_SHARED_API String | ToUpper (const SharedPtr< System::Globalization::CultureInfo > &cultureInfo) const |
Converts all string's characters to upper case using specific culture. More... | |
ASPOSECPP_SHARED_API String | ToUpperInvariant () const |
Converts all string's characters to upper case using invariant culture. More... | |
ASPOSECPP_SHARED_API String | ToLowerInvariant () const |
Converts all string's characters to lower case using invariant culture. More... | |
ASPOSECPP_SHARED_API String | Substring (int32_t startIndex) const |
Extracts substring. More... | |
ASPOSECPP_SHARED_API String | Substring (int32_t startIndex, int32_t length) const |
Extracts substring. More... | |
ASPOSECPP_SHARED_API String | Remove (int32_t startIndex, int32_t count=INT32_MAX) const |
Extracts everything but substring from current string. More... | |
bool | Is (const System::TypeInfo &target) const |
Checks if string object is of type specified by TypeInfo passed. More... | |
ASPOSECPP_SHARED_API int | IndexOf (const String &str, System::StringComparison comparison_type) const |
Substring forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOf (char_t c, int startIndex=0) const |
Character forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOf (char_t c, int startIndex, int count) const |
Character forward lookup in substring. More... | |
ASPOSECPP_SHARED_API int | IndexOf (const String &str, int startIndex=0) const |
Substring forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOf (const String &str, int startIndex, System::StringComparison comparison_type) const |
Substring forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOf (const String &value, int startIndex, int count, System::StringComparison comparisonType) const |
Substring forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOf (const String &str, int startIndex, int count) const |
Substring forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOfAny (char_t c, int startIndex=0) const |
Character forward lookup. More... | |
ASPOSECPP_SHARED_API int | IndexOfAny (const String &str, int startIndex=0) const |
Consequently looks for all characters of str in this. If first character is found, its position is returned, otherwise looks for the second one and so on. More... | |
ASPOSECPP_SHARED_API int | IndexOfAny (const ArrayPtr< char_t > &anyOf) const |
Looks for any of passed characters through the whole string. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters. More... | |
ASPOSECPP_SHARED_API int | IndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex) const |
Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters. More... | |
ASPOSECPP_SHARED_API int | IndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex, int32_t count) const |
Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (const String &str, int startIndex=INT32_MAX) const |
Substring backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (const String &str, System::StringComparison comparison_type) const |
Substring backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (const String &str, int startIndex, System::StringComparison comparison_type) const |
Substring backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (const String &value, int startIndex, int count, StringComparison comparisonType) const |
Substring backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (char_t value) const |
Character backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (char_t value, int32_t startIndex) const |
Character backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOf (char_t value, int32_t startIndex, int32_t count) const |
Character backward lookup. More... | |
ASPOSECPP_SHARED_API int | LastIndexOfAny (const ArrayPtr< char_t > &anyOf) const |
Looks for any of passed characters through whole string backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found. More... | |
ASPOSECPP_SHARED_API int | LastIndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex) const |
Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found. More... | |
ASPOSECPP_SHARED_API int | LastIndexOfAny (const ArrayPtr< char_t > &anyOf, int32_t startindex, int32_t count) const |
Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found. More... | |
ASPOSECPP_SHARED_API String | Trim () const |
Removes all whitespace characters from both beginning and end of the string. More... | |
ASPOSECPP_SHARED_API String | Trim (char_t ch) const |
Removes all occurrences of passed character from both beginning and end of the string. More... | |
ASPOSECPP_SHARED_API String | Trim (const String &anyOf) const |
Removes all occurrences of passed characters from both beginning and end of the string. More... | |
ASPOSECPP_SHARED_API String | Trim (const ArrayPtr< char_t > &anyOf) const |
Removes all occurrences of passed characters from both beginning and end of the string. More... | |
ASPOSECPP_SHARED_API String | TrimStart () const |
Removes all whitespace characters from beginning of the string. More... | |
ASPOSECPP_SHARED_API String | TrimStart (char_t ch) const |
Removes all occurrences of passed character from beginning of the string. More... | |
ASPOSECPP_SHARED_API String | TrimStart (const String &anyOf) const |
Removes all occurrences of passed characters from beginning of the string. More... | |
ASPOSECPP_SHARED_API String | TrimStart (const ArrayPtr< char_t > &anyOf) const |
Removes all occurrences of passed characters from beginning of the string. More... | |
ASPOSECPP_SHARED_API String | TrimEnd () const |
Removes all whitespace characters from end of the string. More... | |
ASPOSECPP_SHARED_API String | TrimEnd (char_t ch) const |
Removes all occurrences of passed character from end of the string. More... | |
ASPOSECPP_SHARED_API String | TrimEnd (const String &anyOf) const |
Removes all occurrences of passed characters from end of the string. More... | |
ASPOSECPP_SHARED_API String | TrimEnd (const ArrayPtr< char_t > &anyOf) const |
Removes all occurrences of passed characters from end of the string. More... | |
ASPOSECPP_SHARED_API String | PadLeft (int totalWidth, char_t c=u' ') const |
Adds padding on the left of original string. More... | |
ASPOSECPP_SHARED_API String | PadRight (int totalWidth, char_t c=u' ') const |
Adds padding on the right of original string. More... | |
ASPOSECPP_SHARED_API String | Replace (char_t oldValue, char_t newValue) const |
Replaces all occurrences of character in the string. More... | |
ASPOSECPP_SHARED_API String | Replace (const String &oldValue, const String &newValue) const |
Replaces all occurrences of lookup in this string. More... | |
ASPOSECPP_SHARED_API String | Insert (int startIndex, const String &value) const |
Inserts substring at specified position. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (char_t separator=u' ', StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by character. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (char_t separator, int32_t count, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by character. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (char_t separatorA, char_t separatorB, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by one of two characters. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const ArrayPtr< char_t > &separators, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by one of characters specified. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const ArrayPtr< char_t > &separators, int32_t count, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by one of characters specified. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const String &separator, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by substring. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const String &separator, int count, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by substring. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const ArrayPtr< String > &separators, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by substring. More... | |
ASPOSECPP_SHARED_API ArrayPtr< String > | Split (const ArrayPtr< String > &separators, int count, StringSplitOptions opt=StringSplitOptions::None) const |
Splits string by substring. Currently, only supports separators array of zero or one elements. More... | |
ASPOSECPP_SHARED_API | String (const icu::UnicodeString &str) |
Wraps UnicodeString into String. More... | |
ASPOSECPP_SHARED_API | String (icu::UnicodeString &&str) noexcept |
Move constructor. More... | |
String (const std::wstring &str) | |
Creates String from widestring. More... | |
String (const std::u16string &str) | |
Creates String from utf16 string. More... | |
ASPOSECPP_SHARED_API | String (const std::string &utf8str) |
Creates String from std::string string presented in format UTF-8. More... | |
ASPOSECPP_SHARED_API | String (const std::u32string &u32str) |
Creates String from std::u32string string. More... | |
bool ASPOSECPP_SHARED_API | IsAsciiString () const |
Indicates if a String contains ASCII symbols only. More... | |
int ASPOSECPP_SHARED_API | FastToAscii (char buffer[], int buffer_size) const |
Tries to convert a String to an ASCII string. More... | |
Static Public Member Functions | |
static ASPOSECPP_SHARED_API bool | IsNullOrEmpty (const String &str) |
Checks if passed string is null or empty. More... | |
static ASPOSECPP_SHARED_API bool | IsNullOrWhiteSpace (const String &str) |
Indicates whether a specified string is null, empty, or consists only of white-space characters. More... | |
static ASPOSECPP_SHARED_API bool | Equals (const String &strA, const String &strB) |
Equal-compares two strings using Ordial comparison mode. More... | |
static ASPOSECPP_SHARED_API bool | Equals (const String &strA, const String &strB, System::StringComparison comparison_type) |
Equal-compares two strings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, int indexA, const String &strB, int indexB, int length, bool ignoreCase=false) |
Less-equal-greater-compares two substrings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, int indexA, const String &strB, int indexB, int length, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &ci) |
Less-equal-greater-compares two substrings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, const String &strB, System::StringComparison comparison_type) |
Less-equal-greater-compares two strings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, int indexA, const String &strB, int indexB, int length, System::StringComparison comparison_type) |
Less-equal-greater-compares two strings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, const String &strB, bool ignoreCase=false) |
Less-equal-greater-compares two strings. More... | |
static ASPOSECPP_SHARED_API int | Compare (const String &strA, const String &strB, bool ignoreCase, const SharedPtr< System::Globalization::CultureInfo > &ci) |
Less-equal-greater-compares two strings. More... | |
static ASPOSECPP_SHARED_API int | CompareOrdinal (const String &strA, const String &strB) |
Less-equal-greater-compares two strings using ordinal mode. More... | |
static ASPOSECPP_SHARED_API int | CompareOrdinal (const String &strA, int indexA, const String &strB, int indexB, int length) |
Less-equal-greater-compares two strings using ordinal mode. More... | |
static ASPOSECPP_SHARED_API String | Join (const String &separator, const ArrayPtr< String > &parts, int startIndex=0, int count=-1) |
Joins array using string as separator. More... | |
static ASPOSECPP_SHARED_API String | Join (const String &separator, const System::Details::ArrayView< String > &parts, int startIndex=0, int count=-1) |
Joins array using string as separator. More... | |
static ASPOSECPP_SHARED_API String | Join (const String &separator, const SharedPtr< System::Collections::Generic::IEnumerable< String > > &parts) |
Joins array using string as separator. More... | |
static ASPOSECPP_SHARED_API String | Join (const String &separator, const ArrayPtr< SharedPtr< Object >> &parts) |
Joins array using string as separator. More... | |
static ASPOSECPP_SHARED_API String | Concat (const ArrayPtr< String > &parts) |
Concatenates strings. More... | |
static ASPOSECPP_SHARED_API String | Concat (const String &str0, const String &str1) |
Concatenates strings. More... | |
static ASPOSECPP_SHARED_API String | Concat (const String &str0, const String &str1, const String &str2) |
Concatenates strings. More... | |
static ASPOSECPP_SHARED_API String | Concat (const String &str0, const String &str1, const String &str2, const String &str3) |
Concatenates strings. More... | |
static String | Copy (const String &str) |
Creates string copy. More... | |
template<class... Args> | |
static String | Format (const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args) |
Formats string in C# style. More... | |
template<class... Args> | |
static String | Format (std::nullptr_t, const String &format, const Args &... args) |
Formats string in C# style. More... | |
template<std::size_t N, class... Args> | |
static String | Format (std::nullptr_t, const char16_t(&format)[N], const Args &... args) |
Formats string in C# style. More... | |
template<class... Args> | |
static String | Format (const String &format, const Args &... args) |
Formats string in C# style. More... | |
template<class T > | |
static String | Format (const String &format, const System::ArrayPtr< T > &args) |
Formats string in C# style. More... | |
static ASPOSECPP_SHARED_API String | FromUtf8 (const char *utf8) |
Creates String from utf8 string. More... | |
static ASPOSECPP_SHARED_API String | FromUtf8 (const char *utf8, int len) |
Creates String from utf8 string. More... | |
static ASPOSECPP_SHARED_API String | FromUtf8 (const uint8_t *utf8) |
Creates String from utf8 string. More... | |
static ASPOSECPP_SHARED_API String | FromUtf8 (const std::string &utf8) |
Creates String from utf8 string. More... | |
static ASPOSECPP_SHARED_API String | FromWCS (const std::wstring &wcs) |
Creates String from widestring. More... | |
static ASPOSECPP_SHARED_API String | FromUtf32 (const uint32_t *utf32, int32_t length) |
Creates String from utf32 string. More... | |
static ASPOSECPP_SHARED_API String | FromUtf16 (const std::u16string &u16str) |
Creates String from utf16 string. More... | |
static ASPOSECPP_SHARED_API String | FromAscii (const char *asciiStr) |
Creates String from ASCII string. More... | |
static ASPOSECPP_SHARED_API String | FromAscii (const char *asciiStr, int len) |
Creates String from ASCII string. More... | |
static ASPOSECPP_SHARED_API String | FromAscii (const std::string &asciiStr) |
Creates String from ASCII string. More... | |
Static Public Attributes | |
static const ASPOSECPP_SHARED_API String | Empty |
Empty string. More... | |
static const ASPOSECPP_SHARED_API String | Null |
Null string. More... | |
Protected Member Functions | |
ASPOSECPP_SHARED_API String & | Append (const char16_t *src, int32_t startIndex, int32_t count) |
Puts some characters into string. Changes string size. More... | |
Protected Attributes | |
Detail::UnicodeStringHolder | m_str |
Actual string value. More... | |
bool | m_is_null |
If true, string is considered null string. More... | |
String class used across the library. Is a substitute for C# System.String when translating code. For optimization reasons, isn't considered an Object subclass. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
using System::String::reverse_iterator = std::reverse_iterator<const char16_t*> |
Reverse iterator type.
ASPOSECPP_SHARED_API System::String::String | ( | ) |
Default constructor. Creates string object which is considered null.
|
inline |
Constructs string based on string literal. Considers literal a null-terminated string, calculates target string length based on literal size.
value | String literal pointer. |
|
inline |
Constructs string based on character string pointer. Treats pointed string as null-terminated, calculates target string length based on null character.
value | Character string pointer. |
|
inlineexplicit |
Constructs string based on string literal. Considers literal a null-terminated string in UTF8, calculates target string length based on literal size.
value | String literal pointer. |
|
inlineexplicit |
Constructs string based on character string pointer. Treats pointed string as null-terminated in UTF8, calculates target string length based on null character.
value | Character string pointer. |
ASPOSECPP_SHARED_API System::String::String | ( | const char16_t * | str, |
int | length | ||
) |
Constructs string from character string pointer and explicit length.
str | String pointer, may be literal or array. |
length | Explicit string length |
ASPOSECPP_SHARED_API System::String::String | ( | const char * | str, |
int | length | ||
) |
Constructs string from character string pointer and explicit length.
str | String pointer to the UTF8 data, may be literal or array. |
length | Explicit string length |
ASPOSECPP_SHARED_API System::String::String | ( | const char16_t * | str, |
int | start, | ||
int | length | ||
) |
|
explicit |
Fill constructor.
ch | Fill character. |
count | Target length. |
|
inline |
Nullptr constructor. Declared as template to resolve priorities with other template constructors.
T | Should be nullptr_t |
value | nullptr |
|
inlineexplicit |
Constructs string based on widestring literal. Considers literal a null-terminated string, calculates target string length based on literal size. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.
value | String literal pointer. |
|
inlineexplicit |
Constructs string based on widecharacter string pointer. Treats pointed string as null-terminated, calculates target string length based on null character. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.
value | Character string pointer. |
|
explicit |
Constructs string from widecharacter string pointer and explicit length. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.
str | String pointer, may be literal or array. |
length | Explicit string length |
|
explicit |
Fill constructor. Conversion from wchar_t is time-consuming on some platforms, so no implicit conversions are allowed.
ch | Fill character. |
count | Target length. |
ASPOSECPP_SHARED_API System::String::String | ( | const String & | str | ) |
Copy constructor.
str | String to copy. |
|
noexcept |
Move constructor.
str | String to move data from. |
ASPOSECPP_SHARED_API System::String::String | ( | const ArrayPtr< char16_t > & | arr | ) |
Converts whole character array to string.
arr | Array to convert to string. |
ASPOSECPP_SHARED_API System::String::String | ( | const ArrayPtr< char16_t > & | arr, |
int | offset, | ||
int | len | ||
) |
Converts character array subrange to string. If parameters are out of array bounds, empty string is constructed.
arr | Character array. |
offset | Subarray start index. |
len | Subarray length. |
ASPOSECPP_SHARED_API System::String::~String | ( | ) |
Destructor.
|
explicit |
|
explicitnoexcept |
Move constructor.
str | UnicodeString to wrap into String. |
|
inlineexplicit |
|
inlineexplicit |
|
explicit |
|
explicit |
|
protected |
Puts some characters into string. Changes string size.
src | Pointer to string to insert. |
startIndex | Index to start insertion at. |
count | Number of characters to insert. |
ASPOSECPP_SHARED_API const UChar* System::String::begin | ( | ) | const |
Returns pointer to the beginning of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated.
ASPOSECPP_SHARED_API String System::String::Clone | ( | ) | const |
Creates a copy of current string.
|
static |
Less-equal-greater-compares two substrings.
strA | First string to compare. |
indexA | Beginning of first string substring. |
strB | Second string to compare. |
indexB | Beginning of the second string substring. |
length | Number of characters to compare. |
ignoreCase | Specifies whether comparison is case-insensitive. |
|
static |
Less-equal-greater-compares two substrings.
strA | First string to compare. |
indexA | Beginning of first string substring. |
strB | Second string to compare. |
indexB | Beginning of the second string substring. |
length | Number of characters to compare. |
ignoreCase | Specifies whether comparison is case-insensitive. |
ci | Culture to use for comparison. |
|
static |
Less-equal-greater-compares two strings.
strA | First string to compare. |
strB | Second string to compare. |
comparison_type | Comparison mode. |
|
static |
Less-equal-greater-compares two strings.
strA | First string to compare. |
indexA | Beginning of first string substring. |
strB | Second string to compare. |
indexB | Beginning of the second string substring. |
length | Number of characters to compare. |
comparison_type | Comparison mode. |
|
static |
Less-equal-greater-compares two strings.
strA | First string to compare. |
strB | Second string to compare. |
ignoreCase | Specifies whether comparison is case-insensitive. |
|
static |
Less-equal-greater-compares two strings.
strA | First string to compare. |
strB | Second string to compare. |
ignoreCase | Specifies whether comparison is case-insensitive. |
ci | Culture to use for comparison. |
|
static |
Less-equal-greater-compares two strings using ordinal mode.
strA | First string to compare. |
strB | Second string to compare. |
|
static |
Less-equal-greater-compares two strings using ordinal mode.
strA | First string to compare. |
indexA | Beginning of first string substring. |
strB | Second string to compare. |
indexB | Beginning of the second string substring. |
length | Number of characters to compare. |
ASPOSECPP_SHARED_API int System::String::CompareTo | ( | const String & | str | ) | const |
Compares two strings in 'less-equals-more' style. Uses current culture.
str | String to compare this to. |
|
static |
Concatenates strings.
parts | Strings to concatenate. |
|
static |
Concatenates strings.
str0 | First string to concatenate. |
str1 | Second string to concatenate. |
|
static |
Concatenates strings.
str0 | First string to concatenate. |
str1 | Second string to concatenate. |
str2 | Third string to concatenate. |
|
static |
Concatenates strings.
str0 | First string to concatenate. |
str1 | Second string to concatenate. |
str2 | Third string to concatenate. |
str3 | Fourth string to concatenate. |
ASPOSECPP_SHARED_API bool System::String::Contains | ( | const String & | str | ) | const |
Checks if str is a substring of current string.
str | Lookup string. |
ASPOSECPP_SHARED_API void System::String::CopyTo | ( | int | sourceIndex, |
const ArrayPtr< char_t > & | destination, | ||
int | destinationIndex, | ||
int | count | ||
) | const |
Copies string characters into existing array elements. No resize is being done.
sourceIndex | In-string index to start reading from. |
destination | Destination array. |
destinationIndex | In-array index to start writing from. |
count | Number of characters to copy. |
ASPOSECPP_SHARED_API const UChar* System::String::end | ( | ) | const |
Returns pointer to the end of actual string buffer. Never reallocates anything. Doesn't guarantee buffer to be null-terminated.
ASPOSECPP_SHARED_API bool System::String::EndsWith | ( | const String & | value | ) | const |
Checks if string ends with specified substring.
value | Lookup string. |
ASPOSECPP_SHARED_API bool System::String::EndsWith | ( | const String & | value, |
System::StringComparison | comparisonType | ||
) | const |
Checks if string ends with specified substring.
value | Lookup string. |
comparisonType | Comparison mode, see System::StringComparison for details. |
ASPOSECPP_SHARED_API bool System::String::EndsWith | ( | const String & | value, |
bool | ignoreCase, | ||
const SharedPtr< System::Globalization::CultureInfo > & | culture = nullptr |
||
) | const |
Checks if string ends with specified substring.
value | Lookup string. |
ignoreCase | Specifies whether comparison is case-insensitive. |
culture | Culture to use while performing string comparison. |
ASPOSECPP_SHARED_API bool System::String::Equals | ( | const String & | str, |
System::StringComparison | comparison_type | ||
) | const |
String equality comparison. Several modes provided by StringComparison enumeration are supported.
str | String to compare against the current one. |
comparison_type | Comparison mode (see System::StringComparison for details). |
ASPOSECPP_SHARED_API bool System::String::Equals | ( | const String & | str | ) | const |
String equality comparison. Uses System::StringComparison::Ordinal comparison mode.
str | String to compare against the current one. |
|
static |
Equal-compares two strings using Ordial comparison mode.
strA | First string to compare. |
strB | Second string to compare. |
|
static |
Equal-compares two strings.
strA | First string to compare. |
strB | Second string to compare. |
comparison_type | Comparison mode. |
int ASPOSECPP_SHARED_API System::String::FastToAscii | ( | char | buffer[], |
int | buffer_size | ||
) | const |
|
static |
Formats string in C# style.
Args | Arguments to format string. |
fp | Format provider to use to convert arguments to strings. |
format | Format string. |
args | Arguments to format string. |
|
static |
Formats string in C# style.
Args | Arguments to format string. |
format | Format string. |
args | Arguments to format string. |
|
static |
Formats string in C# style.
Args | Arguments to format string. |
format | Format string. |
args | Arguments to format string. |
|
static |
Formats string in C# style.
Args | Arguments to format string. |
format | Format string. |
args | Arguments to format string. |
|
static |
Formats string in C# style.
T | Arguments to format string. |
format | Format string. |
args | Arguments to format string. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
ASPOSECPP_SHARED_API int System::String::get_Length | ( | ) | const |
Gets string length.
ASPOSECPP_SHARED_API int System::String::GetHashCode | ( | ) | const |
Hashes contained string. Implemented in ICU, doesn't match hashes in C#.
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | const String & | str, |
System::StringComparison | comparison_type | ||
) | const |
Substring forward lookup.
str | Substring to look for. |
comparison_type | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | char_t | c, |
int | startIndex = 0 |
||
) | const |
Character forward lookup.
c | Character to look for. |
startIndex | Index to start lookup at. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | char_t | c, |
int | startIndex, | ||
int | count | ||
) | const |
Character forward lookup in substring.
c | Character to look for. |
startIndex | Index to start lookup at. |
count | Number of characters to look through. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | const String & | str, |
int | startIndex = 0 |
||
) | const |
Substring forward lookup.
str | Substring to look for. |
startIndex | Position in source string to start lookup through. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | const String & | str, |
int | startIndex, | ||
System::StringComparison | comparison_type | ||
) | const |
Substring forward lookup.
str | Substring to look for. |
startIndex | Position in source string to start lookup through. |
comparison_type | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | const String & | value, |
int | startIndex, | ||
int | count, | ||
System::StringComparison | comparisonType | ||
) | const |
Substring forward lookup.
value | Substring to look for. |
startIndex | Position in source string to start lookup through. |
count | number of characters to look through. |
comparisonType | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::IndexOf | ( | const String & | str, |
int | startIndex, | ||
int | count | ||
) | const |
Substring forward lookup.
str | Substring to look for. |
startIndex | Position in source string to start lookup through. |
count | number of characters to look through. |
ASPOSECPP_SHARED_API int System::String::IndexOfAny | ( | char_t | c, |
int | startIndex = 0 |
||
) | const |
Character forward lookup.
c | Character to look for. |
startIndex | Index to start lookup at. |
ASPOSECPP_SHARED_API int System::String::IndexOfAny | ( | const String & | str, |
int | startIndex = 0 |
||
) | const |
Consequently looks for all characters of str in this. If first character is found, its position is returned, otherwise looks for the second one and so on.
str | String of characters to look for. Order of characters matters. |
startIndex | Position to start lookup from. |
ASPOSECPP_SHARED_API int System::String::IndexOfAny | ( | const ArrayPtr< char_t > & | anyOf | ) | const |
Looks for any of passed characters through the whole string. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.
anyOf | Array of characters to look for. Order doesn't matter. |
ASPOSECPP_SHARED_API int System::String::IndexOfAny | ( | const ArrayPtr< char_t > & | anyOf, |
int32_t | startindex | ||
) | const |
Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.
anyOf | Array of characters to look for. Order doesn't matter. |
startindex | Index to start lookup from. |
ASPOSECPP_SHARED_API int System::String::IndexOfAny | ( | const ArrayPtr< char_t > & | anyOf, |
int32_t | startindex, | ||
int32_t | count | ||
) | const |
Looks for any of passed characters through substring. Compares first string character to all characters in anyOf, then compares second one and so on. Returns index of the first one matching any of the target characters.
anyOf | Array of characters to look for. Order doesn't matter. |
startindex | Index to start lookup from. |
count | Number of characters to look through. |
Inserts substring at specified position.
startIndex | Index in this string to start inserting from. |
value | Insertion string. |
|
inline |
bool ASPOSECPP_SHARED_API System::String::IsAsciiString | ( | ) | const |
Indicates if a String contains ASCII symbols only.
ASPOSECPP_SHARED_API bool System::String::IsEmpty | ( | ) | const |
Checks if string is both non-null and empty.
ASPOSECPP_SHARED_API bool System::String::IsNormalized | ( | System::Text::NormalizationForm | form | ) | const |
Checks if unicode string is normalized using normalization form specified.
form | Normalization form, see System::Text::NormalizationForm for details. |
|
inline |
ASPOSECPP_SHARED_API bool System::String::IsNullOrEmpty | ( | ) | const |
Checks if string is empty or is considered null.
|
static |
Checks if passed string is null or empty.
str | String to check. |
|
static |
Indicates whether a specified string is null, empty, or consists only of white-space characters.
str | String to check. |
|
static |
Joins array using string as separator.
separator | String to put between array elements when joining them. |
parts | Array of parts to join. |
startIndex | First index in array to start joining from. |
count | Number of array elements to join. -1 means 'until array ends'. |
|
static |
Joins array using string as separator.
separator | String to put between array elements when joining them. |
parts | ArrayView of parts to join. |
startIndex | First index in array to start joining from. |
count | Number of array elements to join. -1 means 'until array ends'. |
|
static |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | const String & | str, |
int | startIndex = INT32_MAX |
||
) | const |
Substring backward lookup.
str | Substring to look for. |
startIndex | Position in source string to start lookup through. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | const String & | str, |
System::StringComparison | comparison_type | ||
) | const |
Substring backward lookup.
str | Substring to look for. |
comparison_type | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | const String & | str, |
int | startIndex, | ||
System::StringComparison | comparison_type | ||
) | const |
Substring backward lookup.
str | Substring to look for. |
startIndex | Position in source string to start lookup through. |
comparison_type | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | const String & | value, |
int | startIndex, | ||
int | count, | ||
StringComparison | comparisonType | ||
) | const |
Substring backward lookup.
value | Substring to look for. |
startIndex | Position in source string to start lookup through. |
count | Number of characters to look through. |
comparisonType | Comparison mode. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | char_t | value | ) | const |
Character backward lookup.
value | Character to look for. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | char_t | value, |
int32_t | startIndex | ||
) | const |
Character backward lookup.
value | Character to look for. |
startIndex | Index to start lookup at. |
ASPOSECPP_SHARED_API int System::String::LastIndexOf | ( | char_t | value, |
int32_t | startIndex, | ||
int32_t | count | ||
) | const |
Character backward lookup.
value | Character to look for. |
startIndex | Index to start lookup at. |
count | Number of characters to look through |
ASPOSECPP_SHARED_API int System::String::LastIndexOfAny | ( | const ArrayPtr< char_t > & | anyOf | ) | const |
Looks for any of passed characters through whole string backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.
anyOf | Array of characters to look for. Order doesn't matter. |
ASPOSECPP_SHARED_API int System::String::LastIndexOfAny | ( | const ArrayPtr< char_t > & | anyOf, |
int32_t | startindex | ||
) | const |
Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.
anyOf | Array of characters to look for. Order doesn't matter. |
startindex | Index to start lookup from. |
ASPOSECPP_SHARED_API int System::String::LastIndexOfAny | ( | const ArrayPtr< char_t > & | anyOf, |
int32_t | startindex, | ||
int32_t | count | ||
) | const |
Looks for any of passed characters through substring backwardly. Compares last string character to all characters in anyOf, then compares previous one and so on. Returns index of the first match found.
anyOf | Array of characters to look for. Order doesn't matter. |
startindex | Index to start lookup from. |
count | Number of characters to look through. |
ASPOSECPP_SHARED_API String System::String::Normalize | ( | System::Text::NormalizationForm | form | ) | const |
Normalizes unicode string using normalization form specified.
form | Normalization form, see System::Text::NormalizationForm for details. |
ASPOSECPP_SHARED_API bool System::String::operator!= | ( | const String & | str | ) | const |
Non-equality comparison operator.
str | String to compare current one to. |
ASPOSECPP_SHARED_API bool System::String::operator!= | ( | std::nullptr_t | ) | const |
Checks if string is not null. Applies same logic as IsNull() call.
|
inline |
String concatenation with string literal or character string pointer.
T | One of string literal or character string pointer forms. |
arg | Entity to concatenate with current string. |
ASPOSECPP_SHARED_API String System::String::operator+ | ( | char_t | x | ) | const |
Adds character to the end of the string.
x | Character to add. |
ASPOSECPP_SHARED_API String System::String::operator+ | ( | int | i | ) | const |
Adds integer value string representation to the end of the string.
i | Integer value to convert to string and to add. |
ASPOSECPP_SHARED_API String System::String::operator+ | ( | uint32_t | i | ) | const |
Adds unsigned integer value string representation to the end of the string.
i | Value to convert to string and to add. |
ASPOSECPP_SHARED_API String System::String::operator+ | ( | double | d | ) | const |
Adds floating point value string representation to the end of the string.
d | Value to convert to string and to add. |
ASPOSECPP_SHARED_API String System::String::operator+ | ( | int64_t | v | ) | const |
Adds integer value string representation to the end of the string.
v | Value to convert to string and to add to add. |
|
inline |
Adds reference type object string representation to the end of the string.
T | pointer type. |
value | Object to convert to string using ToString() call and to add to current string. |
|
inline |
Adds value type object string representation to the end of the string.
T | Value type to call ToString() upon. |
value | Object to convert to string using ToString() call and to add to current string. |
|
inline |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | char_t | c | ) |
Concatenation assignment operator.
c | Character to add to the end of current string. |
Concatenation assignment operator.
str | String to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | double | value | ) |
Concatenation assignment operator.
value | Double to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | uint8_t | value | ) |
Concatenation assignment operator.
value | Byte to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | int16_t | value | ) |
Concatenation assignment operator.
value | Short to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | uint16_t | value | ) |
Concatenation assignment operator.
value | Unsigned short to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | int32_t | value | ) |
Concatenation assignment operator.
value | Int to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | uint32_t | value | ) |
Concatenation assignment operator.
value | Unsigned int to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | int64_t | value | ) |
Concatenation assignment operator.
value | Long to add to the end of current string. |
ASPOSECPP_SHARED_API String& System::String::operator+= | ( | uint64_t | value | ) |
Concatenation assignment operator.
value | Unsigned long to add to the end of current string. |
|
inline |
Concatenation assignment operator.
T | Value type to concatenate with string. Must be bool |
value | Boolean to add to the end of current string. |
ASPOSECPP_SHARED_API bool System::String::operator< | ( | const String & | str | ) | const |
Order-compares strings.
str | String to compare current one to. |
ASPOSECPP_SHARED_API bool System::String::operator== | ( | const String & | str | ) | const |
Equality comparison operator.
str | String to compare current one to. |
ASPOSECPP_SHARED_API bool System::String::operator== | ( | std::nullptr_t | ) | const |
Checks if string is null. Applies same logic as IsNull() call.
ASPOSECPP_SHARED_API char_t System::String::operator[] | ( | int | index | ) | const |
Gets character at specified position.
index | Index to get character from. |
ASPOSECPP_SHARED_API String System::String::PadLeft | ( | int | totalWidth, |
char_t | c = u' ' |
||
) | const |
Adds padding on the left of original string.
totalWidth | Number of padding characters to insert. |
c | Padding character. |
ASPOSECPP_SHARED_API String System::String::PadRight | ( | int | totalWidth, |
char_t | c = u' ' |
||
) | const |
Adds padding on the right of original string.
totalWidth | Number of padding characters to insert. |
c | Padding character. |
ASPOSECPP_SHARED_API reverse_iterator System::String::rbegin | ( | ) | const |
Returns reverse iterator to the last character (if any) of actual string buffer.
ASPOSECPP_SHARED_API String System::String::Remove | ( | int32_t | startIndex, |
int32_t | count = INT32_MAX |
||
) | const |
Extracts everything but substring from current string.
startIndex | Index of first character to not extract. |
count | Number of characters to not extract. |
ASPOSECPP_SHARED_API reverse_iterator System::String::rend | ( | ) | const |
Returns reverse iterator to the before first character (if any) of actual string buffer.
ASPOSECPP_SHARED_API String System::String::Replace | ( | char_t | oldValue, |
char_t | newValue | ||
) | const |
Replaces all occurrences of character in the string.
oldValue | Character to replace. |
newValue | replacement value. |
ASPOSECPP_SHARED_API String& System::String::reset | ( | ) |
Sets string to null. Is analogous to 'string_variable_name = null' in C#.
ASPOSECPP_SHARED_API String& System::String::SetCharAt | ( | int | index, |
char_t | ch | ||
) |
Sets character at specified position.
index | Index to set character at. |
ch | Character to put at specified position. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | char_t | separator = u' ' , |
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
Splits string by character.
separator | Character to split string by. |
opt | Splitting options. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | char_t | separator, |
int32_t | count, | ||
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
Splits string by character.
separator | Character to split string by. |
count | The maximum number of substrings to return. |
opt | Splitting options. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | char_t | separatorA, |
char_t | separatorB, | ||
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
Splits string by one of two characters.
separatorA | First character to split string by. |
separatorB | Second character to split string by. |
opt | Splitting options. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const ArrayPtr< char_t > & | separators, |
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const ArrayPtr< char_t > & | separators, |
int32_t | count, | ||
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const String & | separator, |
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
Splits string by substring.
separator | Substring acting as separator. If empty, whitespace character acts as separator. |
opt | Splitting options. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const String & | separator, |
int | count, | ||
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
Splits string by substring.
separator | Substring acting as separator. If empty, whitespace character acts as separator. |
count | Max number of elements in splits array. |
opt | Splitting options. |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const ArrayPtr< String > & | separators, |
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
ASPOSECPP_SHARED_API ArrayPtr<String> System::String::Split | ( | const ArrayPtr< String > & | separators, |
int | count, | ||
StringSplitOptions | opt = StringSplitOptions::None |
||
) | const |
ASPOSECPP_SHARED_API bool System::String::StartsWith | ( | const String & | value | ) | const |
Checks if string begins with specified substring.
value | Lookup string. |
ASPOSECPP_SHARED_API bool System::String::StartsWith | ( | const String & | value, |
System::StringComparison | comparisonType | ||
) | const |
Checks if string begins with specified substring.
value | Lookup string. |
comparisonType | Comparison mode, see System::StringComparison for details. |
ASPOSECPP_SHARED_API bool System::String::StartsWith | ( | const String & | value, |
bool | ignoreCase, | ||
const SharedPtr< System::Globalization::CultureInfo > & | culture = nullptr |
||
) | const |
Checks if string begins with specified substring.
value | Lookup string. |
ignoreCase | Specifies whether comparison is case-insensitive. |
culture | Culture to use while performing string comparison. |
ASPOSECPP_SHARED_API String System::String::Substring | ( | int32_t | startIndex | ) | const |
Extracts substring.
startIndex | Substring start index. |
ASPOSECPP_SHARED_API String System::String::Substring | ( | int32_t | startIndex, |
int32_t | length | ||
) | const |
Extracts substring.
startIndex | Substring start index. |
length | Substring length. |
ASPOSECPP_SHARED_API std::string System::String::ToAsciiString | ( | ) | const |
Converts string to std::string. Uses ASCII encoding.
FormatException | if a string contains non-ASCII characters. |
ASPOSECPP_SHARED_API ArrayPtr<uint8_t> System::String::ToByteArray | ( | int32_t | startIndex = 0 , |
int32_t | length = INT32_MAX , |
||
bool | LE = true |
||
) | const |
Converts string or substring to array of bytes.
startIndex | Substring start index. |
length | Substring length. |
LE | If true, encode characters using little endianness; otherwise, use big endianness. |
ASPOSECPP_SHARED_API ArrayPtr<char_t> System::String::ToCharArray | ( | int32_t | startIndex = 0 , |
int32_t | length = INT32_MAX |
||
) | const |
Converts string or substring to array of characters.
startIndex | Substring start index. |
length | Substring length. |
ASPOSECPP_SHARED_API String System::String::ToLower | ( | ) | const |
Converts all string's characters to lower case.
ASPOSECPP_SHARED_API String System::String::ToLower | ( | const SharedPtr< System::Globalization::CultureInfo > & | cultureInfo | ) | const |
Converts all string's characters to lower case using specific culture.
cultureInfo | Culture to use. |
ASPOSECPP_SHARED_API String System::String::ToLowerInvariant | ( | ) | const |
Converts all string's characters to lower case using invariant culture.
|
inline |
Wrapper for handling String class in contexts where ToString() is being called on value type objects.
|
inline |
Wrapper for handling String class in contexts where ToString() is being called on value type objects.
ASPOSECPP_SHARED_API std::u16string System::String::ToU16Str | ( | ) | const |
Converts string to std::u16string.
ASPOSECPP_SHARED_API std::u32string System::String::ToU32Str | ( | ) | const |
Converts string to std::u32string.
ASPOSECPP_SHARED_API String System::String::ToUpper | ( | ) | const |
Converts all string's characters to upper case.
ASPOSECPP_SHARED_API String System::String::ToUpper | ( | const SharedPtr< System::Globalization::CultureInfo > & | cultureInfo | ) | const |
Converts all string's characters to upper case using specific culture.
cultureInfo | Culture to use. |
ASPOSECPP_SHARED_API String System::String::ToUpperInvariant | ( | ) | const |
Converts all string's characters to upper case using invariant culture.
ASPOSECPP_SHARED_API std::string System::String::ToUtf8String | ( | ) | const |
Converts string to std::string. Uses UTF-8 encoding.
ASPOSECPP_SHARED_API std::wstring System::String::ToWCS | ( | ) | const |
Converts string to std::wstring.
ASPOSECPP_SHARED_API String System::String::Trim | ( | ) | const |
Removes all whitespace characters from both beginning and end of the string.
ASPOSECPP_SHARED_API String System::String::Trim | ( | char_t | ch | ) | const |
Removes all occurrences of passed character from both beginning and end of the string.
ch | Symbol to remove. |
ASPOSECPP_SHARED_API String System::String::TrimEnd | ( | ) | const |
Removes all whitespace characters from end of the string.
ASPOSECPP_SHARED_API String System::String::TrimEnd | ( | char_t | ch | ) | const |
Removes all occurrences of passed character from end of the string.
ch | Symbol to remove. |
ASPOSECPP_SHARED_API String System::String::TrimStart | ( | ) | const |
Removes all whitespace characters from beginning of the string.
ASPOSECPP_SHARED_API String System::String::TrimStart | ( | char_t | ch | ) | const |
Removes all occurrences of passed character from beginning of the string.
ch | Symbol to remove. |
ASPOSECPP_SHARED_API const UChar* System::String::u_str | ( | ) | const |
Returns ICU-styled null-terminated buffer. May reallocate the string.
|
static |
Empty string.
|
protected |
If true, string is considered null string.
|
mutableprotected |
Actual string value.
|
static |
Null string.