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

◆ TryParse() [16/16]

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

Definition at line 2292 of file Utf8Parser.cs.

2293 {
2294 while (standardFormat != 0)
2295 {
2296 switch (standardFormat | 0x20)
2297 {
2298 case 100:
2299 case 103:
2300 break;
2301 case 110:
2302 return TryParseUInt16N(source, out value, out bytesConsumed);
2303 case 120:
2304 return TryParseUInt16X(source, out value, out bytesConsumed);
2305 default:
2306 return ParserHelpers.TryParseThrowFormatException<ushort>(source, out value, out bytesConsumed);
2307 }
2308 standardFormat = '\0';
2309 }
2310 return TryParseUInt16D(source, out value, out bytesConsumed);
2311 }
static bool TryParseUInt16D(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParseUInt16X(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)
static bool TryParseUInt16N(ReadOnlySpan< byte > source, out ushort value, out int bytesConsumed)

References System.source, System.Buffers.Text.ParserHelpers.TryParseThrowFormatException(), System.Buffers.Text.Utf8Parser.TryParseUInt16D(), System.Buffers.Text.Utf8Parser.TryParseUInt16N(), System.Buffers.Text.Utf8Parser.TryParseUInt16X(), and System.value.