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

◆ TryFormatInt64()

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

Definition at line 832 of file Utf8Formatter.cs.

833 {
834 if (format.IsDefault)
835 {
836 return TryFormatInt64Default(value, destination, out bytesWritten);
837 }
838 switch (format.Symbol)
839 {
840 case 'G':
841 case 'g':
842 if (format.HasPrecision)
843 {
844 throw new NotSupportedException(SR.Argument_GWithPrecisionNotSupported);
845 }
846 return TryFormatInt64D(value, format.Precision, destination, out bytesWritten);
847 case 'D':
848 case 'd':
849 return TryFormatInt64D(value, format.Precision, destination, out bytesWritten);
850 case 'N':
851 case 'n':
852 return TryFormatInt64N(value, format.Precision, destination, out bytesWritten);
853 case 'x':
854 return TryFormatUInt64X((ulong)value & mask, format.Precision, useLower: true, destination, out bytesWritten);
855 case 'X':
856 return TryFormatUInt64X((ulong)value & mask, format.Precision, useLower: false, destination, out bytesWritten);
857 default:
858 return FormattingHelpers.TryFormatThrowFormatException(out bytesWritten);
859 }
860 }
static bool TryFormatInt64D(long value, byte precision, Span< byte > destination, out int bytesWritten)
static bool TryFormatUInt64X(ulong value, byte precision, bool useLower, Span< byte > destination, out int bytesWritten)
static bool TryFormatInt64N(long value, byte precision, Span< byte > destination, out int bytesWritten)
static bool TryFormatInt64Default(long value, Span< byte > destination, out int bytesWritten)

References System.SR.Argument_GWithPrecisionNotSupported, System.destination, System.format, System.Buffers.Text.Utf8Formatter.TryFormatInt64D(), System.Buffers.Text.Utf8Formatter.TryFormatInt64Default(), System.Buffers.Text.Utf8Formatter.TryFormatInt64N(), System.Buffers.Text.FormattingHelpers.TryFormatThrowFormatException(), 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().