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

◆ TryParse() [12/16]

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

Definition at line 1317 of file Utf8Parser.cs.

1318 {
1319 while (standardFormat != 0)
1320 {
1321 switch (standardFormat | 0x20)
1322 {
1323 case 100:
1324 case 103:
1325 break;
1326 case 110:
1327 return TryParseInt16N(source, out value, out bytesConsumed);
1328 case 120:
1329 Unsafe.SkipInit<short>(out value);
1330 return TryParseUInt16X(source, out Unsafe.As<short, ushort>(ref value), out bytesConsumed);
1331 default:
1332 return ParserHelpers.TryParseThrowFormatException<short>(source, out value, out bytesConsumed);
1333 }
1334 standardFormat = '\0';
1335 }
1336 return TryParseInt16D(source, out value, out bytesConsumed);
1337 }
static bool TryParseInt16N(ReadOnlySpan< byte > source, out short value, out int bytesConsumed)
static bool TryParseUInt16X(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParseInt16D(ReadOnlySpan< byte > source, out short value, out int bytesConsumed)

References System.source, System.Buffers.Text.Utf8Parser.TryParseInt16D(), System.Buffers.Text.Utf8Parser.TryParseInt16N(), System.Buffers.Text.ParserHelpers.TryParseThrowFormatException(), System.Buffers.Text.Utf8Parser.TryParseUInt16X(), and System.value.