2018-10-10 09:53:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-03 23:27:16 +00:00
|
|
|
#include "AKString.h"
|
2018-10-10 09:53:07 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
class TemporaryFile {
|
|
|
|
public:
|
|
|
|
TemporaryFile();
|
|
|
|
~TemporaryFile();
|
|
|
|
|
2019-01-31 16:31:23 +00:00
|
|
|
bool is_valid() const { return m_stream; }
|
2018-10-10 09:53:07 +00:00
|
|
|
FILE* stream() { return m_stream; }
|
2019-01-31 16:31:23 +00:00
|
|
|
String file_name() const { return m_file_name; }
|
2018-10-10 09:53:07 +00:00
|
|
|
void sync();
|
|
|
|
|
|
|
|
private:
|
|
|
|
FILE* m_stream { nullptr };
|
2019-01-31 16:31:23 +00:00
|
|
|
String m_file_name;
|
2018-10-10 09:53:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
using AK::TemporaryFile;
|
|
|
|
|