Represents a Unicode scalar value ([ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive). It should be allocated on stack and passed to functions by value or by reference.
More...
#include <rune.h>
Represents a Unicode scalar value ([ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive). It should be allocated on stack and passed to functions by value or by reference.
◆ Rune() [1/3]
| System::Text::Rune::Rune |
( |
| ) |
|
Constructs a default Rune representing U+0000.
◆ Rune() [2/3]
| System::Text::Rune::Rune |
( |
int32_t |
value | ) |
|
Creates a Rune from the provided Unicode scalar value.
- Parameters
-
| value | The scalar value to wrap. |
- Exceptions
-
| ArgumentOutOfRangeException | if the value does not represent a valid Unicode scalar value. |
◆ Rune() [3/3]
| System::Text::Rune::Rune |
( |
uint32_t |
value | ) |
|
Creates a Rune from the provided Unicode scalar value.
- Parameters
-
| value | The scalar value to wrap. |
- Exceptions
-
| ArgumentOutOfRangeException | if the value does not represent a valid Unicode scalar value. |
◆ DecodeFromUtf16()
Decodes the Rune at the beginning of the provided UTF-16 source buffer.
- Parameters
-
| source | The buffer to decode from. |
| result | The decoded Rune, or the replacement character if the data is ill-formed. |
| charsConsumed | The number of code units consumed from the source buffer. |
- Returns
- The status of the decoding operation.
◆ DecodeFromUtf8()
Decodes the Rune at the beginning of the provided UTF-8 source buffer.
- Parameters
-
| source | The buffer to decode from. |
| result | The decoded Rune, or the replacement character if the data is ill-formed. |
| bytesConsumed | The number of bytes consumed from the source buffer. |
- Returns
- The status of the decoding operation.
◆ TryCreate() [1/2]
| static bool System::Text::Rune::TryCreate |
( |
char16_t |
ch, |
|
|
Rune & |
result |
|
) |
| |
|
static |
Attempts to create a Rune from the provided UTF-16 code unit.
- Parameters
-
| ch | The code unit to convert. |
| result | The resulting Rune if the input is not a surrogate. |
- Returns
- true if the code unit represents a valid scalar value; otherwise, false.
◆ TryCreate() [2/2]
| static bool System::Text::Rune::TryCreate |
( |
char16_t |
highSurrogate, |
|
|
char16_t |
lowSurrogate, |
|
|
Rune & |
result |
|
) |
| |
|
static |
Attempts to create a Rune from the provided UTF-16 surrogate pair.
- Parameters
-
| highSurrogate | The high surrogate code unit. |
| lowSurrogate | The low surrogate code unit. |
| result | The resulting Rune if the input represents a valid surrogate pair. |
- Returns
- true if the input represents a well-formed UTF-16 surrogate pair; otherwise, false.
◆ TryEncodeToUtf8()
| bool System::Text::Rune::TryEncodeToUtf8 |
( |
Span< uint8_t > |
destination, |
|
|
int32_t & |
bytesWritten |
|
) |
| |
Encodes this Rune to a UTF-8 destination buffer.
- Parameters
-
| destination | The buffer to which to write this value as UTF-8. |
| bytesWritten | The number of bytes written to the destination buffer, or 0 if the buffer is too small. |
- Returns
- true if the value was written to the buffer; otherwise, false.