24 #ifndef _TPIE_TEMPNAM_H
25 #define _TPIE_TEMPNAM_H
28 #include <tpie/tpie_export.h>
31 #include <boost/intrusive_ptr.hpp>
34 #define TMPDIR_ENV "TMPDIR"
38 #define AMI_SINGLE_DEVICE_ENV "AMI_SINGLE_DEVICE"
43 explicit tempfile_error(
const std::string & what): std::runtime_error(what) {}
69 static std::string tpie_name(
const std::string& post_base =
"",
70 const std::string& dir =
"",
71 const std::string& ext =
"");
79 static std::string tpie_dir_name(
const std::string& post_base =
"",
80 const std::string& dir =
"");
85 static std::string get_system_path();
92 static bool try_directory(
const std::string& path);
100 static void set_default_path(
const std::string& path,
const std::string& subdir=
"");
106 static void set_default_base_name(
const std::string& name);
112 static void set_default_extension(
const std::string& ext);
119 static const std::string& get_default_path();
126 static const std::string& get_default_base_name();
133 static const std::string& get_default_extension();
152 static std::string get_actual_path();
155 void finish_tempfile();
170 const std::string & path();
171 void update_recorded_size(stream_size_type size);
173 bool is_persistent()
const {
177 void set_persistent(
bool p) {
187 stream_size_type m_recordedSize;
188 memory_size_type m_count;
222 return m_inner->is_persistent();
230 m_inner->set_persistent(p);
244 return m_inner->path();
254 void update_recorded_size(stream_size_type size) {
255 m_inner->update_recorded_size(size);
258 boost::intrusive_ptr<bits::temp_file_inner> m_inner;
263 #endif // _TPIE_TEMPNAM_H