Public classes


Scripts/

   JArray
   JBoolean
   JNull
   JNumber
   JSON
   JString
   JValue

Scripts/Attributes/

      ExcludeFromJSONSerializeAttribute
      IncludeToJSONSerializeAttribute

Scripts/Exceptions/

      DeserializeException
      JArgumentException
      JArgumentNullException
      JArrayIndexOutOfRangeException
      JNumberFormatException
      JNumberOverflowException
      JSONKeyAlreadyExistsException
      JSONKeyNotFoundException
      JValueNullException
      JValueTypeException
      ParseException
      ProtectedException
      SerializeException
      UnknownObjectTypeException

Scripts/Settings/

      CreateStringSettings
      DeserializeSettings
      ParseStringSettings
      SerializeSettings


Introduction page

ParseStringSettings


Settings that can be used to make changes how string is parsed to JSON or JArray.


Properties

public bool AllowNonWhiteCharactersAfterObjectSets whatever it is acceptable for input string to have other than non-white characters after end of JSON or JArray object.
public string DebugIDForExceptionsSets debug ID for this string parse and resulting JSON object.
public bool FixRoundedFloatingPointMinMaxValuesIf set true, numeric values that seem to be just rounded float.
public int ParseStartIndexSets index of input string where parsing JSON or JArray object is started.

Properties

public bool AllowNonWhiteCharactersAfterObject

Sets whatever it is acceptable for input string to have other than non-white characters after end of JSON or JArray object.

ValueIf set to true, non-white characters are accepted at end of object. Default is false, so expecting that input string ends at the end of JSON or JArray object.


public string DebugIDForExceptions

Sets debug ID for this string parse and resulting JSON object. If any exception occurres during parsing or JSON handling after succesful parse, this debug ID will be added to exception message.

This is typically useful in production builds where only exception message is logged but full stacktrace may not be available. Typical parse error could be that source string is null or empty for some reason. Without adding this debug id to the parse, exception is just "ParseException: Source string is empty" which isn't very helpful if project is parsing lots of incoming JSON and so it is not clear which one causes this error. When adding this debug id to the parse, above exception would be for example "ParseException: Source string is empty - Parse Debug ID: Backend own currency settings", which pinpoints the problem instantly.

ValueDebug ID. Default is null.


public bool FixRoundedFloatingPointMinMaxValues

If set true, numeric values that seem to be just rounded float.MinValue, float.MaxValue, double.MinValue or double.MaxValue are set to those exact values.

C# floating point numbers rounding sometimes causes unwanted effects. In some systems, for example double.Parse(double.MaxValue.ToString()) will cause number overflow exception. TotalJSON will use exact values when creating JSON formatted string using CreateString() method. But if JSON is created using other methods and it is possible JSON may contain rounded floating point min/max values, it is better to set this setting true so that parsed values are what they are expected to be.

ValueTrue to fix rounded floating point values to float/double min/max values. False to parse numbers exactly as they are. Default is true.


public int ParseStartIndex

Sets index of input string where parsing JSON or JArray object is started.

ValueThe index of the parse start. Default is 0.