Skip to main content
Version: 15.x (API 15) [Current]

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​
Declaration
public static class CStringExtensions

Methods​

AsReadOnlySeStringSpan(CStringPointer)​

Convert a CStringPointer to a ReadOnlySeStringSpan.

Declaration
public static ReadOnlySeStringSpan AsReadOnlySeStringSpan(this CStringPointer ptr)
Returns​

Lumina.Text.ReadOnly.ReadOnlySeStringSpan: A span.

Parameters​
TypeNameDescription
InteropGenerator.Runtime.CStringPointerptrThe pointer to convert.

AsDalamudSeString(CStringPointer)​

Convert a CStringPointer to a Dalamud SeString.

Declaration
public static SeString AsDalamudSeString(this CStringPointer ptr)
Returns​

Dalamud.Game.Text.SeStringHandling.SeString: A Dalamud-flavored SeString.

Parameters​
TypeNameDescription
InteropGenerator.Runtime.CStringPointerptrThe pointer to convert.

AsReadOnlySeString(CStringPointer)​

Get a new ReadOnlySeString that's a copy of the text in this CStringPointer.

Declaration
public static ReadOnlySeString AsReadOnlySeString(this CStringPointer ptr)
Returns​

Lumina.Text.ReadOnly.ReadOnlySeString: A new Lumina ReadOnlySeString.

Parameters​
TypeNameDescription
InteropGenerator.Runtime.CStringPointerptrThe 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.

Declaration
public static string ExtractText(this CStringPointer ptr)
Returns​

System.String: Extracted text.

Parameters​
TypeNameDescription
InteropGenerator.Runtime.CStringPointerptrThe CStringPointer to process.