//------------------------------------------------------------------------------ // // This code was generated by a tool. // // TextTransform Samples/Packages/com.unity.collections/Unity.Collections/FixedStringFormatMethods.tt // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System; using Unity.Collections.LowLevel.Unsafe; namespace Unity.Collections { /// /// Provides extension methods for FixedString*N*Bytes. /// public unsafe static partial class FixedStringMethods { /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/) })] public static unsafe void AppendFormat(ref this T dest, in U format, in T0 arg0) where T : struct, INativeList, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/) })] public static unsafe void AppendFormat(ref this T dest, in U format, in T0 arg0, in T1 arg1) where T : struct, INativeList, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/) })] public static unsafe void AppendFormat(ref this T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2) where T : struct, INativeList, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/) })] public static unsafe void AppendFormat(ref this T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3) where T : struct, INativeList, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/) })] public static unsafe void AppendFormat(ref this T dest, in U format, in T0 arg0, in T1 arg1, in T2 arg2, in T3 arg3, in T4 arg4) where T : struct, INativeList, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/), typeof(FixedString128Bytes /*T5*/) })] public static unsafe void AppendFormat(ref this 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, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes where T5 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; case 5: dest.Append(in arg5); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/), typeof(FixedString128Bytes /*T5*/), typeof(FixedString128Bytes /*T6*/) })] public static unsafe void AppendFormat(ref this 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, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes where T5 : struct, INativeList, IUTF8Bytes where T6 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; case 5: dest.Append(in arg5); i+=2; break; case 6: dest.Append(in arg6); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/), typeof(FixedString128Bytes /*T5*/), typeof(FixedString128Bytes /*T6*/), typeof(FixedString128Bytes /*T7*/) })] public static unsafe void AppendFormat(ref this 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, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes where T5 : struct, INativeList, IUTF8Bytes where T6 : struct, INativeList, IUTF8Bytes where T7 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; case 5: dest.Append(in arg5); i+=2; break; case 6: dest.Append(in arg6); i+=2; break; case 7: dest.Append(in arg7); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/), typeof(FixedString128Bytes /*T5*/), typeof(FixedString128Bytes /*T6*/), typeof(FixedString128Bytes /*T7*/), typeof(FixedString128Bytes /*T8*/) })] public static unsafe void AppendFormat(ref this 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, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes where T5 : struct, INativeList, IUTF8Bytes where T6 : struct, INativeList, IUTF8Bytes where T7 : struct, INativeList, IUTF8Bytes where T8 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; case 5: dest.Append(in arg5); i+=2; break; case 6: dest.Append(in arg6); i+=2; break; case 7: dest.Append(in arg7); i+=2; break; case 8: dest.Append(in arg8); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } /// /// Interpolates strings into a format string and appends the result to this string. /// /// /// Similar to `StringBuilder.AppendFormat` but with significant limitations: /// - Only supports FixedString*N*Bytes arguments. To use other string types, convert them to FixedString*N*Bytes first. /// - Only supports numeric format placeholders of the form `{0}` .. `{N}`. /// - No format modifiers (*e.g.* `{0:x}`) are supported. /// /// The overloads of this method take up to ten strings to interpolate into the format string. /// /// A FixedString*N*Bytes type. /// A FixedString*N*Bytes type. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The type of value to interpolate into the format string. /// The string to append to.d /// A string to be interpolated and appended. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. /// A FixedString*N*Bytes to interpolate into the format string. [BurstCompatible(GenericTypeArguments = new[] { typeof(FixedString128Bytes /*T*/), typeof(FixedString128Bytes /*U*/), typeof(FixedString128Bytes /*T0*/), typeof(FixedString128Bytes /*T1*/), typeof(FixedString128Bytes /*T2*/), typeof(FixedString128Bytes /*T3*/), typeof(FixedString128Bytes /*T4*/), typeof(FixedString128Bytes /*T5*/), typeof(FixedString128Bytes /*T6*/), typeof(FixedString128Bytes /*T7*/), typeof(FixedString128Bytes /*T8*/), typeof(FixedString128Bytes /*T9*/) })] public static unsafe void AppendFormat(ref this 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, IUTF8Bytes where U : struct, INativeList, IUTF8Bytes where T0 : struct, INativeList, IUTF8Bytes where T1 : struct, INativeList, IUTF8Bytes where T2 : struct, INativeList, IUTF8Bytes where T3 : struct, INativeList, IUTF8Bytes where T4 : struct, INativeList, IUTF8Bytes where T5 : struct, INativeList, IUTF8Bytes where T6 : struct, INativeList, IUTF8Bytes where T7 : struct, INativeList, IUTF8Bytes where T8 : struct, INativeList, IUTF8Bytes where T9 : struct, INativeList, IUTF8Bytes { ref var formatRef = ref UnsafeUtilityExtensions.AsRef(in format); int formatLength = formatRef.Length; byte* formatBytes = formatRef.GetUnsafePtr(); for (var i = 0; i < formatLength; ++i) { if (formatBytes[i] == (byte)'{') { if (formatLength - i >= 3 && formatBytes[i + 1] != (byte)'{') { var index = formatBytes[i + 1] - (byte)'0'; switch (index) { case 0: dest.Append(in arg0); i+=2; break; case 1: dest.Append(in arg1); i+=2; break; case 2: dest.Append(in arg2); i+=2; break; case 3: dest.Append(in arg3); i+=2; break; case 4: dest.Append(in arg4); i+=2; break; case 5: dest.Append(in arg5); i+=2; break; case 6: dest.Append(in arg6); i+=2; break; case 7: dest.Append(in arg7); i+=2; break; case 8: dest.Append(in arg8); i+=2; break; case 9: dest.Append(in arg9); i+=2; break; default: dest.AppendRawByte(formatBytes[i]); break; } } } else dest.AppendRawByte(formatBytes[i]); } } } }