public ParseJSON ( bool objectOrArrayOnly, int nextchar ) : CBORObject | ||
objectOrArrayOnly | bool | |
nextchar | int | |
return | CBORObject |
internal static CBORObject ParseJSONValue( CharacterInputWithCount reader, bool noDuplicates, bool objectOrArrayOnly, int[] nextchar) { var cj = new CBORJson(reader, noDuplicates); return cj.ParseJSON(objectOrArrayOnly, nextchar); }
internal static CBORObject ParseJSONValue( CharacterInputWithCount reader, JSONOptions options, int[] nextChar) { var cj = new CBORJson(reader, options); return(cj.ParseJSON(nextChar)); }
internal static CBORObject ParseJSONValue( CharacterInputWithCount reader, bool noDuplicates, bool objectOrArrayOnly, int[] nextchar) { var cj = new CBORJson(reader, noDuplicates); return(cj.ParseJSON(objectOrArrayOnly, nextchar)); }
internal static CBORObject[] ParseJSONSequence( CharacterInputWithCount reader, JSONOptions options, int[] nextChar) { var cj = new CBORJson(reader, options); cj.SetJSONSequenceMode(); bool seenSeparator = cj.SkipRecordSeparators(nextChar, false); if (nextChar[0] >= 0 && !seenSeparator) { // Stream is not empty and did not begin with // record separator cj.RaiseError("Not a JSON text sequence"); } else if (nextChar[0] < 0 && !seenSeparator) { // Stream is empty return(new CBORObject[0]); } else if (nextChar[0] < 0) { // Stream had only record separators, so we found // a truncated JSON text return(new CBORObject[] { null }); } var list = new List <CBORObject>(); while (true) { CBORObject co; try { co = cj.ParseJSON(nextChar); } catch (CBORException) { cj.SkipToEnd(); co = null; } if (co != null && nextChar[0] >= 0) { // End of JSON text not reached cj.SkipToEnd(); co = null; } list.Add(co); if (!cj.recordSeparatorSeen) { // End of the stream was reached nextChar[0] = -1; break; } else { // A record separator was seen, so // another JSON text follows cj.ResetJSONSequenceMode(); cj.SkipRecordSeparators(nextChar, true); if (nextChar[0] < 0) { // Rest of stream had only record separators, so we found // a truncated JSON text list.Add(null); break; } } } return((CBORObject[])list.ToArray()); }