Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryFormatUInt64()

static bool System.Buffers.Text.Utf8Formatter.TryFormatUInt64 ( ulong value,
Span< byte > destination,
out int bytesWritten,
StandardFormat format )
inlinestaticprivate

Definition at line 918 of file Utf8Formatter.cs.

919 {
920 if (format.IsDefault)
921 {
922 return TryFormatUInt64Default(value, destination, out bytesWritten);
923 }
924 switch (format.Symbol)
925 {
926 case 'G':
927 case 'g':
928 if (format.HasPrecision)
929 {
930 throw new NotSupportedException(SR.Argument_GWithPrecisionNotSupported);
931 }
932 return TryFormatUInt64D(value, format.Precision, destination, insertNegationSign: false, out bytesWritten);
933 case 'D':
934 case 'd':
935 return TryFormatUInt64D(value, format.Precision, destination, insertNegationSign: false, out bytesWritten);
936 case 'N':
937 case 'n':
938 return TryFormatUInt64N(value, format.Precision, destination, insertNegationSign: false, out bytesWritten);
939 case 'x':
940 return TryFormatUInt64X(value, format.Precision, useLower: true, destination, out bytesWritten);
941 case 'X':
942 return TryFormatUInt64X(value, format.Precision, useLower: false, destination, out bytesWritten);
943 default:
944 return FormattingHelpers.TryFormatThrowFormatException(out bytesWritten);
945 }
946 }
static bool TryFormatUInt64N(ulong value, byte precision, Span< byte > destination, bool insertNegationSign, out int bytesWritten)
static bool TryFormatUInt64X(ulong value, byte precision, bool useLower, Span< byte > destination, out int bytesWritten)
static bool TryFormatUInt64Default(ulong value, Span< byte > destination, out int bytesWritten)
static bool TryFormatUInt64D(ulong value, byte precision, Span< byte > destination, bool insertNegationSign, out int bytesWritten)

References System.SR.Argument_GWithPrecisionNotSupported, System.destination, System.format, System.Buffers.Text.FormattingHelpers.TryFormatThrowFormatException(), System.Buffers.Text.Utf8Formatter.TryFormatUInt64D(), System.Buffers.Text.Utf8Formatter.TryFormatUInt64Default(), System.Buffers.Text.Utf8Formatter.TryFormatUInt64N(), System.Buffers.Text.Utf8Formatter.TryFormatUInt64X(), and System.value.

Referenced by System.Buffers.Text.Utf8Formatter.TryFormat(), System.Buffers.Text.Utf8Formatter.TryFormat(), System.Buffers.Text.Utf8Formatter.TryFormat(), and System.Buffers.Text.Utf8Formatter.TryFormat().