Struct UTF8String
Inherited Members
Namespace: WPIUtil
Assembly: FRC.WPIUtil.dll
Syntax
public struct UTF8String
Constructors
| Improve this Doc View SourceUTF8String(ReadOnlySpan<Char>)
Constructs a managed UTF8 string from a C# string
Declaration
public UTF8String(ReadOnlySpan<char> str)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<Char> | str |
UTF8String(String)
Constructs a managed UTF8 string from a C# string
Declaration
public UTF8String(string str)
Parameters
Type | Name | Description |
---|---|---|
String | str |
Properties
| Improve this Doc View SourceBuffer
The buffer to the string. Do not modify this array. Null terminated
Declaration
public byte[] Buffer { get; }
Property Value
Type | Description |
---|---|
Byte[] |
Length
The length of this string, not including the null terminator
Declaration
public UIntPtr Length { get; }
Property Value
Type | Description |
---|---|
UIntPtr |
Methods
| Improve this Doc View SourceReadUTF8String(Byte*)
Reads a UTF8 string from a null termincated native pointer
Declaration
public static string ReadUTF8String(byte *str)
Parameters
Type | Name | Description |
---|---|---|
Byte* | str | The pointer to read from (must be null terminated) |
Returns
Type | Description |
---|---|
String | The managed string |
ReadUTF8String(Byte*, Int32)
Reads a UTF8 string from a native pointer.
Declaration
public static string ReadUTF8String(byte *str, int size)
Parameters
Type | Name | Description |
---|---|---|
Byte* | str | The pointer to read from |
Int32 | size | The length of the string |
Returns
Type | Description |
---|---|
String | The managed string |
ReadUTF8String(Byte*, UIntPtr)
Reads a UTF8 string from a native pointer.
Declaration
public static string ReadUTF8String(byte *str, UIntPtr size)
Parameters
Type | Name | Description |
---|---|---|
Byte* | str | The pointer to read from |
UIntPtr | size | The length of the string |
Returns
Type | Description |
---|---|
String | The managed string |