fs/io/FileOutputStream: merge all classes into one, add enum Mode

Prepare to add more modes.
This commit is contained in:
Max Kellermann
2016-09-04 12:07:36 +02:00
parent b630afdeda
commit d775f13a03
3 changed files with 122 additions and 140 deletions

View File

@@ -199,7 +199,6 @@ SavePlaylistFile(const PlaylistFileContents &contents, const char *utf8path)
assert(!path_fs.IsNull());
FileOutputStream fos(path_fs);
BufferedOutputStream bos(fos);
for (const auto &uri_utf8 : contents)
@@ -354,7 +353,7 @@ try {
const auto path_fs = spl_map_to_fs(utf8path);
assert(!path_fs.IsNull());
AppendFileOutputStream fos(path_fs);
FileOutputStream fos(path_fs, FileOutputStream::Mode::APPEND_EXISTING);
if (fos.Tell() / (MPD_PATH_MAX + 1) >= playlist_max_length)
throw PlaylistError(PlaylistResult::TOO_LARGE,