public virtual void Close() { this._currentState = JsonReader.State.Closed; this._token = JsonToken.None; this._value = null; this._valueType = null; }
protected void SetStateBasedOnCurrent() { JsonContainerType jsonContainerType = this.Peek(); switch (jsonContainerType) { case JsonContainerType.None: this.SetFinished(); break; case JsonContainerType.Object: this._currentState = JsonReader.State.Object; break; case JsonContainerType.Array: this._currentState = JsonReader.State.Array; break; case JsonContainerType.Constructor: this._currentState = JsonReader.State.Constructor; break; default: throw JsonReaderException.Create(this, "While setting the reader state back to current object an unexpected JsonType was encountered: {0}" .FormatWith((IFormatProvider)CultureInfo.InvariantCulture, (object)jsonContainerType)); } }
protected void SetStateBasedOnCurrent() { JTokenType jTokenType = this.Peek(); switch (jTokenType) { case JTokenType.None: this._currentState = JsonReader.State.Finished; break; case JTokenType.Object: this._currentState = JsonReader.State.Object; break; case JTokenType.Array: this._currentState = JsonReader.State.Array; break; case JTokenType.Constructor: this._currentState = JsonReader.State.Constructor; break; default: throw new JsonReaderException("While setting the reader state back to current object an unexpected JsonType was encountered: {0}".FormatWith(CultureInfo.get_InvariantCulture(), new object[] { jTokenType })); } }
protected JsonReader() { this._currentState = JsonReader.State.Start; this._dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; this._dateParseHandling = DateParseHandling.DateTime; this._floatParseHandling = FloatParseHandling.Double; this.CloseInput = true; }
protected JsonReader() { this._currentState = JsonReader.State.Start; this._stack = new List <JTokenType>(); this.CloseInput = true; this.Push(JTokenType.None); }
// Token: 0x06000073 RID: 115 // RVA: 0x00006094 File Offset: 0x00004294 protected JsonReader() { this._currentState = JsonReader.State.Start; this._stack = new List<JsonPosition>(4); this._dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; this._dateParseHandling = DateParseHandling.DateTime; this._floatParseHandling = FloatParseHandling.Double; this.CloseInput = true; }
private void SetFinished() { if (this.SupportMultipleContent) { this._currentState = JsonReader.State.Start; return; } this._currentState = JsonReader.State.Finished; }
protected JsonReader() { this._currentState = JsonReader.State.Start; this._stack = new List <JsonPosition>(4); this._dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind; this._dateParseHandling = DateParseHandling.DateTime; this.CloseInput = true; }
private void ValidateEnd(JsonToken endToken) { JsonContainerType jsonContainerType = this.Pop(); if (this.GetTypeForCloseToken(endToken) != jsonContainerType) { throw JsonReaderException.Create(this, StringUtils.FormatWith("JsonToken {0} is not valid for closing JsonType {1}.", (IFormatProvider)CultureInfo.InvariantCulture, (object)endToken, (object)jsonContainerType)); } this._currentState = this.Peek() != JsonContainerType.None ? JsonReader.State.PostValue : JsonReader.State.Finished; }
protected JsonReader() { Class6.yDnXvgqzyB5jw(); base(); this._currentState = JsonReader.State.Start; this._dateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.RoundtripKind; this._dateParseHandling = Newtonsoft.Json.DateParseHandling.DateTime; this._floatParseHandling = Newtonsoft.Json.FloatParseHandling.Double; this.CloseInput = true; }
protected void SetToken(JsonToken newToken, object value) { this._tokenType = newToken; this._value = value; switch (newToken) { case JsonToken.StartObject: this._currentState = JsonReader.State.ObjectStart; this.Push(JsonContainerType.Object); break; case JsonToken.StartArray: this._currentState = JsonReader.State.ArrayStart; this.Push(JsonContainerType.Array); break; case JsonToken.StartConstructor: this._currentState = JsonReader.State.ConstructorStart; this.Push(JsonContainerType.Constructor); break; case JsonToken.PropertyName: this._currentState = JsonReader.State.Property; this._currentPosition.PropertyName = (string)value; break; case JsonToken.Raw: case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Undefined: case JsonToken.Date: case JsonToken.Bytes: this._currentState = this.Peek() != JsonContainerType.None ? JsonReader.State.PostValue : JsonReader.State.Finished; this.UpdateScopeWithFinishedValue(); break; case JsonToken.EndObject: this.ValidateEnd(JsonToken.EndObject); break; case JsonToken.EndArray: this.ValidateEnd(JsonToken.EndArray); break; case JsonToken.EndConstructor: this.ValidateEnd(JsonToken.EndConstructor); break; } }
internal void SetToken(JsonToken newToken, object value, bool updateIndex) { this._tokenType = newToken; this._value = value; switch (newToken) { case JsonToken.StartObject: this._currentState = JsonReader.State.ObjectStart; this.Push(JsonContainerType.Object); break; case JsonToken.StartArray: this._currentState = JsonReader.State.ArrayStart; this.Push(JsonContainerType.Array); break; case JsonToken.StartConstructor: this._currentState = JsonReader.State.ConstructorStart; this.Push(JsonContainerType.Constructor); break; case JsonToken.PropertyName: this._currentState = JsonReader.State.Property; this._currentPosition.PropertyName = (string)value; break; case JsonToken.Raw: case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Undefined: case JsonToken.Date: case JsonToken.Bytes: this.SetPostValueState(updateIndex); break; case JsonToken.EndObject: this.ValidateEnd(JsonToken.EndObject); break; case JsonToken.EndArray: this.ValidateEnd(JsonToken.EndArray); break; case JsonToken.EndConstructor: this.ValidateEnd(JsonToken.EndConstructor); break; } }
private void ValidateEnd(JsonToken endToken) { JsonContainerType jsonContainerType = this.Pop(); if (this.GetTypeForCloseToken(endToken) != jsonContainerType) { throw JsonReaderException.Create(this, "JsonToken {0} is not valid for closing JsonType {1}.".FormatWith(CultureInfo.InvariantCulture, endToken, jsonContainerType)); } if (this.Peek() != JsonContainerType.None) { this._currentState = JsonReader.State.PostValue; return; } this.SetFinished(); }
internal void SetPostValueState(bool updateIndex) { if (this.Peek() != JsonContainerType.None || this.SupportMultipleContent) { this._currentState = JsonReader.State.PostValue; } else { this.SetFinished(); } if (updateIndex) { this.UpdateScopeWithFinishedValue(); } }
internal void SetPostValueState(bool updateIndex) { if (this.Peek() != JsonContainerType.None) { this._currentState = JsonReader.State.PostValue; } else { this.SetFinished(); } if (!updateIndex) { return; } this.UpdateScopeWithFinishedValue(); }
// Token: 0x060015CE RID: 5582 RVA: 0x000728C8 File Offset: 0x00070AC8 private bool ReadReference() { JsonReader.State currentState = base.CurrentState; if (currentState != JsonReader.State.Property) { if (currentState == JsonReader.State.ObjectStart) { base.SetToken(JsonToken.PropertyName, "$ref"); this._bsonReaderState = BsonReader.BsonReaderState.ReferenceRef; return(true); } if (currentState != JsonReader.State.PostValue) { throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + base.CurrentState.ToString()); } if (this._bsonReaderState == BsonReader.BsonReaderState.ReferenceRef) { base.SetToken(JsonToken.PropertyName, "$id"); this._bsonReaderState = BsonReader.BsonReaderState.ReferenceId; return(true); } if (this._bsonReaderState == BsonReader.BsonReaderState.ReferenceId) { base.SetToken(JsonToken.EndObject); this._bsonReaderState = BsonReader.BsonReaderState.Normal; return(true); } throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + this._bsonReaderState.ToString()); } else { if (this._bsonReaderState == BsonReader.BsonReaderState.ReferenceRef) { base.SetToken(JsonToken.String, this.ReadLengthString()); return(true); } if (this._bsonReaderState == BsonReader.BsonReaderState.ReferenceId) { base.SetToken(JsonToken.Bytes, this.ReadBytes(12)); return(true); } throw JsonReaderException.Create(this, "Unexpected state when reading BSON reference: " + this._bsonReaderState.ToString()); } }
protected void SetStateBasedOnCurrent() { JsonContainerType jsonContainerType = this.Peek(); switch (jsonContainerType) { case JsonContainerType.None: this._currentState = JsonReader.State.Finished; break; case JsonContainerType.Object: this._currentState = JsonReader.State.Object; break; case JsonContainerType.Array: this._currentState = JsonReader.State.Array; break; case JsonContainerType.Constructor: this._currentState = JsonReader.State.Constructor; break; default: throw JsonReaderException.Create(this, StringUtils.FormatWith("While setting the reader state back to current object an unexpected JsonType was encountered: {0}", (IFormatProvider) CultureInfo.InvariantCulture, (object) jsonContainerType)); } }
// Token: 0x06000088 RID: 136 // RVA: 0x000060F5 File Offset: 0x000042F5 internal void SetPostValueState(bool updateIndex) { if (this.Peek() != JsonContainerType.None) { this._currentState = JsonReader.State.PostValue; } else { this.SetFinished(); } if (updateIndex) { this.UpdateScopeWithFinishedValue(); } }
private void ValidateEnd(JsonToken endToken) { JsonContainerType jsonContainerType = this.Pop(); if (this.GetTypeForCloseToken(endToken) != jsonContainerType) throw JsonReaderException.Create(this, StringUtils.FormatWith("JsonToken {0} is not valid for closing JsonType {1}.", (IFormatProvider) CultureInfo.InvariantCulture, (object) endToken, (object) jsonContainerType)); this._currentState = this.Peek() != JsonContainerType.None ? JsonReader.State.PostValue : JsonReader.State.Finished; }
/// <summary> /// Sets the state based on current token type. /// </summary> protected void SetStateBasedOnCurrent() { JsonContainerType currentObject = Peek(); switch (currentObject) { case JsonContainerType.Object: _currentState = JsonReader.State.Object; break; case JsonContainerType.Array: _currentState = JsonReader.State.Array; break; case JsonContainerType.Constructor: _currentState = JsonReader.State.Constructor; break; case JsonContainerType.None: _currentState = JsonReader.State.Finished; break; default: throw JsonReaderException.Create(this, Path, "While setting the reader state back to current object an unexpected JsonType was encountered: {0}".FormatWith(CultureInfo.InvariantCulture, currentObject), null); } }
protected virtual void SetToken(JsonToken newToken, object value) { this._token = newToken; switch (newToken) { case JsonToken.StartObject: this._currentState = JsonReader.State.ObjectStart; this.Push(JTokenType.Object); break; case JsonToken.StartArray: this._currentState = JsonReader.State.ArrayStart; this.Push(JTokenType.Array); break; case JsonToken.StartConstructor: this._currentState = JsonReader.State.ConstructorStart; this.Push(JTokenType.Constructor); break; case JsonToken.PropertyName: this._currentState = JsonReader.State.Property; this.Push(JTokenType.Property); break; case JsonToken.Raw: case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Undefined: case JsonToken.Date: case JsonToken.Bytes: this._currentState = JsonReader.State.PostValue; break; case JsonToken.EndObject: this.ValidateEnd(JsonToken.EndObject); this._currentState = JsonReader.State.PostValue; break; case JsonToken.EndArray: this.ValidateEnd(JsonToken.EndArray); this._currentState = JsonReader.State.PostValue; break; case JsonToken.EndConstructor: this.ValidateEnd(JsonToken.EndConstructor); this._currentState = JsonReader.State.PostValue; break; } JTokenType jTokenType = this.Peek(); if (jTokenType == JTokenType.Property && this._currentState == JsonReader.State.PostValue) { this.Pop(); } if (value != null) { this._value = value; this._valueType = value.GetType(); } else { this._value = null; this._valueType = null; } }
/// <summary> /// Sets the current token and value. /// </summary> /// <param name="newToken">The new token.</param> /// <param name="value">The value.</param> protected void SetToken(JsonToken newToken, object value) { _tokenType = newToken; _value = value; switch (newToken) { case JsonToken.StartObject: _currentState = JsonReader.State.ObjectStart; Push(JsonContainerType.Object); break; case JsonToken.StartArray: _currentState = JsonReader.State.ArrayStart; Push(JsonContainerType.Array); break; case JsonToken.StartConstructor: _currentState = JsonReader.State.ConstructorStart; Push(JsonContainerType.Constructor); break; case JsonToken.EndObject: ValidateEnd(JsonToken.EndObject); break; case JsonToken.EndArray: ValidateEnd(JsonToken.EndArray); break; case JsonToken.EndConstructor: ValidateEnd(JsonToken.EndConstructor); break; case JsonToken.PropertyName: _currentState = JsonReader.State.Property; _currentPosition.PropertyName = (string)value; break; case JsonToken.Undefined: case JsonToken.Integer: case JsonToken.Float: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Date: case JsonToken.String: case JsonToken.Raw: case JsonToken.Bytes: _currentState = (Peek() != JsonContainerType.None) ? JsonReader.State.PostValue : JsonReader.State.Finished; UpdateScopeWithFinishedValue(); break; } }
private void ValidateEnd(JsonToken endToken) { JsonContainerType currentObject = Pop(); if (GetTypeForCloseToken(endToken) != currentObject) throw JsonReaderException.Create(this, Path, "JsonToken {0} is not valid for closing JsonType {1}.".FormatWith(CultureInfo.InvariantCulture, endToken, currentObject), null); _currentState = (Peek() != JsonContainerType.None) ? JsonReader.State.PostValue : JsonReader.State.Finished; }
// Token: 0x06000087 RID: 135 // RVA: 0x000295A8 File Offset: 0x000277A8 internal void SetToken(JsonToken newToken, object value, bool updateIndex) { this._tokenType = newToken; this._value = value; switch (newToken) { case JsonToken.StartObject: this._currentState = JsonReader.State.ObjectStart; this.Push(JsonContainerType.Object); return; case JsonToken.StartArray: this._currentState = JsonReader.State.ArrayStart; this.Push(JsonContainerType.Array); return; case JsonToken.StartConstructor: this._currentState = JsonReader.State.ConstructorStart; this.Push(JsonContainerType.Constructor); return; case JsonToken.PropertyName: this._currentState = JsonReader.State.Property; this._currentPosition.PropertyName = (string)value; return; case JsonToken.Comment: break; case JsonToken.Raw: case JsonToken.Integer: case JsonToken.Float: case JsonToken.String: case JsonToken.Boolean: case JsonToken.Null: case JsonToken.Undefined: case JsonToken.Date: case JsonToken.Bytes: this.SetPostValueState(updateIndex); break; case JsonToken.EndObject: this.ValidateEnd(JsonToken.EndObject); return; case JsonToken.EndArray: this.ValidateEnd(JsonToken.EndArray); return; case JsonToken.EndConstructor: this.ValidateEnd(JsonToken.EndConstructor); return; default: return; } }
// Token: 0x0600008A RID: 138 // RVA: 0x0002967C File Offset: 0x0002787C private void ValidateEnd(JsonToken endToken) { JsonContainerType jsonContainerType = this.Pop(); if (this.GetTypeForCloseToken(endToken) != jsonContainerType) { throw JsonReaderException.Create(this, StringUtils.FormatWith("JsonToken {0} is not valid for closing JsonType {1}.", CultureInfo.InvariantCulture, endToken, jsonContainerType)); } if (this.Peek() != JsonContainerType.None) { this._currentState = JsonReader.State.PostValue; return; } this.SetFinished(); }
public virtual void Close() { this._currentState = JsonReader.State.Closed; this._tokenType = JsonToken.None; this._value = (object) null; }
// Token: 0x0600008C RID: 140 // RVA: 0x00006139 File Offset: 0x00004339 private void SetFinished() { if (this.SupportMultipleContent) { this._currentState = JsonReader.State.Start; return; } this._currentState = JsonReader.State.Finished; }
private void SetFinished() { this._currentState = (this.SupportMultipleContent ? JsonReader.State.Start : JsonReader.State.Finished); }