Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "[examples/s4u-dht-chord] Handle TimeoutException which may be thrown by Comm...
[simgrid.git] / include / xbt / file.hpp
index 5dde47a6d709c7503ccd771509407c6db30e2e43..fd29ff0eb852fa1aca1cf33d26683b98e68c8bf4 100644 (file)
 #include <vector>
 #include <xbt/base.h>
 
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
 
-FILE* fopen_path(const std::string& name, const char* mode, const std::vector<std::string>& path);
-std::ifstream* ifsopen_path(const std::string& name, const std::vector<std::string>& path);
+void path_push(std::string const& str);
+void path_pop();
+FILE* path_fopen(const std::string& name, const char* mode);
+std::ifstream* path_ifsopen(const std::string& name);
+std::string path_to_string();
 
 class Path {
 public:
@@ -32,9 +34,12 @@ public:
   /** @brief Returns the file component of a path (reimplementation of POSIX basename) */
   std::string get_base_name() const;
 
+  /** @brief Returns the name of a directory suitable for creating temporary files (e.g. "/tmp") */
+  static Path get_tmpdir();
+
 private:
   std::string path_;
 };
-}}
+} // namespace simgrid::xbt
 
 #endif                          /* XBT_FILE_HPP */