Elements  5.12.0
A C++ base framework for the Euclid Software.
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/Export.h" // ELEMENTS_API
32 #include "ElementsKernel/Environment.h" // for Environment
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,
45  const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
46  virtual ~TempPath();
47  Path::Item path() const;
48  std::string motif() const;
49 private:
53 };
54 
55 
56 class ELEMENTS_API TempDir : public TempPath {
57 public:
58  explicit TempDir(const std::string& motif = DEFAULT_TMP_MOTIF,
59  const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
60  virtual ~TempDir();
61 };
62 
63 
64 class ELEMENTS_API TempFile : public TempPath {
65 public:
66  explicit TempFile(const std::string& motif = DEFAULT_TMP_MOTIF,
67  const std::string& keep_var = DEFAULT_TMP_KEEP_VAR);
68  virtual ~TempFile();
69 };
70 
72 
77 } // namespace Elements
78 
79 #endif // ELEMENTSKERNEL_ELEMENTSKERNEL_TEMPORARY_H_
80 
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
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
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::Path::Item path
Definition: DataSyncUtils.h:39
boost::filesystem::path Item
Definition: Path.h:61
const std::string DEFAULT_TMP_MOTIF
The default random creation motif.
Definition: Temporary.h:40
const std::string DEFAULT_TMP_KEEP_VAR
The default environment variable name to keep the temporary object.
Definition: Temporary.h:38