explicit Path(std::string path): path_(std::move(path)) {}
/** @brief Returns the full path name */
- std::string getName() { return path_; }
+ std::string get_name() { return path_; }
/** @brief Returns the directory component of a path (reimplementation of POSIX dirname) */
- std::string getDirname();
+ std::string get_dir_name();
/** @brief Returns the file component of a path (reimplementation of POSIX basename) */
- std::string getBasename();
+ std::string get_base_name();
private:
std::string path_;
std::vector<simgrid::xbt::VmMap> const& maps,
simgrid::mc::ObjectInformation* result)
{
- std::string name = simgrid::xbt::Path(result->file_name).getBasename();
+ std::string name = simgrid::xbt::Path(result->file_name).get_base_name();
for (size_t i = 0; i < maps.size(); ++i) {
simgrid::xbt::VmMap const& reg = maps[i];
if (maps[i].pathname.empty())
continue;
- std::string map_basename = simgrid::xbt::Path(maps[i].pathname).getBasename();
+ std::string map_basename = simgrid::xbt::Path(maps[i].pathname).get_base_name();
if (map_basename != name)
continue;
// If dot_output enabled, do not handle the corresponding file
if (dot_output != nullptr) {
- std::string link_basename = simgrid::xbt::Path(link).getBasename();
+ std::string link_basename = simgrid::xbt::Path(link).get_base_name();
if (link_basename == _sg_mc_dot_output_file.get())
continue;
}
static std::string get_lib_name(const std::string& pathname)
{
- std::string map_basename = simgrid::xbt::Path(pathname).getBasename();
+ std::string map_basename = simgrid::xbt::Path(pathname).get_base_name();
std::string libname;
size_t pos = map_basename.rfind(".so");
if (not acyclic_graph_detail(result)) {
XBT_ERROR("The DAX described in %s is not a DAG. It contains a cycle.",
- simgrid::xbt::Path(filename).getBasename().c_str());
+ simgrid::xbt::Path(filename).get_base_name().c_str());
xbt_dynar_foreach(result, cpt, file)
SD_task_destroy(file);
xbt_dynar_free_container(&result);
}
if (result && not acyclic_graph_detail(result)) {
- std::string base = simgrid::xbt::Path(filename).getBasename();
+ std::string base = simgrid::xbt::Path(filename).get_base_name();
XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", base.c_str());
xbt_dynar_free(&result);
result = nullptr;
xbt_assert(file, "Cannot parse the nullptr file. Bypassing the parser is strongly deprecated nowadays.");
surf_parsed_filename = file;
- std::string dir = simgrid::xbt::Path(file).getDirname();
+ std::string dir = simgrid::xbt::Path(file).get_dir_name();
surf_path.push_back(dir);
surf_file_to_parse = surf_fopen(file, "r");
#include <cstring>
#include <libgen.h> /* POSIX dirname */
-std::string simgrid::xbt::Path::getDirname()
+std::string simgrid::xbt::Path::get_dir_name()
{
std::string p(path_);
char *res = dirname(&p[0]);
return std::string(res, strlen(res));
}
-std::string simgrid::xbt::Path::getBasename()
+std::string simgrid::xbt::Path::get_base_name()
{
std::string p(path_);
char *res = basename(&p[0]);