Exemple #1
0
 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); }
 }
Exemple #2
0
 /// <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); }
 }