Elements 6.3.3
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Temporary.h
Go to the documentation of this file.
1
20
25
26#ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_TEMPORARY_H_
27#define ELEMENTSKERNEL_ELEMENTSKERNEL_TEMPORARY_H_
28
29#include <string>
30
31#include "ElementsKernel/Environment.h" // for Environment
32#include "ElementsKernel/Export.h" // ELEMENTS_API
33#include "ElementsKernel/Path.h" // for Path::Item
34
35namespace Elements {
36
38const std::string DEFAULT_TMP_KEEP_VAR{"KEEPTEMPDIR"};
40const std::string DEFAULT_TMP_MOTIF{"%%%%-%%%%-%%%%-%%%%"};
41
43public:
44 explicit TempPath(const std::string& motif = DEFAULT_TMP_MOTIF, const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
45 virtual ~TempPath();
46 Path::Item path() const;
47 std::string motif() const;
48
49private:
51 Path::Item m_path;
53};
54
56public:
57 explicit TempDir(const std::string& motif = DEFAULT_TMP_MOTIF, const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
58 virtual ~TempDir();
59};
60
62public:
63 explicit TempFile(const std::string& motif = DEFAULT_TMP_MOTIF, const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
64 virtual ~TempFile();
65};
66
68
72
73} // namespace Elements
74
75#endif // ELEMENTSKERNEL_ELEMENTSKERNEL_TEMPORARY_H_
76
Defines a class to handle the Environment.
defines the macros to be used for explicit export of the symbols
provide functions to retrieve resources pointed by environment variables
Python dictionary-like Environment interface.
Definition Environment.h:44
TempDir(const std::string &motif=DEFAULT_TMP_MOTIF, const std::string &keep_var=DEFAULT_TMP_KEEP_VAR)
Definition Temporary.cpp:83
virtual ~TempDir()
TempFile(const std::string &motif=DEFAULT_TMP_MOTIF, const std::string &keep_var=DEFAULT_TMP_KEEP_VAR)
Definition Temporary.cpp:92
Path::Item path() const
Definition Temporary.cpp:75
const std::string m_keep_var
Definition Temporary.h:52
const std::string m_motif
Definition Temporary.h:50
Path::Item m_path
Definition Temporary.h:51
TempPath(const std::string &motif=DEFAULT_TMP_MOTIF, const std::string &keep_var=DEFAULT_TMP_KEEP_VAR)
Definition Temporary.cpp:43
std::string motif() const
Definition Temporary.cpp:79
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition Export.h:74
const std::string DEFAULT_TMP_MOTIF
The default random creation motif.
Definition Temporary.h:40
Environment TempEnv
Definition Temporary.h:67
const std::string DEFAULT_TMP_KEEP_VAR
The default environment variable name to keep the temporary object.
Definition Temporary.h:38