Class FixedStringMethods
Inheritance
FixedStringMethods
Syntax
public static class FixedStringMethods : object
Methods
Append<T>(ref T, Byte*, Int32)
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, byte *utf8Bytes, int utf8BytesLength)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
A FixedString-like type.
|
Byte* |
utf8Bytes |
UTF-8 encoded string.
|
Int32 |
utf8BytesLength |
UTF-8 string length in bytes.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
Append<T>(ref T, Char)
Append a character to this IUTF8Bytes.
Declaration
public static FormatError Append<T>(this ref T fs, char ch)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
A FixedString-like type.
|
Char |
ch |
The char to append.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type
|
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
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type
|
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
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type
|
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
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type.
|
String |
s |
The string to append.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type
|
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
Name |
Description |
T |
The type of the elements in the container.
|
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 |
A FixedString-like type
|
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
Name |
Description |
T |
The type of the elements in the container.
|
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 rune)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
A FixedString-like type.
|
Unicode.Rune |
rune |
The Unicode.Rune to append.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
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 |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
Append<T, T2>(ref T, T2)
Appends two different types of FixedString.
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 |
A FixedString-like type.
|
T2 |
inputIn |
A FixedString-like type.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
T2 |
The type of the elements in the container.
|
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 |
A FixedString-like type.
|
Byte |
a |
The byte to append.
|
Returns
Type |
Description |
FormatError |
An error code, if any, in the case that the append fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
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)
Copies the string to FixedString.
Declaration
public static CopyError CopyFrom<T>(this ref T fs, string s)
where T : struct, INativeList<byte>, IUTF8Bytes
Parameters
Type |
Name |
Description |
T |
fs |
A FixedString-like type.
|
String |
s |
The string to copy.
|
Returns
Type |
Description |
CopyError |
An error code, if any, in the case that the copy fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
CopyFrom<T, T2>(ref T, T2)
Copies between two different types of FixedString.
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 |
A FixedString-like type.
|
T2 |
input |
A FixedString-like type.
|
Returns
Type |
Description |
CopyError |
An error code, if any, in the case that the copy fails.
|
Type Parameters
Name |
Description |
T |
The type of the elements in the container.
|
T2 |
The type of the elements in the container.
|
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
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 = null)
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 = null)
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 = null)
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 = null)
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, updated if a value is parsed.
|
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(), with the following exceptions:
-
Values which overflow return ParseError.Overflow rather than assigning "Infinity"
-
Values which underflow return ParseError.Underflow rather than assigning "0"
-
Values in exponent form 1e-39 to 1e-45 will be considered underflowed values rather than parsing as
greater than 0 in order to avoid creating floating point numbers that may generate unexpected
denormal problems in user code.
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
Parse<T>(ref T, ref Int32, ref UInt32)
Parse a uint from this string, at the given byte offset. The resulting value
is intended to be bitwise-identical to the output of uint.Parse().
Declaration
public static ParseError Parse<T>(this ref T fs, ref int offset, ref uint 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, updated if a value is parsed.
|
UInt32 |
output |
The uint parsed, if any.
|
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