mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibCore: Create ConfigFiles with an already-open File
This moves the fallible action of opening the file, from the constructor, into the factory methods which can propagate any errors. The wrinkle here is that failure to open a ConfigFile in read-only mode is allowed (and expected, since the file may not exist), and treated as if an empty file was successfully opened.
This commit is contained in:
@@ -60,8 +60,7 @@ public:
|
||||
String filename() const { return m_file->filename(); }
|
||||
|
||||
private:
|
||||
explicit ConfigFile(String const& filename, AllowWriting);
|
||||
explicit ConfigFile(String const& filename, int fd);
|
||||
ConfigFile(String const& filename, NonnullRefPtr<File> open_file);
|
||||
|
||||
void reparse();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user