mirror of
https://gitlab.com/nullmax17/RestySqlite.git
synced 2025-03-14 16:01:13 +03:00
21 lines
481 B
C#
21 lines
481 B
C#
|
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];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|