-/* Copyright (c) 2017-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#define XBT_FILE_HPP
#include <string>
+#include <vector>
#include <xbt/base.h>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
+
+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:
/** @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 */