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

◆ ValueAsLong()

long System.Xml.XmlSqlBinaryReader.ValueAsLong ( )
inlineprivate

Definition at line 3399 of file XmlSqlBinaryReader.cs.

3400 {
3402 switch (_token)
3403 {
3404 case BinXmlToken.SQL_BIT:
3405 case BinXmlToken.SQL_TINYINT:
3406 {
3407 byte b2 = _data[_tokDataPos];
3408 return b2;
3409 }
3410 case BinXmlToken.XSD_BYTE:
3411 {
3412 sbyte b = (sbyte)_data[_tokDataPos];
3413 return b;
3414 }
3415 case BinXmlToken.SQL_SMALLINT:
3416 return GetInt16(_tokDataPos);
3417 case BinXmlToken.SQL_INT:
3418 return GetInt32(_tokDataPos);
3419 case BinXmlToken.SQL_BIGINT:
3420 return GetInt64(_tokDataPos);
3421 case BinXmlToken.XSD_UNSIGNEDSHORT:
3422 return GetUInt16(_tokDataPos);
3423 case BinXmlToken.XSD_UNSIGNEDINT:
3424 return GetUInt32(_tokDataPos);
3425 case BinXmlToken.XSD_UNSIGNEDLONG:
3426 {
3427 ulong uInt = GetUInt64(_tokDataPos);
3428 return checked((long)uInt);
3429 }
3430 case BinXmlToken.SQL_REAL:
3431 case BinXmlToken.SQL_FLOAT:
3432 {
3433 double num2 = ValueAsDouble();
3434 return (long)num2;
3435 }
3436 case BinXmlToken.SQL_MONEY:
3437 case BinXmlToken.SQL_DECIMAL:
3438 case BinXmlToken.SQL_NUMERIC:
3439 case BinXmlToken.SQL_SMALLMONEY:
3440 case BinXmlToken.XSD_DECIMAL:
3441 {
3442 decimal num = ValueAsDecimal();
3443 return (long)num;
3444 }
3445 default:
3447 }
3448 }
Exception ThrowUnexpectedToken(BinXmlToken token)

References System.Xml.XmlSqlBinaryReader._data, System.Xml.XmlSqlBinaryReader._tokDataPos, System.Xml.XmlSqlBinaryReader._token, System.Xml.XmlSqlBinaryReader.CheckValueTokenBounds(), System.Xml.Dictionary, System.Xml.XmlSqlBinaryReader.GetInt16(), System.Xml.XmlSqlBinaryReader.GetInt32(), System.Xml.XmlSqlBinaryReader.GetInt64(), System.Xml.XmlSqlBinaryReader.GetUInt16(), System.Xml.XmlSqlBinaryReader.GetUInt32(), System.Xml.XmlSqlBinaryReader.GetUInt64(), System.Xml.XmlSqlBinaryReader.ThrowUnexpectedToken(), System.Xml.XmlSqlBinaryReader.ValueAsDecimal(), and System.Xml.XmlSqlBinaryReader.ValueAsDouble().

Referenced by System.Xml.XmlSqlBinaryReader.ReadContentAsInt(), System.Xml.XmlSqlBinaryReader.ReadContentAsLong(), System.Xml.XmlSqlBinaryReader.ValueAsDecimal(), System.Xml.XmlSqlBinaryReader.ValueAsDouble(), and System.Xml.XmlSqlBinaryReader.ValueAsString().