Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Snake casing simgrid::xbt::Path.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 1 Jun 2018 20:12:06 +0000 (22:12 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 1 Jun 2018 20:39:13 +0000 (22:39 +0200)
include/xbt/file.hpp
src/mc/mc_checkpoint.cpp
src/mc/remote/RemoteClient.cpp
src/simdag/sd_daxloader.cpp
src/simdag/sd_dotloader.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/xbt_os_file.cpp

index c394809..159891a 100644 (file)
@@ -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_;
index bd1a8d7..8e872d9 100644 (file)
@@ -186,13 +186,13 @@ void find_object_address(
   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;
 
@@ -518,7 +518,7 @@ static std::vector<s_fd_infos_t> 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;
     }
index 6b8d74b..da2a2c3 100644 (file)
@@ -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");
index 07a3919..4a7b405 100644 (file)
@@ -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);
index 29c5294..581f151 100644 (file)
@@ -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;
index 9e8f534..7719224 100644 (file)
@@ -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");
index f569399..edf2281 100644 (file)
 #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]);