summaryrefslogtreecommitdiff
path: root/AK/TemporaryFile.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-10 11:53:07 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-10 11:53:07 +0200
commit5a300551574451fbf509685d11095bda4fcb20be (patch)
tree7bd68b5b0bc9daab6899be52dc694b7162dc6b89 /AK/TemporaryFile.h
downloadserenity-5a300551574451fbf509685d11095bda4fcb20be.zip
Import all this stuff into a single repo called Serenity.
Diffstat (limited to 'AK/TemporaryFile.h')
-rw-r--r--AK/TemporaryFile.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/AK/TemporaryFile.h b/AK/TemporaryFile.h
new file mode 100644
index 0000000000..bcc88b7652
--- /dev/null
+++ b/AK/TemporaryFile.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "String.h"
+#include <stdio.h>
+
+namespace AK {
+
+class TemporaryFile {
+public:
+ TemporaryFile();
+ ~TemporaryFile();
+
+ bool isValid() const { return m_stream; }
+ FILE* stream() { return m_stream; }
+ String fileName() const { return m_fileName; }
+ void sync();
+
+private:
+ FILE* m_stream { nullptr };
+ String m_fileName;
+};
+
+}
+
+using AK::TemporaryFile;
+