public static PixelJSON LoadString(string data) { if (string.IsNullOrEmpty(data)) { return(null); } var jsoner = new PixelJSON(); jsoner.ParseString(data); return(jsoner); }
public static PixelJSON Load(string filename) { if (string.IsNullOrEmpty(filename)) { return(null); } var jsoner = new PixelJSON(); jsoner.ParseFromFile(filename); return(jsoner); }
public static string Serialize(PixelJSON json, bool multiline = true, bool multilineArrays = false) { var instance = new PixelJSONSerializer(multiline, multilineArrays); if (json.table != null) { instance.SerializeObject(json.table); } else if (json.array != null) { instance.SerializeArray(json.array); } return(instance.builder.ToString()); }