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

◆ ReadDictionaryKey()

int System.Xml.XmlBufferReader.ReadDictionaryKey ( )
inline

Definition at line 1157 of file XmlBufferReader.cs.

1158 {
1159 int num = ReadMultiByteUInt31();
1160 if (((uint)num & (true ? 1u : 0u)) != 0)
1161 {
1162 if (_session == null)
1163 {
1164 XmlExceptionHelper.ThrowInvalidBinaryFormat(_reader);
1165 }
1166 int num2 = num >> 1;
1167 if (!_session.TryLookup(num2, out XmlDictionaryString _))
1168 {
1169 if (num2 < 0 || num2 > 536870911)
1170 {
1171 XmlExceptionHelper.ThrowXmlDictionaryStringIDOutOfRange(_reader);
1172 }
1173 XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedSession(_reader, num2);
1174 }
1175 }
1176 else
1177 {
1178 if (_dictionary == null)
1179 {
1180 XmlExceptionHelper.ThrowInvalidBinaryFormat(_reader);
1181 }
1182 int num3 = num >> 1;
1183 if (!_dictionary.TryLookup(num3, out XmlDictionaryString _))
1184 {
1185 if (num3 < 0 || num3 > 536870911)
1186 {
1187 XmlExceptionHelper.ThrowXmlDictionaryStringIDOutOfRange(_reader);
1188 }
1189 XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedStatic(_reader, num3);
1190 }
1191 }
1192 return num;
1193 }
bool TryLookup(int key, [NotNullWhen(true)] out XmlDictionaryString? result)
readonly XmlDictionaryReader _reader
XmlBinaryReaderSession _session
bool TryLookup(string value, [NotNullWhen(true)] out XmlDictionaryString? result)

References System.Xml.XmlBufferReader._dictionary, System.Xml.XmlBufferReader._reader, System.Xml.XmlBufferReader._session, System.Xml.Dictionary, System.Xml.XmlBufferReader.ReadMultiByteUInt31(), System.Xml.XmlExceptionHelper.ThrowInvalidBinaryFormat(), System.Xml.XmlExceptionHelper.ThrowXmlDictionaryStringIDOutOfRange(), System.Xml.XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedSession(), System.Xml.XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedStatic(), System.Xml.XmlBinaryReaderSession.TryLookup(), and System.Xml.IXmlDictionary.TryLookup().

Referenced by System.Xml.XmlBufferReader.ReadQName(), and System.Xml.XmlBufferReader.ReadValue().