public JSONRoot(string raw) { int i = 0; for (; i < raw.Length; i++) { if (JSONParseUtility.IsBlankChar(raw[i]) == true || raw[i] == JSONRow.JSONKeySeparator) { continue; } int j = JSONParseUtility.IsOpener(raw[i]); if (j != -1) { ++i; this.child = new JSONObject(raw, ref i, raw.Length, j); break; } else { int startOffset = JSONParseUtility.DigestString(raw, ref i, raw.Length); this.child = new JSONValue(raw.Substring(startOffset, i - startOffset + 1)); break; } } if (this.child != null) { this.child.Open = true; } }
public JSONPairKeyValue(string raw, ref int i, int max) { for (; i < max; i++) { if (JSONParseUtility.IsBlankChar(raw[i]) == true || raw[i] == JSONRow.JSONKeySeparator) { continue; } if (raw[i] == JSONRow.JSONValueSeparator) { break; } if (JSONParseUtility.IsCloser(raw[i]) != -1) { --i; break; } int j = JSONParseUtility.IsOpener(raw[i]); if (j != -1) { ++i; this.child = new JSONObject(raw, ref i, max, j); } else { int startOffset = JSONParseUtility.DigestString(raw, ref i, max); if (this.content == null) { this.content = raw.Substring(startOffset, i - startOffset + 1); } else { this.child = new JSONValue(raw.Substring(startOffset, i - startOffset + 1)); break; } } } }