aboutsummaryrefslogtreecommitdiffstats
path: root/src/TextFile.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextFile.hxx')
-rw-r--r--src/TextFile.hxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/TextFile.hxx b/src/TextFile.hxx
index d593e0961..6aff4ca70 100644
--- a/src/TextFile.hxx
+++ b/src/TextFile.hxx
@@ -21,10 +21,11 @@
#define MPD_TEXT_FILE_HXX
#include "gcc.h"
-#include "fs/Path.hxx"
-#include "fs/FileSystem.hxx"
-#include <glib.h>
+#include <stdio.h>
+
+class Path;
+typedef struct _GString GString;
class TextFile {
static constexpr size_t max_length = 512 * 1024;
@@ -35,18 +36,11 @@ class TextFile {
GString *const buffer;
public:
- TextFile(const Path &path_fs)
- :file(FOpen(path_fs, FOpenMode::ReadText)),
- buffer(g_string_sized_new(step)) {}
+ TextFile(const Path &path_fs);
TextFile(const TextFile &other) = delete;
- ~TextFile() {
- if (file != nullptr)
- fclose(file);
-
- g_string_free(buffer, true);
- }
+ ~TextFile();
bool HasFailed() const {
return gcc_unlikely(file == nullptr);