lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master c98c00d 10/33: Say "basename" rather than "le


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c98c00d 10/33: Say "basename" rather than "leaf"
Date: Mon, 3 May 2021 08:15:52 -0400 (EDT)

branch: master
commit c98c00dbe5559b76a22b502dcce471f347514b3c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Say "basename" rather than "leaf"
    
    The POSIX dirname/basename nomenclature is universally understood.
    Boost used "leaf", whose meaning was unmistakable (although a filepath
    is hardly a tree). Now std::filesystem uses "filename", which is too
    easily misunderstood: in the grammar, a full path can be
      filename / filename
    but the filename() function is specified to return '*--end()', so
      filename(filename0 / filename1)
    returns filename1, which is "the" filename, though filename0 is also
    a filename.
---
 dbdict.cpp             | 4 ++--
 dbdict.hpp             | 2 +-
 lingo.cpp              | 4 ++--
 lingo.hpp              | 2 +-
 my_proem.cpp           | 4 ++--
 my_proem.hpp           | 2 +-
 path_utility_test.cpp  | 2 +-
 product_data.cpp       | 4 ++--
 product_data.hpp       | 2 +-
 rounding_rules.cpp     | 4 ++--
 rounding_rules.hpp     | 2 +-
 stratified_charges.cpp | 4 ++--
 stratified_charges.hpp | 2 +-
 wx_test_output_pdf.hpp | 8 ++++----
 xml_serializable.hpp   | 2 +-
 xml_serializable.tpp   | 2 +-
 16 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/dbdict.cpp b/dbdict.cpp
index 44fcf3b..89fff73 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -680,10 +680,10 @@ void DBDictionary::write_element
 
 void DBDictionary::write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     ) const
 {
-    ::write_proem(document, file_leaf_name);
+    ::write_proem(document, file_basename);
 }
 
 /// Set a value. (The historical name "Add" is now misleading.)
diff --git a/dbdict.hpp b/dbdict.hpp
index 3337fd2..19f47ef 100644
--- a/dbdict.hpp
+++ b/dbdict.hpp
@@ -89,7 +89,7 @@ class LMI_SO DBDictionary
         ) const override;
     void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         ) const override;
 
     // To make sure these members match e_database_key enumerators:
diff --git a/lingo.cpp b/lingo.cpp
index aa8cb62..f5f3913 100644
--- a/lingo.cpp
+++ b/lingo.cpp
@@ -675,8 +675,8 @@ std::string const& lingo::xml_root_name()
 
 void lingo::write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     )
 {
-    ::write_proem(document, file_leaf_name);
+    ::write_proem(document, file_basename);
 }
diff --git a/lingo.hpp b/lingo.hpp
index d8ce551..771525c 100644
--- a/lingo.hpp
+++ b/lingo.hpp
@@ -54,7 +54,7 @@ class LMI_SO lingo final
     static std::string const& xml_root_name();
     static void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         );
 
     std::unordered_map<int,std::string> map_;
diff --git a/my_proem.cpp b/my_proem.cpp
index 13bc122..77ca446 100644
--- a/my_proem.cpp
+++ b/my_proem.cpp
@@ -32,12 +32,12 @@
 /// Copy this file to '../products/src' and edit the copy to specify
 /// a proprietary proem, such as a specific copyright notice.
 ///
-/// Argument 'file_leaf_name', unused in this specimen implementation,
+/// Argument 'file_basename', unused in this specimen implementation,
 /// permits the proem to vary by file name.
 
 void write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     // file_leaf_name
+    ,std::string const&     // file_basename
     )
 {
     std::string const y(value_cast<std::string>(today().year()));
diff --git a/my_proem.hpp b/my_proem.hpp
index f6f3461..5f25123 100644
--- a/my_proem.hpp
+++ b/my_proem.hpp
@@ -30,7 +30,7 @@
 
 void write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     );
 
 #endif // my_proem_hpp
diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index ded5568..1adea9f 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -156,7 +156,7 @@ void test_serial_file_path()
         ,serial_file_path("x.ignored", "",      12345, "y").string()
         );
 
