Skip to content

Commit

Permalink
LibCore: Add CConfigFile::open() for opening an arbitrary INI file
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Nov 11, 2019
1 parent 11fd7ae commit 37329f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/LibCore/CConfigFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ NonnullRefPtr<CConfigFile> CConfigFile::get_for_system(const String& app_name)
return adopt(*new CConfigFile(path));
}

NonnullRefPtr<CConfigFile> CConfigFile::open(const String& path)
{
return adopt(*new CConfigFile(path));
}

CConfigFile::CConfigFile(const String& file_name)
: m_file_name(file_name)
{
Expand Down
1 change: 1 addition & 0 deletions Libraries/LibCore/CConfigFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class CConfigFile : public RefCounted<CConfigFile> {
public:
static NonnullRefPtr<CConfigFile> get_for_app(const String& app_name);
static NonnullRefPtr<CConfigFile> get_for_system(const String& app_name);
static NonnullRefPtr<CConfigFile> open(const String& path);
~CConfigFile();

bool has_group(const String&) const;
Expand Down

0 comments on commit 37329f8

Please sign in to comment.