1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 09:44:58 +00:00

LibCore: Add ConfigFile::get_for_lib()

This commit is contained in:
AnotherTest 2020-08-17 19:13:15 +04:30 committed by Andreas Kling
parent 1176865276
commit afbeb8f977
2 changed files with 9 additions and 0 deletions

View file

@ -34,6 +34,14 @@
namespace Core {
NonnullRefPtr<ConfigFile> ConfigFile::get_for_lib(const String& lib_name)
{
String directory = StandardPaths::config_directory();
auto path = String::format("%s/lib/%s.ini", directory.characters(), lib_name.characters());
return adopt(*new ConfigFile(path));
}
NonnullRefPtr<ConfigFile> ConfigFile::get_for_app(const String& app_name)
{
String directory = StandardPaths::config_directory();