Elements  5.8
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 #include <boost/filesystem.hpp>
31 
32 #include "ElementsKernel/Export.h" // ELEMENTS_API
33 #include "ElementsKernel/Environment.h" // for Environment
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();
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 
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
boost::filesystem::path m_path
Definition: Temporary.h:51
boost::filesystem::path path
Definition: DataSyncUtils.h:33
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Defines a class to handle the Environment.
const std::string DEFAULT_TMP_KEEP_VAR
The default environment variable name to keep the temporary object.
Definition: Temporary.h:38