From a4b0c4ab9d54f75705f6d8b6c14b2f52a1245ea2 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 1 Jun 2018 22:12:06 +0200 Subject: [PATCH] Snake casing simgrid::xbt::Path. --- include/xbt/file.hpp | 6 +++--- src/mc/mc_checkpoint.cpp | 6 +++--- src/mc/remote/RemoteClient.cpp | 2 +- src/simdag/sd_daxloader.cpp | 2 +- src/simdag/sd_dotloader.cpp | 2 +- src/surf/xml/surfxml_sax_cb.cpp | 2 +- src/xbt/xbt_os_file.cpp | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/xbt/file.hpp b/include/xbt/file.hpp index c3948095f5..159891a03d 100644 --- a/include/xbt/file.hpp +++ b/include/xbt/file.hpp @@ -19,11 +19,11 @@ public: 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_; diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index bd1a8d719a..8e872d906c 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -186,13 +186,13 @@ void find_object_address( std::vector 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; @@ -518,7 +518,7 @@ static std::vector get_current_fds(pid_t pid) // 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; } diff --git a/src/mc/remote/RemoteClient.cpp b/src/mc/remote/RemoteClient.cpp index 6b8d74bace..da2a2c338e 100644 --- a/src/mc/remote/RemoteClient.cpp +++ b/src/mc/remote/RemoteClient.cpp @@ -114,7 +114,7 @@ static bool is_filtered_lib(const std::string& libname) 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"); diff --git a/src/simdag/sd_daxloader.cpp b/src/simdag/sd_daxloader.cpp index 07a3919c57..4a7b40552c 100644 --- a/src/simdag/sd_daxloader.cpp +++ b/src/simdag/sd_daxloader.cpp @@ -222,7 +222,7 @@ xbt_dynar_t SD_daxload(const char *filename) 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); diff --git a/src/simdag/sd_dotloader.cpp b/src/simdag/sd_dotloader.cpp index 29c5294248..581f151fab 100644 --- a/src/simdag/sd_dotloader.cpp +++ b/src/simdag/sd_dotloader.cpp @@ -239,7 +239,7 @@ xbt_dynar_t SD_dotload_generic(const char* filename, bool sequential, bool sched } 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; diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 9e8f53489a..7719224400 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -960,7 +960,7 @@ void surf_parse_open(const char *file) 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"); diff --git a/src/xbt/xbt_os_file.cpp b/src/xbt/xbt_os_file.cpp index f569399136..edf22816ae 100644 --- a/src/xbt/xbt_os_file.cpp +++ b/src/xbt/xbt_os_file.cpp @@ -15,14 +15,14 @@ #include #include /* 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]); -- 2.20.1