RestySqlite/Utils.cs

21 lines
481 B
C#
Raw Normal View History

2025-02-09 16:38:49 +03:00
using Tommy;
namespace RestySqlite
{
public class Utils
{
public static dynamic ReadConfig(string key, string? category = null)
{
using(StreamReader reader = File.OpenText("conf.toml"))
{
TomlTable table = TOML.Parse(reader);
if (category != null)
{
return table[category][key];
}
return table[key];
}
}
}
}