6#include "system/globalization/unicode_category.h"
7#include "system/primitive_types.h"
8#include "system/globalization/culture_info.h"
18 RTTI_INFO_VALUE_TYPE(
Char)
49 return 0xD800 <= (uint32_t)highSurrogate && (uint32_t)highSurrogate <= 0xDBFF &&
50 0xDC00 <= (uint32_t)lowSurrogate && (uint32_t)lowSurrogate <= 0xDFFF;
76 return (uint32_t)c >= 0xD800 && (uint32_t)c <= 0xDBFF;
90 return (uint32_t)c >= 0xDC00 && (uint32_t)c <= 0xDFFF;
111 static bool IsDigit(
const char_t* str,
int idx) {
return IsDigit(*(str + idx)); }
217 return c == 0x20 || (c >= 0x09 && c <= 0x0d) || c == 0x85 || c == 0xA0;
236 return c == 0x20 || (c >= 0x09 && c <= 0x0d);
251 static bool IsUpper(
const char_t* str,
int idx) {
return IsUpper(*(str + idx)); }
265 static bool IsLower(
const char_t* str,
int idx) {
return IsLower(*(str + idx)); }
321 if (culture ==
nullptr)
323 throw ArgumentNullException(u
"culture");
325 return culture->get_TextInfo()->ToUpper(c);
334 if (culture ==
nullptr)
336 throw ArgumentNullException(u
"culture");
339 return culture->get_TextInfo()->ToLower(c);
363 if (((utf32 > 0x0010FFFF)) || ((utf32 >= 0xD800) && (utf32 <= 0xDFFF)))
365 throw ArgumentOutOfRangeException(u
"ArgumentOutOfRange_InvalidUTF32");
379 throw ArgumentOutOfRangeException(u
"ArgumentOutOfRange_InvalidHighSurrogate");
384 throw ArgumentOutOfRangeException(u
"ArgumentOutOfRange_InvalidLowSurrogate");
387 return (
int)(((highSurrogate -0xD800) * 0x0400) + (lowSurrogate - 0xDC00)) + 0x010000;
Provides methods for manipulation of characters represented as UTF-16 code units. This is a static ty...
Definition: char.h:17
static bool IsSeparator(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:177
static bool IsUpper(const String &str, int idx)
Determines whether the character at the specified index in the specified string is classified as an u...
static bool IsControl(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:97
static char_t ToLower(char_t c, const SharedPtr< Globalization::CultureInfo > &culture)
Converts the specified character to lower case.
Definition: char.h:332
static int ConvertToUtf32(const String &s, int index)
Converts the value of a UTF-16 encoded character or surrogate pair at a specified position in a strin...
static const uint8_t s_category_table[71680]
Table that maps Unicode characters to the Unicode categories.
Definition: char.h:427
static bool IsLower(char_t c)
Determines whether the specified character is classified as a lower case letter.
Definition: char.h:270
static const uint32_t s_category_table_astral_index[4096]
Table that maps Unicode characters to the Unicode astral plane indexes.
Definition: char.h:429
static bool IsSeparator(char_t c)
Determines whether the specified character is classified as a separator character.
Definition: char.h:182
static constexpr bool IsAsciiWhiteSpace(char_t c)
Determines whether the specified character is classified as a ASCII white space character.
Definition: char.h:234
static bool IsLower(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:265
static bool IsWhiteSpace(char_t c)
Determines whether the specified character is classified as a white space character.
Definition: char.h:214
static bool IsSurrogate(const String &s, int index)
Determines whether the character at the specified index in the specified string is UTF-16 surrogate c...
static bool IsDigit(char_t c)
Determines whether the specified character is classified as a decimal digit.
Definition: char.h:122
static String ConvertFromUtf32(uint32_t utf32)
Converts UTF-32 code unit into an instance of System::String class.
Definition: char.h:361
static bool IsSymbol(char_t c)
Determines whether the specified character is classified as a symbol character.
Definition: char.h:198
static bool IsLetter(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:131
static double GetNumericValue(char_t c)
Converts the specified UTF-16 character into double-precision floating-point numerical value.
static bool IsDigit(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:111
static bool IsDigit(const String &str, const int32_t idx)
Determines whether the character at the specified index in the specified string is classified as a de...
Definition: char.h:117
static Globalization::UnicodeCategory GetUnicodeCategory(char_t ch)
Returns a value that represents a Unicode category of specified character.
Definition: char.h:24
static char_t ToLowerInvariant(char_t c)
Converts the specified character to lower case.
Definition: char.h:353
static bool IsHighSurrogate(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is a high s...
Definition: char.h:69
static bool IsNumber(char_t c)
Determines whether the specified character is classified as a number.
Definition: char.h:166
static bool TryParse(const System::String &s, char_t &result)
Tries to convert a string consisting of a single character into UTF-16 character. The function succee...
Definition: char.h:401
static bool IsSurrogatePair(const String &str, int index)
Determines whether two consequent characters in the specified character buffer are a surrogate pair.
static bool IsPunctuation(char_t c)
Determines whether the specified character is classified as a punctuation character.
Definition: char.h:292
static bool IsWhiteSpace(const String &str, int index)
Determines whether the character at the specified index in the specified string is classified as a wh...
static char_t ToUpperInvariant(char_t c)
Converts the specified character to upper case.
Definition: char.h:345
static bool IsWhiteSpace(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:209
static bool IsNumber(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:161
static bool IsUpper(char_t c)
Determines whether the specified character is classified as an upper case letter.
Definition: char.h:256
static bool IsLetterOrDigit(char_t c)
Determines whether the specified character is classified as Unicode letter or a decimal digit.
Definition: char.h:150
static int ConvertToUtf32(char_t highSurrogate, char_t lowSurrogate)
Converts the specified UTF-16 surrogate pair into UTF-32 code unit.
Definition: char.h:375
static char_t ToLower(char_t c)
Converts the specified character to lower case.
Definition: char.h:310
static bool IsLower(const String &str, int idx)
Determines whether the character at the specified index in the specified string is classified as a lo...
static bool IsPunctuation(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:287
static bool IsLowSurrogate(char_t c)
Determines whether the specified character is a low surrogate.
Definition: char.h:88
static bool IsLetterOrDigit(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:145
static char_t Parse(const String &value)
Converts the first and the only character of the specified string to a char_t value.
static bool IsLowSurrogate(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is a low su...
Definition: char.h:83
static bool IsSurrogate(char_t c)
Determines if the specified character is a UTF-16 surrogate code unit.
Definition: char.h:32
static char_t ToUpper(char_t c)
Converts the specified character to upper case.
Definition: char.h:302
static char_t ToUpper(char_t c, const SharedPtr< Globalization::CultureInfo > &culture)
Converts the specified character to upper case.
Definition: char.h:319
static bool IsHighSurrogate(char_t c)
Determines whether the specified character is a high surrogate.
Definition: char.h:74
static bool IsUpper(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:251
static bool IsSymbol(const char_t *str, int idx)
Determines whether the character at the specified index in the specified character buffer is classifi...
Definition: char.h:193
static bool IsControl(char_t c)
Determines whether the specified character is classified as Unicode control character.
Definition: char.h:102
static bool IsSurrogatePair(char_t highSurrogate, char_t lowSurrogate)
Determines whether the two specified characters for a UTF-16 surrogate pair.
Definition: char.h:47
static bool IsLetter(char_t c)
Determines whether the specified character is classified as Unicode letter.
Definition: char.h:136
static bool IsHighSurrogate(const String &s, int index)
Determines whether the character at the specified index in the specified string is UTF-16 high surrog...
static const CultureInfoPtr & get_CurrentCulture()
Gets culture set for current thread.
static const CultureInfoPtr & get_InvariantCulture()
Gets invariant culture.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
int get_Length() const
Gets string length.
static String FromUtf32(const uint32_t *utf32, int32_t length)
Creates String from utf32 string.
UnicodeCategory
Category of unicode character.
Definition: unicode_category.h:10
@ LowercaseLetter
Lower case letter.
@ DecimalDigitNumber
Decimal digit.
@ ParagraphSeparator
Paragraph separator.
@ OtherPunctuation
Other punctuation sign.
@ OtherLetter
Other letter.
@ OtherSymbol
Other symbol.
@ OtherNumber
Other number.
@ Control
Control character.
@ Surrogate
Surrogate character.
@ ConnectorPunctuation
Connector punctuation sign.
@ UppercaseLetter
Upper case letter.
Definition: db_command.h:9