API.Util.Hjson - JuDelCo/Core GitHub Wiki

Namespace: Ju.Hjson

HjsonValue (static methods)

JsonValue Load(string path);
JsonValue Load(string path, HjsonOptions options);
JsonValue Load(Stream stream);
JsonValue Load(Stream stream, HjsonOptions options);
JsonValue Load(TextReader textReader, IJsonReader jsonReader = null);
JsonValue Load(TextReader textReader, HjsonOptions options, IJsonReader jsonReader = null);
JsonValue Parse(string hjsonString);
JsonValue Parse(string hjsonString, HjsonOptions options);
void Save(JsonValue json, string path, HjsonOptions options = null);
void Save(JsonValue json, Stream stream, HjsonOptions options = null);
void Save(JsonValue json, TextWriter textWriter, HjsonOptions options = null);

JsonValue (static methods)

string Eol;

JsonValue FromObject(object value);
JsonValue Load(string path);
JsonValue Load(Stream stream);
JsonValue Load(TextReader textReader, IJsonReader jsonReader = null);
JsonValue Parse(string jsonString);

JsonValue : IEnumerable

int Count;
JsonType JsonType;

JsonValue this[int index];
JsonValue this[string key];

bool ContainsKey(string key);
void Save(string path, Stringify format = Stringify.Plain);
void Save(Stream stream, Stringify format = Stringify.Plain);
void Save(TextWriter textWriter, Stringify format = Stringify.Plain);
object ToValue();
string ToString(HjsonOptions options);
string ToString(Stringify format); // Hjson, Formatted (Json) , Plain (Json)
string ToString();

bool Qb();
int Qi();
long Ql();
double Qd();
string Qs();
string Qstr(); // Any value as string
JsonObject Qo();
JsonArray Qa();

string GetValue(string defaultValue = default(string));
T GetValue<T>(T defaultValue = default(T)) where T : struct, Enum;
bool GetValue(bool defaultValue = default(bool));
byte GetValue(byte defaultValue = default(byte));
sbyte GetValue(sbyte defaultValue = default(sbyte));
char GetValue(char defaultValue = default(char));
float GetValue(float defaultValue = default(float));
double GetValue(double defaultValue = default(double));
decimal GetValue(decimal defaultValue = default(decimal));
short GetValue(short defaultValue = default(short));
int GetValue(int defaultValue = default(int));
long GetValue(long defaultValue = default(long));
ushort GetValue(ushort defaultValue = default(ushort));
uint GetValue(uint defaultValue = default(uint));
ulong GetValue(ulong defaultValue = default(ulong);
DateTime GetValue(DateTime defaultValue = default(DateTime));
Guid GetValue(Guid defaultValue = default(Guid));
Color GetValue(Color defaultValue = default(Color));
Color32 GetValue(Color32 defaultValue = default(Color32));

JsonValue (implicit operators)

JsonValue(bool value);
JsonValue(byte value);
JsonValue(char value);
JsonValue(decimal value);
JsonValue(double value);
JsonValue(float value);
JsonValue(int value);
JsonValue(long value);
JsonValue(short value);
JsonValue(string value);

bool(JsonValue value);
byte(JsonValue value);
char(JsonValue value);
decimal(JsonValue value);
double(JsonValue value);
float(JsonValue value);
int(JsonValue value);
long(JsonValue value);
short(JsonValue value);
string(JsonValue value);

JsonObject : JsonValue, IDictionary< string, JsonValue >, ICollection< KeyValuePair< string, JsonValue > >

JsonObject(params KeyValuePair<string, JsonValue>[] items);
JsonObject(IEnumerable<KeyValuePair<string, JsonValue>> items);

bool Qb(string key, bool defaultValue = false);
int Qi(string key, int defaultValue = 0);
long Ql(string key, long defaultValue = 0);
double Qd(string key, double defaultValue = 0);
string Qs(string key, string defaultValue = "");
string Qstr(string key, string defaultValue = "");
JsonValue Qv(string key);
JsonObject Qo(string key);
JsonArray Qa(string key);
IEnumerable<KeyValuePair<string, JsonObject>> Qqo();

bool HasValue(string key);
string GetValue(string key, string defaultValue = default(string));
T GetValue<T>(string key, T defaultValue = default(T)) where T : struct, Enum;
bool GetValue(string key, bool defaultValue = default(bool));
byte GetValue(string key, byte defaultValue = default(byte));
sbyte GetValue(string key, sbyte defaultValue = default(sbyte));
char GetValue(string key, char defaultValue = default(char));
float GetValue(string key, float defaultValue = default(float));
double GetValue(string key, double defaultValue = default(double));
decimal GetValue(string key, decimal defaultValue = default(decimal));
short GetValue(string key, short defaultValue = default(short));
int GetValue(string key, int defaultValue = default(int));
long GetValue(string key, long defaultValue = default(long));
ushort GetValue(string key, ushort defaultValue = default(ushort));
uint GetValue(string key, uint defaultValue = default(uint));
ulong GetValue(string key, ulong defaultValue = default(ulong));
DateTime GetValue(string key, DateTime defaultValue = default(DateTime));
Guid GetValue(string key, Guid defaultValue = default(Guid));
Color GetValue(string key, Color defaultValue = default(Color));
Color32 GetValue(string key, Color32 defaultValue = default(Color32));

JsonArray : JsonValue, IList

JsonArray(params JsonValue[] items);
JsonArray(IEnumerable<JsonValue> items);

JsonPrimitive : JsonValue

JsonPrimitive(string value);
JsonPrimitive(char value);
JsonPrimitive(bool value);
JsonPrimitive(decimal value);
JsonPrimitive(double value);
JsonPrimitive(float value);
JsonPrimitive(long value);
JsonPrimitive(int value);
JsonPrimitive(byte value);
JsonPrimitive(short value);

String (extension method)

bool IsValidHjson();

DateTime (extension methods)

long ToJsonDate();
string ToJson();
string ToPrecise();

TimeSpan (extension method)

string ToJson();
⚠️ **GitHub.com Fallback** ⚠️