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

View File

@@ -103,10 +103,10 @@ StateFile::Read()
FormatDebug(state_file_domain, "Loading state file %s", path_utf8.c_str());
TextFile file(path);
Error error;
TextFile file(path, error);
if (file.HasFailed()) {
FormatErrno(state_file_domain, "failed to open %s",
path_utf8.c_str());
LogError(error);
return;
}