*Save, *State: use the OutputStream API instead of FILE*

This commit is contained in:
Max Kellermann
2014-07-30 20:58:14 +02:00
parent 0d0ccacdf3
commit 9fb351a139
23 changed files with 169 additions and 133 deletions

View File

@@ -29,6 +29,8 @@
#include "playlist/PlaylistRegistry.hxx"
#include "playlist/PlaylistPlugin.hxx"
#include "fs/Path.hxx"
#include "fs/output/BufferedOutputStream.hxx"
#include "fs/output/StdioOutputStream.hxx"
#include "util/Error.hxx"
#include "thread/Cond.hxx"
#include "Log.hxx"
@@ -40,6 +42,15 @@
#include <unistd.h>
#include <stdlib.h>
static void
tag_save(FILE *file, const Tag &tag)
{
StdioOutputStream sos(file);
BufferedOutputStream bos(sos);
tag_save(bos, tag);
bos.Flush();
}
int main(int argc, char **argv)
{
const char *uri;

View File

@@ -28,6 +28,8 @@
#include "util/Error.hxx"
#include "thread/Cond.hxx"
#include "Log.hxx"
#include "fs/output/BufferedOutputStream.hxx"
#include "fs/output/StdioOutputStream.hxx"
#ifdef ENABLE_ARCHIVE
#include "archive/ArchiveList.hxx"
@@ -40,6 +42,15 @@
#include <unistd.h>
#include <stdlib.h>
static void
tag_save(FILE *file, const Tag &tag)
{
StdioOutputStream sos(file);
BufferedOutputStream bos(sos);
tag_save(bos, tag);
bos.Flush();
}
static int
dump_input_stream(InputStream *is)
{