From 602ce201f55e153cbc026f81bfa75ebee0acf51d Mon Sep 17 00:00:00 2001
From: Rene Milk <rene.milk@uni-muenster.de>
Date: Mon, 8 Sep 2014 14:37:14 +0200
Subject: [PATCH] [filesystem] renames ambiguous pathOnly to directoryOnly

---
 dune/stuff/common/configuration.cc |  6 +++---
 dune/stuff/common/filesystem.cc    | 10 ++++++++--
 dune/stuff/common/filesystem.hh    |  3 ++-
 dune/stuff/common/print.hh         |  1 +
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/dune/stuff/common/configuration.cc b/dune/stuff/common/configuration.cc
index 8fc5daa9a..0f32b0076 100644
--- a/dune/stuff/common/configuration.cc
+++ b/dune/stuff/common/configuration.cc
@@ -156,7 +156,7 @@ Configuration::Configuration(const std::vector<std::string> keys, const std::ini
 Configuration::~Configuration()
 {
   if (log_on_exit_ && !empty()) {
-    testCreateDirectory(pathOnly(logfile_));
+    testCreateDirectory(directoryOnly(logfile_));
     std::unique_ptr<boost::filesystem::ofstream> out(DSC::make_ofstream(logfile_));
     report(*out);
     print_requests(*out);
@@ -176,7 +176,7 @@ void Configuration::set_warn_on_default_access(const bool value)
 void Configuration::set_log_on_exit(const bool value)
 {
   if (!log_on_exit_ && value)
-    testCreateDirectory(pathOnly(logfile_));
+    testCreateDirectory(directoryOnly(logfile_));
   log_on_exit_ = value;
 }
 
@@ -185,7 +185,7 @@ void Configuration::set_logfile(const std::string logfile)
   if (logfile.empty())
     DUNE_THROW(Exceptions::wrong_input_given, "logfile must not be empty!");
   if (log_on_exit_)
-    testCreateDirectory(pathOnly(logfile_));
+    testCreateDirectory(directoryOnly(logfile_));
 }
 
 std::set<Request> Configuration::getMismatchedDefaults(Configuration::RequestMapType::value_type pair) const
diff --git a/dune/stuff/common/filesystem.cc b/dune/stuff/common/filesystem.cc
index df56affa5..2f6e4739c 100644
--- a/dune/stuff/common/filesystem.cc
+++ b/dune/stuff/common/filesystem.cc
@@ -12,11 +12,17 @@ namespace Stuff {
 namespace Common {
 
 //! strip filename from \path if present, return empty string if only filename present
-std::string pathOnly(std::string _path)
+std::string directoryOnly(std::string _path)
 {
   return boost::filesystem::path(_path).parent_path().string();
 }
 
+//! strip filename from \path if present, return empty string if only filename present
+std::string pathOnly(std::string _path)
+{
+  return directoryOnly(_path);
+}
+
 //! return everything after the last slash
 std::string filenameOnly(const std::string& _path)
 {
@@ -30,7 +36,7 @@ std::string filenameOnly(const std::string& _path)
 //! may include filename, will be stripped
 void testCreateDirectory(const std::string _path)
 {
-  std::string pathonly = pathOnly(_path);
+  std::string pathonly = directoryOnly(_path);
   if (!pathonly.empty())
     boost::filesystem::create_directories(pathonly);
 }
diff --git a/dune/stuff/common/filesystem.hh b/dune/stuff/common/filesystem.hh
index 86d37a114..5304bc752 100644
--- a/dune/stuff/common/filesystem.hh
+++ b/dune/stuff/common/filesystem.hh
@@ -20,7 +20,8 @@ namespace Stuff {
 namespace Common {
 
 //! strip filename from \path if present, return empty string if only filename present
-std::string pathOnly(std::string _path);
+std::string directoryOnly(std::string _path);
+std::string DUNE_DEPRECATED_MSG("Use directoryOnly instead!") pathOnly(std::string _path);
 
 //! return everything after the last slash
 std::string filenameOnly(const std::string& _path);
diff --git a/dune/stuff/common/print.hh b/dune/stuff/common/print.hh
index 4e38b1373..348e14d23 100644
--- a/dune/stuff/common/print.hh
+++ b/dune/stuff/common/print.hh
@@ -496,6 +496,7 @@ void matrixToGnuplotFile(const Matrix& matrix, std::string filename)
   file.close();
 } // matrixToGnuplotFile
 
+//! maps 1,2,3 to x,y,z / X,Y,Z
 inline std::string dimToAxisName(const unsigned int dim, const bool capitalize = false)
 {
   char c = 'x';
-- 
GitLab