public byte[] GetString(out int offset, out int length) { StringHandleType type = _type; if (type == StringHandleType.UTF8) { offset = _offset; length = _length; return(_bufferReader.Buffer); } if (type == StringHandleType.Dictionary) { byte[] buffer = _bufferReader.GetDictionaryString(_key).ToUTF8(); offset = 0; length = buffer.Length; return(buffer); } if (type == StringHandleType.ConstString) { byte[] buffer = XmlConverter.ToBytes(s_constStrings[_key]); offset = 0; length = buffer.Length; return(buffer); } else { DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8, ""); byte[] buffer = XmlConverter.ToBytes(_bufferReader.GetEscapedString(_offset, _length)); offset = 0; length = buffer.Length; return(buffer); } }
public void SetValue(StringHandle value) { this.type = value.type; this.key = value.key; this.offset = value.offset; this.length = value.length; }
public void SetValue(StringHandle value) { _type = value._type; _key = value._key; _offset = value._offset; _length = value._length; }
public byte[] GetString(out int offset, out int length) { StringHandleType type = this.type; if (type == StringHandleType.UTF8) { offset = this.offset; length = this.length; return(bufferReader.Buffer); } if (type == StringHandleType.Dictionary) { byte[] buffer = bufferReader.GetDictionaryString(this.key).ToUTF8(); offset = 0; length = buffer.Length; return(buffer); } if (type == StringHandleType.ConstString) { byte[] buffer = XmlConverter.ToBytes(constStrings[key]); offset = 0; length = buffer.Length; return(buffer); } else { Fx.Assert(type == StringHandleType.EscapedUTF8, ""); byte[] buffer = XmlConverter.ToBytes(bufferReader.GetEscapedString(this.offset, this.length)); offset = 0; length = buffer.Length; return(buffer); } }
public void SetValue(StringHandle value) { this.type = value.type; this.key = value.key; this.offset = value.offset; this.length = value.length; }
public void SetValue(StringHandle value) { _type = value._type; _key = value._key; _offset = value._offset; _length = value._length; }
public void SetValue(StringHandle value) { type = value.type; key = value.key; offset = value.offset; length = value.length; }
private bool Equals2(StringHandle s2) { StringHandleType type = s2._type; if (type == StringHandleType.Dictionary) { return(Equals2(s2._key, s2._bufferReader)); } if (type == StringHandleType.UTF8) { return(Equals2(s2._offset, s2._length, s2._bufferReader)); } DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(Equals2(s2.GetString())); }
bool Equals2(StringHandle s2) { StringHandleType type = s2.type; if (type == StringHandleType.Dictionary) { return(Equals2(s2.key, s2.bufferReader)); } if (type == StringHandleType.UTF8) { return(Equals2(s2.offset, s2.length, s2.bufferReader)); } Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(Equals2(s2.GetString())); }
bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2) { StringHandleType type = this.type; if (type == StringHandleType.Dictionary) { return(bufferReader2.Equals2(offset2, length2, bufferReader.GetDictionaryString(this.key).Value)); } if (type == StringHandleType.UTF8) { return(bufferReader.Equals2(this.offset, this.length, bufferReader2, offset2, length2)); } Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(GetString() == bufferReader.GetString(offset2, length2)); }
bool Equals2(string s2) { StringHandleType type = this.type; if (type == StringHandleType.Dictionary) { return(bufferReader.GetDictionaryString(this.key).Value == s2); } if (type == StringHandleType.UTF8) { return(bufferReader.Equals2(this.offset, this.length, s2)); } Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(GetString() == s2); }
bool Equals2(XmlDictionaryString xmlString2) { StringHandleType type = this.type; if (type == StringHandleType.Dictionary) { return(bufferReader.Equals2(this.key, xmlString2)); } if (type == StringHandleType.UTF8) { return(bufferReader.Equals2(this.offset, this.length, xmlString2.ToUTF8())); } Fx.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(GetString() == xmlString2.Value); }
private bool Equals2(XmlDictionaryString xmlString2) { StringHandleType type = _type; if (type == StringHandleType.Dictionary) { return(_bufferReader.Equals2(_key, xmlString2)); } if (type == StringHandleType.UTF8) { return(_bufferReader.Equals2(_offset, _length, xmlString2.ToUTF8())); } DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(GetString() == xmlString2.Value); }
private bool Equals2(string s2) { StringHandleType type = _type; if (type == StringHandleType.Dictionary) { return(_bufferReader.GetDictionaryString(_key).Value == s2); } if (type == StringHandleType.UTF8) { return(_bufferReader.Equals2(_offset, _length, s2)); } DiagnosticUtility.DebugAssert(type == StringHandleType.ConstString, ""); return(GetString() == s2); }
private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2) { StringHandleType type = _type; if (type == StringHandleType.Dictionary) { return(bufferReader2.Equals2(offset2, length2, _bufferReader.GetDictionaryString(_key).Value)); } if (type == StringHandleType.UTF8) { return(_bufferReader.Equals2(_offset, _length, bufferReader2, offset2, length2)); } DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(GetString() == _bufferReader.GetString(offset2, length2)); }
public string GetString() { StringHandleType type = _type; if (type == StringHandleType.UTF8) { return(_bufferReader.GetString(_offset, _length)); } if (type == StringHandleType.Dictionary) { return(_bufferReader.GetDictionaryString(_key).Value); } DiagnosticUtility.DebugAssert(type == StringHandleType.ConstString, "Should be ConstString"); //If not Utf8 then the StringHandleType is ConstString return(s_constStrings[_key]); }
public bool Equals([NotNullWhen(true)] StringHandle?other) { if (other is null) { return(false); } StringHandleType type = other._type; if (type == StringHandleType.Dictionary) { return(Equals2(other._key, other._bufferReader)); } if (type == StringHandleType.UTF8) { return(Equals2(other._offset, other._length, other._bufferReader)); } DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, ""); return(Equals2(other.GetString())); }
public string GetString() { StringHandleType type = this.type; if (type == StringHandleType.UTF8) { return(bufferReader.GetString(offset, length)); } if (type == StringHandleType.Dictionary) { return(bufferReader.GetDictionaryString(key).Value); } if (type == StringHandleType.ConstString) { return(constStrings[key]); } Fx.Assert(type == StringHandleType.EscapedUTF8, ""); return(bufferReader.GetEscapedString(offset, length)); }
public string GetString() { StringHandleType type = _type; if (type == StringHandleType.UTF8) { return(_bufferReader.GetString(_offset, _length)); } if (type == StringHandleType.Dictionary) { return(_bufferReader.GetDictionaryString(_key).Value); } if (type == StringHandleType.ConstString) { return(s_constStrings[_key]); } // If none of the above, must be StringHandleType.EscapedUTF8 DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); return(_bufferReader.GetEscapedString(_offset, _length)); }
public void SetValue(int key) { this.type = StringHandleType.Dictionary; this.key = key; }
public void SetValue(int offset, int length, bool escaped) { this.type = (escaped ? StringHandleType.EscapedUTF8 : StringHandleType.UTF8); this.offset = offset; this.length = length; }
public void SetConstantValue(StringHandleConstStringType constStringType) { type = StringHandleType.ConstString; key = (int)constStringType; }
public void SetValue(int offset, int length) { this.type = StringHandleType.UTF8; this.offset = offset; this.length = length; }
public void SetValue(int offset, int length) { _type = StringHandleType.UTF8; _offset = offset; _length = length; }
public void SetValue(StringHandle value) { type = value.type; key = value.key; offset = value.offset; length = value.length; }
public void SetValue(int offset, int length) { this.type = StringHandleType.UTF8; this.offset = offset; this.length = length; }
public void SetValue(int key) { this.type = StringHandleType.Dictionary; this.key = key; }
public void SetValue(int iOffset, int iLength) { type = StringHandleType.UTF8; offset = iOffset; this.length = iLength; }
public void SetValue(int key) { _type = StringHandleType.Dictionary; _key = key; }
public void SetValue(int iOffset, int iLength) { type = StringHandleType.UTF8; offset = iOffset; this.length = iLength; }
public void SetConstantValue(StringHandleConstStringType constStringType) { this.type = StringHandleType.ConstString; this.key = (int)constStringType; }
public void SetValue(int offset, int length) { _type = StringHandleType.UTF8; _offset = offset; _length = length; }
public void SetValue(int offset, int length, bool escaped) { _type = (escaped ? StringHandleType.EscapedUTF8 : StringHandleType.UTF8); _offset = offset; _length = length; }
public void SetValue(int key) { _type = StringHandleType.Dictionary; _key = key; }
public void SetValue(int offset, int length, bool escaped) { this.type = escaped ? StringHandleType.EscapedUTF8 : StringHandleType.UTF8; this.offset = offset; this.length = length; }
public void SetValue(int iOffset, int iLength, bool escaped) { type = escaped ? StringHandleType.EscapedUTF8 : StringHandleType.UTF8; this.offset = iOffset; this.length = iLength; }