static JsonValue load(string path, IJsonReader jsonReader, HjsonOptions options) { if (Path.GetExtension(path).ToLower() == ".json") { return(JsonValue.Load(path)); } try { using (var s = File.OpenRead(path)) return(load(s, jsonReader, options)); } catch (Exception e) { throw new Exception(e.Message + " (in " + path + ")", e); } }
/// <summary>Loads Hjson/JSON from a file.</summary> public static JsonValue Load(string path) { if (Path.GetExtension(path).ToLower() == ".json") { return(JsonValue.Load(path)); } try { using (var s = File.OpenRead(path)) return(Load(s)); } catch (Exception e) { throw new Exception(e.Message + " (in " + path + ")", e); } }