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:
Max Kellermann
2014-08-07 18:54:06 +02:00
parent 0ea66a1275
commit aa2e4d92e0
9 changed files with 210 additions and 68 deletions

@@ -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;