aboutsummaryrefslogtreecommitdiffstats
path: root/src/TextFile.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/TextFile.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/TextFile.cxx b/src/TextFile.cxx
index 4ad59ee4a..da0b33816 100644
--- a/src/TextFile.cxx
+++ b/src/TextFile.cxx
@@ -19,10 +19,26 @@
#include "config.h"
#include "TextFile.hxx"
+#include "fs/Path.hxx"
+#include "fs/FileSystem.hxx"
+
+#include <glib.h>
#include <assert.h>
#include <string.h>
+TextFile::TextFile(const Path &path_fs)
+ :file(FOpen(path_fs, FOpenMode::ReadText)),
+ buffer(g_string_sized_new(step)) {}
+
+TextFile::~TextFile()
+{
+ if (file != nullptr)
+ fclose(file);
+
+ g_string_free(buffer, true);
+}
+
char *
TextFile::ReadLine()
{