-    // Discard path from input census filepath; use only leaf.
+    // Discard path from input census filepath; use its basename only.
     LMI_TEST_EQUAL
         (serial_file_path("/path/to/x", "",      12345, "y").string()
         ,serial_file_path("x"         , "",      12345, "y").string()
diff --git a/product_data.cpp b/product_data.cpp
index 2ef5f3b..a02f042 100644
--- a/product_data.cpp
+++ b/product_data.cpp
@@ -415,10 +415,10 @@ void product_data::write_element
 
 void product_data::write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     ) const
 {
-    ::write_proem(document, file_leaf_name);
+    ::write_proem(document, file_basename);
 }
 
 bool product_data::is_detritus(std::string const& s) const
diff --git a/product_data.hpp b/product_data.hpp
index 4447c87..d5bc741 100644
--- a/product_data.hpp
+++ b/product_data.hpp
@@ -129,7 +129,7 @@ class LMI_SO product_data
         ) const override;
     void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         ) const override;
     bool is_detritus(std::string const&) const override;
     void redintegrate_ex_ante
diff --git a/rounding_rules.cpp b/rounding_rules.cpp
index cb36460..f23298f 100644
--- a/rounding_rules.cpp
+++ b/rounding_rules.cpp
@@ -265,10 +265,10 @@ void rounding_rules::write_element
 
 void rounding_rules::write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     ) const
 {
-    ::write_proem(document, file_leaf_name);
+    ::write_proem(document, file_basename);
 }
 
 void rounding_rules::write_rounding_files()
diff --git a/rounding_rules.hpp b/rounding_rules.hpp
index 4030d69..62e0a16 100644
--- a/rounding_rules.hpp
+++ b/rounding_rules.hpp
@@ -130,7 +130,7 @@ class LMI_SO rounding_rules final
         ) const override;
     void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         ) const override;
 
     rounding_parameters round_specamt_           ;
diff --git a/stratified_charges.cpp b/stratified_charges.cpp
index 9ff5e14..1312547 100644
--- a/stratified_charges.cpp
+++ b/stratified_charges.cpp
@@ -581,10 +581,10 @@ void stratified_charges::write_element
 
 void stratified_charges::write_proem
     (xml_lmi::xml_document& document
-    ,std::string const&     file_leaf_name
+    ,std::string const&     file_basename
     ) const
 {
-    ::write_proem(document, file_leaf_name);
+    ::write_proem(document, file_basename);
 }
 
 void stratified_charges::write_strata_files()
diff --git a/stratified_charges.hpp b/stratified_charges.hpp
index 85909c6..ae4e867 100644
--- a/stratified_charges.hpp
+++ b/stratified_charges.hpp
@@ -175,7 +175,7 @@ class LMI_SO stratified_charges final
         ) const override;
     void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         ) const override;
 
     double banded_curr_sepacct_load
diff --git a/wx_test_output_pdf.hpp b/wx_test_output_pdf.hpp
index cb9a51d..c0903da 100644
--- a/wx_test_output_pdf.hpp
+++ b/wx_test_output_pdf.hpp
@@ -63,12 +63,12 @@ class output_pdf_existence_checker :public 
output_file_existence_checker
         }
 
   private:
-    // Return the full path in the print directory for the file with the given
-    // leaf name.
-    static fs::path make_full_print_path(std::string const& leaf)
+    // Return the full path in the print directory for the file with
+    // the given basename.
+    static fs::path make_full_print_path(std::string const& basename)
         {
         fs::path p(configurable_settings::instance().print_directory());
-        p /= leaf;
+        p /= basename;
         return p;
         }
 
diff --git a/xml_serializable.hpp b/xml_serializable.hpp
index 9b137f7..536dd39 100644
--- a/xml_serializable.hpp
+++ b/xml_serializable.hpp
@@ -89,7 +89,7 @@ class LMI_SO xml_serializable
         ) const;
     virtual void write_proem
         (xml_lmi::xml_document& document
-        ,std::string const&     file_leaf_name
+        ,std::string const&     file_basename
         ) const;
 
     // Backward compatibility.
diff --git a/xml_serializable.tpp b/xml_serializable.tpp
index 954d538..230960a 100644
--- a/xml_serializable.tpp
+++ b/xml_serializable.tpp
@@ -273,7 +273,7 @@ void xml_serializable<T>::write_element
 template<typename T>
 void xml_serializable<T>::write_proem
     (xml_lmi::xml_document& // document
-    ,std::string const&     // file_leaf_name
+    ,std::string const&     // file_basename
     ) const
 {
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]