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

◆ TryParse() [11/16]

static bool System.Buffers.Text.Utf8Parser.TryParse ( ReadOnlySpan< byte > source,
out sbyte value,
out int bytesConsumed,
char standardFormat = '\0' )
inlinestatic

Definition at line 1295 of file Utf8Parser.cs.

1296 {
1297 while (standardFormat != 0)
1298 {
1299 switch (standardFormat | 0x20)
1300 {
1301 case 100:
1302 case 103:
1303 break;
1304 case 110:
1305 return TryParseSByteN(source, out value, out bytesConsumed);
1306 case 120:
1307 Unsafe.SkipInit<sbyte>(out value);
1308 return TryParseByteX(source, out Unsafe.As<sbyte, byte>(ref value), out bytesConsumed);
1309 default:
1310 return ParserHelpers.TryParseThrowFormatException<sbyte>(source, out value, out bytesConsumed);
1311 }
1312 standardFormat = '\0';
1313 }
1314 return TryParseSByteD(source, out value, out bytesConsumed);
1315 }
static bool TryParseSByteN(ReadOnlySpan< byte > source, out sbyte value, out int bytesConsumed)
static bool TryParseByteX(ReadOnlySpan< byte > source, out byte value, out int bytesConsumed)
static bool TryParseSByteD(ReadOnlySpan< byte > source, out sbyte value, out int bytesConsumed)

References System.source, System.Buffers.Text.Utf8Parser.TryParseByteX(), System.Buffers.Text.Utf8Parser.TryParseSByteD(), System.Buffers.Text.Utf8Parser.TryParseSByteN(), System.Buffers.Text.ParserHelpers.TryParseThrowFormatException(), and System.value.