fs/io/BufferedReader: new class to replace class TextFile
The new class is pluggable, to prepare for gzipped database files. For now, the TextFile class remains, and will be refactored away later.
This commit is contained in:
@@ -168,12 +168,9 @@ SimpleDatabase::Load(Error &error)
|
||||
assert(!path.IsNull());
|
||||
assert(root != nullptr);
|
||||
|
||||
TextFile file(path);
|
||||
if (file.HasFailed()) {
|
||||
error.FormatErrno("Failed to open database file \"%s\"",
|
||||
path_utf8.c_str());
|
||||
TextFile file(path, error);
|
||||
if (file.HasFailed())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!db_load_internal(file, *root, error))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user