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

◆ BinXmlSqlDecimal()

System.Xml.BinXmlSqlDecimal.BinXmlSqlDecimal ( byte[] data,
int offset,
bool trim )
inline

Definition at line 25 of file BinXmlSqlDecimal.cs.

26 {
27 m_bLen = data[offset] switch
28 {
29 7 => 1,
30 11 => 2,
31 15 => 3,
32 19 => 4,
33 _ => throw new XmlException(System.SR.XmlBinary_InvalidSqlDecimal, (string[])null),
34 };
35 m_bPrec = data[offset + 1];
36 m_bScale = data[offset + 2];
37 m_bSign = ((data[offset + 3] == 0) ? ((byte)1) : ((byte)0));
38 m_data1 = UIntFromByteArray(data, offset + 4);
39 m_data2 = ((m_bLen > 1) ? UIntFromByteArray(data, offset + 8) : 0u);
40 m_data3 = ((m_bLen > 2) ? UIntFromByteArray(data, offset + 12) : 0u);
41 m_data4 = ((m_bLen > 3) ? UIntFromByteArray(data, offset + 16) : 0u);
42 if (m_bLen == 4 && m_data4 == 0)
43 {
44 m_bLen = 3;
45 }
46 if (m_bLen == 3 && m_data3 == 0)
47 {
48 m_bLen = 2;
49 }
50 if (m_bLen == 2 && m_data2 == 0)
51 {
52 m_bLen = 1;
53 }
54 if (trim)
55 {
57 }
58 }
static string XmlBinary_InvalidSqlDecimal
Definition SR.cs:1368
Definition SR.cs:7
static uint UIntFromByteArray(byte[] data, int offset)

References System.Xml.Dictionary, System.Xml.BinXmlSqlDecimal.m_bLen, System.Xml.BinXmlSqlDecimal.m_bPrec, System.Xml.BinXmlSqlDecimal.m_bScale, System.Xml.BinXmlSqlDecimal.m_bSign, System.Xml.BinXmlSqlDecimal.m_data1, System.Xml.BinXmlSqlDecimal.m_data2, System.Xml.BinXmlSqlDecimal.m_data3, System.Xml.BinXmlSqlDecimal.m_data4, System.offset, System.Xml.BinXmlSqlDecimal.TrimTrailingZeros(), System.Xml.BinXmlSqlDecimal.UIntFromByteArray(), System.SR.XmlBinary_InvalidSqlDecimal, and System.Xml.XmlException.