Class CStringExtensions
A set of helpful utilities for working with InteropGenerator.Runtime.CStringPointers from ClientStructs.
Remarks
WARNING: Will break if a custom ClientStructs is used. These are here for CONVENIENCE ONLY!.
Assembly: Dalamud.dll
public static class CStringExtensions
Methods
AsReadOnlySeStringSpan(CStringPointer)
Convert a CStringPointer to a ReadOnlySeStringSpan.
public static ReadOnlySeStringSpan AsReadOnlySeStringSpan(this CStringPointer ptr)
Returns
Lumina.Text.ReadOnly.ReadOnlySeStringSpan: A span.
Parameters
| Type | Name | Description |
|---|---|---|
InteropGenerator.Runtime.CStringPointer | ptr | The pointer to convert. |
AsDalamudSeString(CStringPointer)
Convert a CStringPointer to a Dalamud SeString.
public static SeString AsDalamudSeString(this CStringPointer ptr)
Returns
Dalamud.Game.Text.SeStringHandling.SeString: A Dalamud-flavored SeString.
Parameters
| Type | Name | Description |
|---|---|---|
InteropGenerator.Runtime.CStringPointer | ptr | The pointer to convert. |
AsReadOnlySeString(CStringPointer)
Get a new ReadOnlySeString that's a copy of the text in this CStringPointer.
public static ReadOnlySeString AsReadOnlySeString(this CStringPointer ptr)
Returns
Lumina.Text.ReadOnly.ReadOnlySeString: A new Lumina ReadOnlySeString.
Parameters
| Type | Name | Description |
|---|---|---|
InteropGenerator.Runtime.CStringPointer | ptr | The pointer to copy. |
Remarks
This should be functionally identical to Dalamud.Utility.CStringExtensions.AsReadOnlySeStringSpan(InteropGenerator.Runtime.CStringPointer), but exists for convenience in places that already expect ReadOnlySeString as a type (and where a copy is desired).
ExtractText(CStringPointer)
Extract text from this CStringPointer following Lumina.Text.ReadOnly.ReadOnlySeStringSpan.ExtractText's rules. Only
useful for SeStrings.
public static string ExtractText(this CStringPointer ptr)
Returns
System.String: Extracted text.
Parameters
| Type | Name | Description |
|---|---|---|
InteropGenerator.Runtime.CStringPointer | ptr | The CStringPointer to process. |