Fixed-size UTF32 string. All operations are alloc-free, except for converting to System.String.
More...
Inherits INetworkString, INetworkStruct, IEquatable< NetworkString< Size >>, and IEnumerable< char >.
|
| bool | Get (ref string cache) |
| | Checks if cache is equivalent and if not converts to UTF16 and stores the result in cache . More...
|
| |
| int | GetCharCount () |
| | Calculates the length of the equivalent UTF16 string. More...
|
| |
| bool | Set (string value) |
| | Converts value to UTF32 string and stores it internally. More...
|
| |
|
| int | Capacity [get] |
| | Maximum UTF32 string length. More...
|
| |
| int | Length [get] |
| | Number of UTF32 scalars. It is equal or less than GetCharCount or the length of Value, because those use UTF16 encoding, which needs two characters to encode some values. More...
|
| |
| ref uint | this[int index] [get] |
| | Returns UTF32 scalar at index position. To iterate over characters, use GetEnumerator. More...
|
| |
| string | Value [get, set] |
| | Converts to/from regular UTF16 string. Setter is alloc-free. Use Get(ref string, bool) to get possibly alloc-free conversion. More...
|
| |
Fixed-size UTF32 string. All operations are alloc-free, except for converting to System.String.
- Template Parameters
-
- Type Constraints
-
| Size | : | unmanaged | |
| Size | : | IFixedStorage | |
◆ Get()
| bool Get |
( |
ref string |
cache | ) |
|
Checks if cache is equivalent and if not converts to UTF16 and stores the result in cache .
- Parameters
-
- Returns
- False if no conversion was performed, true otherwise.
◆ GetCharCount()
Calculates the length of the equivalent UTF16 string.
- Returns
◆ Set()
Converts value to UTF32 string and stores it internally.
- Parameters
-
- Returns
- False if value was too long to fit and had to be trimmed.
◆ Capacity
Maximum UTF32 string length.
◆ Length
Number of UTF32 scalars. It is equal or less than GetCharCount or the length of Value, because those use UTF16 encoding, which needs two characters to encode some values.
◆ this[int index]
Returns UTF32 scalar at index position. To iterate over characters, use GetEnumerator.
- Parameters
-
- Returns
◆ Value
Converts to/from regular UTF16 string. Setter is alloc-free. Use Get(ref string, bool) to get possibly alloc-free conversion.