Elements  6.0.1
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Temporary.h
Go to the documentation of this file.
1 
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 
35 namespace Elements {
36 
38 const std::string DEFAULT_TMP_KEEP_VAR{"KEEPTEMPDIR"};
40 const std::string DEFAULT_TMP_MOTIF{"%%%%-%%%%-%%%%-%%%%"};
41 
43 public:
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 
49 private:
53 };
54 
55 class ELEMENTS_API TempDir : public TempPath {
56 public:
57  explicit TempDir(const std::string& motif = DEFAULT_TMP_MOTIF, const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
58  virtual ~TempDir();
59 };
60 
61 class ELEMENTS_API TempFile : public TempPath {
62 public:
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 
73 } // namespace Elements
74 
75 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_TEMPORARY_H_
76 
const std::string m_keep_var
Definition: Temporary.h:52
const std::string DEFAULT_TMP_MOTIF
The default random creation motif.
Definition: Temporary.h:40
STL class.
defines the macros to be used for explicit export of the symbols
const std::string m_motif
Definition: Temporary.h:50
Path::Item m_path
Definition: Temporary.h:51
boost::filesystem::path Item
Definition: Path.h:56
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Python dictionary-like Environment interface.
Definition: Environment.h:44
Defines a class to handle the Environment.
provide functions to retrieve resources pointed by environment variables
const std::string DEFAULT_TMP_KEEP_VAR
The default environment variable name to keep the temporary object.
Definition: Temporary.h:38
Path::Item path
importing the path item from ElementsKernel
Definition: DataSyncUtils.h:41