Elements  6.2
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/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 
Elements::Kernel::Path::Item
boost::filesystem::path Item
Definition: Path.h:56
Export.h
defines the macros to be used for explicit export of the symbols
std::string
STL class.
Elements::DEFAULT_TMP_MOTIF
const std::string DEFAULT_TMP_MOTIF
The default random creation motif.
Definition: Temporary.h:40
Path.h
provide functions to retrieve resources pointed by environment variables
Elements::TempPath::m_path
Path::Item m_path
Definition: Temporary.h:51
Elements::DEFAULT_TMP_KEEP_VAR
const std::string DEFAULT_TMP_KEEP_VAR
The default environment variable name to keep the temporary object.
Definition: Temporary.h:38
Elements::TempFile
Definition: Temporary.h:61
ELEMENTS_API
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::TempDir
Definition: Temporary.h:55
Elements::TempPath::m_keep_var
const std::string m_keep_var
Definition: Temporary.h:52
Elements::TempPath
Definition: Temporary.h:42
Environment.h
Defines a class to handle the Environment.
Elements::Environment
Python dictionary-like Environment interface.
Definition: Environment.h:44
Elements::TempPath::m_motif
const std::string m_motif
Definition: Temporary.h:50
Elements
Definition: callBackExample.h:35
Elements::Services::DataSync::path
Path::Item path
importing the path item from ElementsKernel
Definition: DataSyncUtils.h:41