Class FixedStringMethods
Inheritance
FixedStringMethods
Syntax
public static class FixedStringMethods
Methods
Append<T>(ref T, Byte*, Int32)
Declaration
public static FormatError Append<T>(this ref T fs, byte *utf8Bytes, int utf8BytesLength)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte* |
utf8Bytes |
|
Int32 |
utf8BytesLength |
|
Returns
Type Parameters
Append<T>(ref T, Char)
Append a character to this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, char a)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Char |
a |
|
Returns
Type Parameters
Append<T>(ref T, Int32)
Append the UTF-8 representation of a given integer to the contents of this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, int input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
input |
The long integer to append as UTF-8 to the contents of this IUTF8Bytes
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Append<T>(ref T, Int64)
Append the UTF-8 representation of a given long integer to the contents of this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, long input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int64 |
input |
The long integer to append as UTF-8 to the contents of this IUTF8Bytes
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Append<T>(ref T, Single, Char)
Append the UTF-8 representation of a given float to the contents of this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, float input, char decimalSeparator = '.')
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Single |
input |
The float to append as UTF-8 to the contents of this IUTF8Bytes
|
Char |
decimalSeparator |
The character used to separate the integral part from the fractional part.
A period by default.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the format fails.
|
Type Parameters
Append<T>(ref T, String)
Declaration
public static FormatError Append<T>(this ref T fs, string s)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
String |
s |
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Append<T>(ref T, UInt32)
Append the UTF-8 representation of a given unsigned integer to the contents of this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, uint input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
UInt32 |
input |
The long integer to append as UTF-8 to the contents of this IUTF8Bytes
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Append<T>(ref T, UInt64)
Append the UTF-8 representation of a given unsigned long integer to the contents of this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, ulong input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
UInt64 |
input |
The long integer to append as UTF-8 to the contents of this IUTF8Bytes
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Append<T>(ref T, Unicode.Rune)
Append the given Unicode code point to this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, Unicode.Rune a)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type Parameters
Append<T>(ref T, Unicode.Rune, Int32)
Append the given Unicode.Rune to this FixedString repeated count times.
Declaration
public static FormatError Append<T>(this ref T fs, Unicode.Rune rune, int count)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
A FixedString-like type
|
Unicode.Rune |
rune |
The Unicode.Rune to repeat
|
Int32 |
count |
The number of times to repeat the Unicode.Rune
|
Returns
Type Parameters
Append<T, T2>(ref T, T2)
Declaration
public static FormatError Append<T, T2>(this ref T fs, in T2 inputIn)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
inputIn |
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4, in T5 arg5, in T6 arg6, in T7 arg7)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes where T5 : struct, INativeList<byte>, IUTF8Bytes where T6 : struct, INativeList<byte>, IUTF8Bytes where T7 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
T5 |
arg5 |
|
T6 |
arg6 |
|
T7 |
arg7 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
T6 |
|
T7 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7, T8>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4, in T5 arg5, in T6 arg6, in T7 arg7, in T8 arg8)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes where T5 : struct, INativeList<byte>, IUTF8Bytes where T6 : struct, INativeList<byte>, IUTF8Bytes where T7 : struct, INativeList<byte>, IUTF8Bytes where T8 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
T5 |
arg5 |
|
T6 |
arg6 |
|
T7 |
arg7 |
|
T8 |
arg8 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
T6 |
|
T7 |
|
T8 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4, in T5 arg5, in T6 arg6, in T7 arg7, in T8 arg8, in T9 arg9)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes where T5 : struct, INativeList<byte>, IUTF8Bytes where T6 : struct, INativeList<byte>, IUTF8Bytes where T7 : struct, INativeList<byte>, IUTF8Bytes where T8 : struct, INativeList<byte>, IUTF8Bytes where T9 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
T5 |
arg5 |
|
T6 |
arg6 |
|
T7 |
arg7 |
|
T8 |
arg8 |
|
T9 |
arg9 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
T6 |
|
T7 |
|
T8 |
|
T9 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0>(this ref T dest, in U format, in T0 arg0)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
Type Parameters
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1>(this ref T dest, in U format, in T0 arg0, in T1 arg1)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4, T5>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4, in T5 arg5)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes where T5 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
T5 |
arg5 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
Convenience function to append a formatted string into the given FixedString.
Similar to StringBuilder.AppendFormat, with significant limitations:
- only supports FixedStringN arguments (convert arguments to FixedString first)
- only supports numeric format placeholders of the form "{0}" .. "{N}"
- no format modifiers (e.g. "{0:x}") are supported
Declaration
public static void AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6>(this ref T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4, in T5 arg5, in T6 arg6)
where T : struct, INativeList<byte>, IUTF8Bytes where U : struct, INativeList<byte>, IUTF8Bytes where T0 : struct, INativeList<byte>, IUTF8Bytes where T1 : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes where T3 : struct, INativeList<byte>, IUTF8Bytes where T4 : struct, INativeList<byte>, IUTF8Bytes where T5 : struct, INativeList<byte>, IUTF8Bytes where T6 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
dest |
|
U |
format |
|
T0 |
arg0 |
|
T1 |
arg1 |
|
T2 |
arg2 |
|
T3 |
arg3 |
|
T4 |
arg4 |
|
T5 |
arg5 |
|
T6 |
arg6 |
|
Type Parameters
Name |
Description |
T |
|
U |
|
T0 |
|
T1 |
|
T2 |
|
T3 |
|
T4 |
|
T5 |
|
T6 |
|
AppendRawByte<T>(ref T, Byte)
Append a raw byte to this IUTF8Bytes.
Declaration
public static FormatError AppendRawByte<T>(this ref T fs, byte a)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte |
a |
|
Returns
Type Parameters
CompareTo<T>(ref T, Byte*, Int32)
Compare this string to the given byte run. Return an integer that indicates whether this
instance precedes the given parameter (less than 0), is equal to the given parameter (0), or comes
after the given parameter (greater than 0).
Declaration
public static int CompareTo<T>(this ref T fs, byte *bytes, int bytesLen)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte* |
bytes |
|
Int32 |
bytesLen |
|
Returns
Type Parameters
CompareTo<T, T2>(ref T, T2)
Compare this string to the given FixedString. Return an integer that indicates whether this
instance precedes the given parameter (less than 0), is equal to the given parameter (0), or comes
after the given parameter (greater than 0).
Declaration
public static int CompareTo<T, T2>(this ref T fs, in T2 other)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Returns
Type Parameters
ComputeHashCode<T>(ref T)
Compute a hashcode for this FixedString.
Declaration
public static int ComputeHashCode<T>(this ref T fs)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Returns
Type Parameters
Contains<T, T2>(ref T, T2)
Search this string for the given other FixedString. Return
a boolean indicating whether it was found.
Declaration
public static bool Contains<T, T2>(this ref T fs, in T2 other)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Returns
Type Parameters
ConvertToString<T>(ref T)
Convert this FixedString to a System.String.
Declaration
public static string ConvertToString<T>(this ref T fs)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Returns
Type Parameters
CopyFrom<T>(ref T, String)
Declaration
public static CopyError CopyFrom<T>(this ref T fs, string s)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
String |
s |
|
Returns
Type Parameters
CopyFrom<T, T2>(ref T, T2)
Declaration
public static CopyError CopyFrom<T, T2>(this ref T fs, in T2 input)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
input |
|
Returns
Type Parameters
EffectiveSizeOf<T>(ref T)
Returns the effective size of this struct in bytes, considering only the bytes that
are actually used to hold data. Since the string may be shorter or longer, the
effective size may be smaller than the UnsafeUtility.SizeOf() sizeof. The first byte
after the effective size is always 0, unless this FixedString's storage is malformed.
Any following bytes are undefined.
Declaration
public static int EffectiveSizeOf<T>(this ref T fs)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Returns
Type |
Description |
Int32 |
The effective size of this struct in bytes.
|
Type Parameters
Equals<T>(ref T, Byte*, Int32)
Compare this string to the given byte run. Return whether they are equal.
Declaration
public static bool Equals<T>(this ref T fs, byte *bytes, int bytesLen)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte* |
bytes |
|
Int32 |
bytesLen |
|
Returns
Type Parameters
Equals<T, T2>(ref T, T2)
Compare this string to the given FixedString. Return whether they are equal.
Declaration
public static bool Equals<T, T2>(this ref T fs, in T2 other)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Returns
Type Parameters
Declaration
public static FormatError Format<T>(this ref T fs, int input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
input |
|
Returns
Type Parameters
Declaration
public static FormatError Format<T>(this ref T fs, long input)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int64 |
input |
|
Returns
Type Parameters
Declaration
public static FormatError Format<T>(this ref T fs, float input, char decimalSeparator = '.')
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Single |
input |
|
Char |
decimalSeparator |
|
Returns
Type Parameters
IndexOf<T>(ref T, Byte*, Int32)
Search this string for the first occurrence of a given run of bytes
and return the index of where it was found, if any. Return -1 if not found.
Declaration
public static int IndexOf<T>(this ref T fs, byte *bytes, int bytesLen)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte* |
bytes |
|
Int32 |
bytesLen |
|
Returns
Type Parameters
IndexOf<T>(ref T, Byte*, Int32, Int32, Int32)
Search this string for the first occurrence of a given run of bytes
and return the index of where it was found, if any. Return -1 if not found.
The search starts at the given startIndex and goes for an optional distance.
Declaration
public static int IndexOf<T>(this ref T fs, byte *bytes, int bytesLen, int startIndex, int distance = 2147483647)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type Parameters
IndexOf<T, T2>(ref T, T2)
Search this string for the first occurrence of another FixedString
and return the index of where it was found, if any. Return -1 if not found.
Declaration
public static int IndexOf<T, T2>(this ref T fs, in T2 other)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Returns
Type Parameters
IndexOf<T, T2>(ref T, T2, Int32, Int32)
Search this string for the first occurrence of another FixedString
and return the index of where it was found, if any. Return -1 if not found.
The search starts at the given startIndex and goes for an optional distance.
Declaration
public static int IndexOf<T, T2>(this ref T fs, in T2 other, int startIndex, int distance = 2147483647)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Int32 |
startIndex |
|
Int32 |
distance |
|
Returns
Type Parameters
LastIndexOf<T>(ref T, Byte*, Int32)
Search this string backwards for the last occurrence of a given run of bytes
and return the index of where it was found, if any. Return -1 if not found.
Declaration
public static int LastIndexOf<T>(this ref T fs, byte *bytes, int bytesLen)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Byte* |
bytes |
|
Int32 |
bytesLen |
|
Returns
Type Parameters
LastIndexOf<T>(ref T, Byte*, Int32, Int32, Int32)
Search this string backwards for the last occurrence of a given run of bytes
and return the index of where it was found, if any. Return -1 if not found.
The search starts at the given startIndex, and goes backwards for the given distance.
Declaration
public static int LastIndexOf<T>(this ref T fs, byte *bytes, int bytesLen, int startIndex, int distance = 2147483647)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type Parameters
LastIndexOf<T, T2>(ref T, T2)
Search this string backwards for the last occurrence of another FixedString
and return the index of where it was found, if any. Return -1 if not found.
Declaration
public static int LastIndexOf<T, T2>(this ref T fs, in T2 other)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Returns
Type Parameters
LastIndexOf<T, T2>(ref T, T2, Int32, Int32)
Search this string backwards for the last occurrence of another FixedString
and return the index of where it was found, if any. Return -1 if not found.
The search starts at the given startIndex and goes for an optional distance.
Declaration
public static int LastIndexOf<T, T2>(this ref T fs, in T2 other, int startIndex, int distance = 2147483647)
where T : struct, INativeList<byte>, IUTF8Bytes where T2 : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
T2 |
other |
|
Int32 |
startIndex |
|
Int32 |
distance |
|
Returns
Type Parameters
Parse<T>(ref T, ref Int32, ref Int32)
Parse an int from this string, at the given byte offset. The resulting value
is intended to be bitwise-identical to the output of int.Parse().
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref int output)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
offset |
The zero-based byte offset from the beginning of the string.
|
Int32 |
output |
The int parsed, if any.
|
Returns
Type |
Description |
ParseError |
An error code, if any, in the case that the parse fails.
|
Type Parameters
Parse<T>(ref T, ref Int32, ref Single, Char)
Parse a float from this string, at the byte offset indicated. The resulting float
is intended to be bitwise-identical to the output of System.Single.Parse().
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref float output, char decimalSeparator = '.')
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
offset |
The zero-based byte offset from the beginning of the string.
|
Single |
output |
The float parsed, if any.
|
Char |
decimalSeparator |
The character used to separate the integral part from the fractional part.
Defaults to a period.
|
Returns
Type |
Description |
ParseError |
An error code, if any, in the case that the parse fails.
|
Type Parameters
Peek<T>(ref T, Int32)
Read a Unicode.Rune at the given byte offset in this string. This function
will decode any utf8 encoding found at that offset and return the actual Unicode codepoint value.
If the offset is invalid or a conversion error occurs, Unicode.BadRune is returned.
Declaration
public static Unicode.Rune Peek<T>(this ref T fs, int offset)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
offset |
|
Returns
Type Parameters
Read<T>(ref T, ref Int32)
Read a Unicode.Rune at the given byte offset in this string, and increment offset by the
number of bytes that the rune at that offset occupied. This function
will decode any utf8 encoding found at that offset and return the actual Unicode
codepoint value. Calling this function until it returns Unicode.BadRune
allows for iterating through unicode code points in the FixedString.
If the offset is invalid or a conversion error occurs, Unicode.BadRune is returned.
Declaration
public static Unicode.Rune Read<T>(this ref T fs, ref int offset)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
|
Int32 |
offset |
|
Returns
Type Parameters
Write<T>(ref T, ref Int32, Unicode.Rune)
Write a Unicode.Rune at the given byte offset in this string, and increment offset by the
number of bytes that the rune occupies when encoded as UTF-8.
If the offset is invalid or if there is not enough space to encode the rune, FormatError.Overflow
is returned.
Declaration
public static FormatError Write<T>(this ref T fs, ref int offset, Unicode.Rune rune)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type Parameters