add required shit for loading per-window config (I think)

This commit is contained in:
Arisotura
2024-05-23 23:31:15 +02:00
parent d50f01b774
commit f9449999ec
5 changed files with 18 additions and 7 deletions

View File

@ -539,11 +539,17 @@ Array Table::GetArray(const std::string& path)
return Array(arr);
}
Table Table::GetTable(const std::string& path)
Table Table::GetTable(const std::string& path, const std::string& defpath)
{
toml::value& tbl = ResolvePath(path);
if (!tbl.is_table())
tbl = toml::table();
{
toml::value defval = toml::table();
if (!defpath.empty())
defval = ResolvePath(defpath);
tbl = defval;
}
return Table(tbl, PathPrefix + path);
}