// Token: 0x060004E8 RID: 1256 RVA: 0x00018FC0 File Offset: 0x000171C0 private static void AddElement(global::VRGIN.Helpers.JSONNode ctx, string token, string tokenName, bool tokenIsString) { if (tokenIsString) { bool flag = ctx is global::VRGIN.Helpers.JSONArray; if (flag) { ctx.Add(token); } else { ctx.Add(tokenName, token); } } else { global::VRGIN.Helpers.JSONData aItem = global::VRGIN.Helpers.JSONNode.Numberize(token); bool flag2 = ctx is global::VRGIN.Helpers.JSONArray; if (flag2) { ctx.Add(aItem); } else { ctx.Add(tokenName, aItem); } } }
// Token: 0x0600052A RID: 1322 RVA: 0x0001A4DC File Offset: 0x000186DC public override void Add(global::VRGIN.Helpers.JSONNode aItem) { this.Set(new global::VRGIN.Helpers.JSONArray { aItem }); }
// Token: 0x060004F1 RID: 1265 RVA: 0x00019588 File Offset: 0x00017788 public static global::VRGIN.Helpers.JSONNode Deserialize(global::System.IO.BinaryReader aReader) { global::VRGIN.Helpers.JSONBinaryTag jsonbinaryTag = (global::VRGIN.Helpers.JSONBinaryTag)aReader.ReadByte(); global::VRGIN.Helpers.JSONNode result; switch (jsonbinaryTag) { case global::VRGIN.Helpers.JSONBinaryTag.Array: { int num = aReader.ReadInt32(); global::VRGIN.Helpers.JSONArray jsonarray = new global::VRGIN.Helpers.JSONArray(); for (int i = 0; i < num; i++) { jsonarray.Add(global::VRGIN.Helpers.JSONNode.Deserialize(aReader)); } result = jsonarray; break; } case global::VRGIN.Helpers.JSONBinaryTag.Class: { int num2 = aReader.ReadInt32(); global::VRGIN.Helpers.JSONClass jsonclass = new global::VRGIN.Helpers.JSONClass(); for (int j = 0; j < num2; j++) { string aKey = aReader.ReadString(); global::VRGIN.Helpers.JSONNode aItem = global::VRGIN.Helpers.JSONNode.Deserialize(aReader); jsonclass.Add(aKey, aItem); } result = jsonclass; break; } case global::VRGIN.Helpers.JSONBinaryTag.Value: result = new global::VRGIN.Helpers.JSONData(aReader.ReadString()); break; case global::VRGIN.Helpers.JSONBinaryTag.IntValue: result = new global::VRGIN.Helpers.JSONData(aReader.ReadInt32()); break; case global::VRGIN.Helpers.JSONBinaryTag.DoubleValue: result = new global::VRGIN.Helpers.JSONData(aReader.ReadDouble()); break; case global::VRGIN.Helpers.JSONBinaryTag.BoolValue: result = new global::VRGIN.Helpers.JSONData(aReader.ReadBoolean()); break; case global::VRGIN.Helpers.JSONBinaryTag.FloatValue: result = new global::VRGIN.Helpers.JSONData(aReader.ReadSingle()); break; default: throw new global::System.Exception("Error deserializing JSON. Unknown tag: " + jsonbinaryTag.ToString()); } return(result); }
// Token: 0x0600052B RID: 1323 RVA: 0x0001A500 File Offset: 0x00018700 public override void Add(string aKey, global::VRGIN.Helpers.JSONNode aItem) { this.Set(new global::VRGIN.Helpers.JSONClass { { aKey, aItem } }); }
// Token: 0x06000525 RID: 1317 RVA: 0x0001A414 File Offset: 0x00018614 private void Set(global::VRGIN.Helpers.JSONNode aVal) { bool flag = this.m_Key == null; if (flag) { this.m_Node.Add(aVal); } else { this.m_Node.Add(this.m_Key, aVal); } this.m_Node = null; }
// Token: 0x06000510 RID: 1296 RVA: 0x00019D94 File Offset: 0x00017F94 public override global::VRGIN.Helpers.JSONNode Remove(global::VRGIN.Helpers.JSONNode aNode) { global::VRGIN.Helpers.JSONNode result; try { global::System.Collections.Generic.KeyValuePair <string, global::VRGIN.Helpers.JSONNode> keyValuePair = global::System.Linq.Enumerable.First <global::System.Collections.Generic.KeyValuePair <string, global::VRGIN.Helpers.JSONNode> >(global::System.Linq.Enumerable.Where <global::System.Collections.Generic.KeyValuePair <string, global::VRGIN.Helpers.JSONNode> >(this.m_Dict, (global::System.Collections.Generic.KeyValuePair <string, global::VRGIN.Helpers.JSONNode> k) => k.Value == aNode)); this.m_Dict.Remove(keyValuePair.Key); result = aNode; } catch { result = null; } return(result); }
// Token: 0x0600050E RID: 1294 RVA: 0x00019CF4 File Offset: 0x00017EF4 public override global::VRGIN.Helpers.JSONNode Remove(string aKey) { bool flag = !this.m_Dict.ContainsKey(aKey); global::VRGIN.Helpers.JSONNode result; if (flag) { result = null; } else { global::VRGIN.Helpers.JSONNode jsonnode = this.m_Dict[aKey]; this.m_Dict.Remove(aKey); result = jsonnode; } return(result); }
// Token: 0x060004FF RID: 1279 RVA: 0x00019850 File Offset: 0x00017A50 public override global::VRGIN.Helpers.JSONNode Remove(int aIndex) { bool flag = aIndex < 0 || aIndex >= this.m_List.Count; global::VRGIN.Helpers.JSONNode result; if (flag) { result = null; } else { global::VRGIN.Helpers.JSONNode jsonnode = this.m_List[aIndex]; this.m_List.RemoveAt(aIndex); result = jsonnode; } return(result); }
// Token: 0x0600050D RID: 1293 RVA: 0x00019C84 File Offset: 0x00017E84 public override void Add(string aKey, global::VRGIN.Helpers.JSONNode aItem) { bool flag = !string.IsNullOrEmpty(aKey); if (flag) { bool flag2 = this.m_Dict.ContainsKey(aKey); if (flag2) { this.m_Dict[aKey] = aItem; } else { this.m_Dict.Add(aKey, aItem); } } else { this.m_Dict.Add(global::System.Guid.NewGuid().ToString(), aItem); } }
// Token: 0x060004CE RID: 1230 RVA: 0x00018BAC File Offset: 0x00016DAC public virtual global::VRGIN.Helpers.JSONNode Remove(global::VRGIN.Helpers.JSONNode aNode) { return(aNode); }
// Token: 0x060004CB RID: 1227 RVA: 0x00018B73 File Offset: 0x00016D73 public virtual void Add(global::VRGIN.Helpers.JSONNode aItem) { this.Add("", aItem); }
// Token: 0x060004E9 RID: 1257 RVA: 0x0001902C File Offset: 0x0001722C public static global::VRGIN.Helpers.JSONNode Parse(string aJSON) { global::System.Collections.Generic.Stack <global::VRGIN.Helpers.JSONNode> stack = new global::System.Collections.Generic.Stack <global::VRGIN.Helpers.JSONNode>(); global::VRGIN.Helpers.JSONNode jsonnode = null; int i = 0; string text = ""; string text2 = ""; bool flag = false; bool flag2 = false; while (i < aJSON.Length) { char c = aJSON.get_Chars(i); char c2 = c; if (c2 <= ',') { if (c2 <= ' ') { switch (c2) { case '\t': break; case '\n': case '\r': goto IL_473; case '\v': case '\f': goto IL_45A; default: if (c2 != ' ') { goto IL_45A; } break; } bool flag3 = flag; if (flag3) { text += aJSON.get_Chars(i).ToString(); } } else if (c2 != '"') { if (c2 != ',') { goto IL_45A; } bool flag4 = flag; if (flag4) { text += aJSON.get_Chars(i).ToString(); } else { bool flag5 = text != ""; if (flag5) { global::VRGIN.Helpers.JSONNode.AddElement(jsonnode, text, text2, flag2); } text2 = ""; text = ""; flag2 = false; } } else { flag = !flag; flag2 = (flag || flag2); } } else { if (c2 <= ']') { if (c2 != ':') { switch (c2) { case '[': { bool flag6 = flag; if (flag6) { text += aJSON.get_Chars(i).ToString(); goto IL_473; } stack.Push(new global::VRGIN.Helpers.JSONArray()); bool flag7 = jsonnode != null; if (flag7) { text2 = text2.Trim(); bool flag8 = jsonnode is global::VRGIN.Helpers.JSONArray; if (flag8) { jsonnode.Add(stack.Peek()); } else { bool flag9 = text2 != ""; if (flag9) { jsonnode.Add(text2, stack.Peek()); } } } text2 = ""; text = ""; jsonnode = stack.Peek(); goto IL_473; } case '\\': { i++; bool flag10 = flag; if (flag10) { char c3 = aJSON.get_Chars(i); char c4 = c3; char c5 = c4; if (c5 <= 'f') { if (c5 != 'b') { if (c5 != 'f') { goto IL_447; } text += "\f"; } else { text += "\b"; } } else if (c5 != 'n') { switch (c5) { case 'r': text += "\r"; break; case 's': goto IL_447; case 't': text += "\t"; break; case 'u': { string text3 = aJSON.Substring(i + 1, 4); text += ((char)int.Parse(text3, 512)).ToString(); i += 4; break; } default: goto IL_447; } } else { text += "\n"; } goto IL_458; IL_447: text += c3.ToString(); } IL_458: goto IL_473; } case ']': break; default: goto IL_45A; } } else { bool flag11 = flag; if (flag11) { text += aJSON.get_Chars(i).ToString(); goto IL_473; } text2 = text; text = ""; flag2 = false; goto IL_473; } } else if (c2 != '{') { if (c2 != '}') { goto IL_45A; } } else { bool flag12 = flag; if (flag12) { text += aJSON.get_Chars(i).ToString(); goto IL_473; } stack.Push(new global::VRGIN.Helpers.JSONClass()); bool flag13 = jsonnode != null; if (flag13) { text2 = text2.Trim(); bool flag14 = jsonnode is global::VRGIN.Helpers.JSONArray; if (flag14) { jsonnode.Add(stack.Peek()); } else { bool flag15 = text2 != ""; if (flag15) { jsonnode.Add(text2, stack.Peek()); } } } text2 = ""; text = ""; jsonnode = stack.Peek(); goto IL_473; } bool flag16 = flag; if (flag16) { text += aJSON.get_Chars(i).ToString(); } else { bool flag17 = stack.Count == 0; if (flag17) { throw new global::System.Exception("JSON Parse: Too many closing brackets"); } stack.Pop(); bool flag18 = text != ""; if (flag18) { text2 = text2.Trim(); global::VRGIN.Helpers.JSONNode.AddElement(jsonnode, text, text2, flag2); flag2 = false; } text2 = ""; text = ""; bool flag19 = stack.Count > 0; if (flag19) { jsonnode = stack.Peek(); } } } IL_473: i++; continue; IL_45A: text += aJSON.get_Chars(i).ToString(); goto IL_473; } bool flag20 = flag; if (flag20) { throw new global::System.Exception("JSON Parse: Quotation marks seems to be messed up."); } return(jsonnode); }
// Token: 0x06000500 RID: 1280 RVA: 0x000198A0 File Offset: 0x00017AA0 public override global::VRGIN.Helpers.JSONNode Remove(global::VRGIN.Helpers.JSONNode aNode) { this.m_List.Remove(aNode); return(aNode); }
// Token: 0x060004FE RID: 1278 RVA: 0x0001983D File Offset: 0x00017A3D public override void Add(string aKey, global::VRGIN.Helpers.JSONNode aItem) { this.m_List.Add(aItem); }
// Token: 0x06000523 RID: 1315 RVA: 0x0001A3C6 File Offset: 0x000185C6 public JSONLazyCreator(global::VRGIN.Helpers.JSONNode aNode) { this.m_Node = aNode; this.m_Key = null; }
// Token: 0x060004C3 RID: 1219 RVA: 0x00018B0F File Offset: 0x00016D0F public virtual void Add(string aKey, global::VRGIN.Helpers.JSONNode aItem) { }
// Token: 0x06000524 RID: 1316 RVA: 0x0001A3EC File Offset: 0x000185EC public JSONLazyCreator(global::VRGIN.Helpers.JSONNode aNode, string aKey) { this.m_Node = aNode; this.m_Key = aKey; }