1 /* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
16 void path_push(std::string const& str);
18 FILE* path_fopen(const std::string& name, const char* mode);
19 std::ifstream* path_ifsopen(const std::string& name);
20 std::string path_to_string();
24 /** Build a path from the current working directory (CWD) */
26 /** Build a path from the provided parameter */
27 explicit Path(const char* path): path_(path) {}
28 /** Build a path from the provided parameter */
29 explicit Path(const std::string& path) : path_(path) {}
31 /** @brief Returns the full path name */
32 const std::string& get_name() const { return path_; }
33 /** @brief Returns the directory component of a path (reimplementation of POSIX dirname) */
34 std::string get_dir_name() const;
35 /** @brief Returns the file component of a path (reimplementation of POSIX basename) */
36 std::string get_base_name() const;
43 #endif /* XBT_FILE_HPP */