public static async ValueTask ToJsonAsync <T>(this T obj, AbsolutePath path, bool useGenericSettings = false) { await using var fs = await path.Create(); obj.ToJson(fs, useGenericSettings); }
public static T FromJson <T>(this AbsolutePath filename) { return(JsonConvert.DeserializeObject <T>(filename.ReadAllText(), JsonSettings) !); }
/// <summary> /// Loads INI data from the given filename and returns a dynamic type that /// can use . operators to navigate the INI. /// </summary> /// <param name="file"></param> /// <returns></returns> public static dynamic LoadIniFile(this AbsolutePath file) { return(new DynamicIniData(new FileIniDataParser(IniParser()).ReadFile((string)file))); }