Struct BlobStringText
Simple BlobString wrapper that can be embedded into components and allow to access the blob text as Unity.Collections.IUTF8Bytes and Unity.Collections.INativeList`1. The text is considered readonly. All methods that change or affect the string will throw NotImplementedException.
Inherited Members
Namespace: Unity.Netcode.LowLevel
Assembly: Unity.NetCode.dll
Syntax
[MovedFrom(true, "Unity.NetCode.LowLevel", null, null)]
public struct BlobStringText : INativeList<byte>, IIndexable<byte>, IUTF8Bytes
Constructors
BlobStringText(ref BlobString)
Construct the text from a BlobString reference. The string pointer is cached internally by this wrapper and if the original blob is detroyed, the memory content may point to something that it is not a string.
Declaration
public BlobStringText(ref BlobString blob)
Parameters
| Type | Name | Description |
|---|---|---|
| BlobString | blob | BlobString reference. |
Properties
Capacity
Declaration
public int Capacity { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |
IsEmpty
Whether this IUTF8Bytes is empty.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[int]
Declaration
public byte this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| byte |
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |
Length
Declaration
public int Length { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |
Methods
Clear()
Declaration
public void Clear()
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |
ElementAt(int)
Declaration
public ref byte ElementAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Returns
| Type | Description |
|---|---|
| byte |
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |
GetUnsafePtr()
Returns a pointer to the content of this IUTF8Bytes.
Declaration
public byte* GetUnsafePtr()
Returns
| Type | Description |
|---|---|
| byte* | A pointer to the content of this IUTF8Bytes. |
TryResize(int, NativeArrayOptions)
Attempt to set the length in bytes of this IUTF8Bytes's content buffer.
Declaration
public bool TryResize(int newLength, NativeArrayOptions clearOptions = NativeArrayOptions.ClearMemory)
Parameters
| Type | Name | Description |
|---|---|---|
| int | newLength | The new length in bytes of the IUTF8Bytes's content buffer. |
| NativeArrayOptions | clearOptions | Whether any bytes added should be zeroed out. |
Returns
| Type | Description |
|---|---|
| bool | True if the new length is valid. |
Remarks
Always throw NotImplementedException
Exceptions
| Type | Condition |
|---|---|
| NotImplementedException | Always throw NotImplementedException |