[cpp-sp] branch main updated: Fix property tree header usage.

Scott Cantor cantor.2 at osu.edu
Thu Jan 9 16:46:54 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=f3c4febd92abad01fbcffdc3a29c3c4a8e3a0893

The following commit(s) were added to refs/heads/main by this push:
     new f3c4febd Fix property tree header usage.
f3c4febd is described below

commit f3c4febd92abad01fbcffdc3a29c3c4a8e3a0893
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jan 9 11:46:31 2025 -0500

    Fix property tree header usage.
---
 shibsp/util/BoostPropertySet.cpp | 23 ++++++++++++-----------
 shibsp/util/BoostPropertySet.h   |  2 +-
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/shibsp/util/BoostPropertySet.cpp b/shibsp/util/BoostPropertySet.cpp
index 4c394032..7a4de6c3 100644
--- a/shibsp/util/BoostPropertySet.cpp
+++ b/shibsp/util/BoostPropertySet.cpp
@@ -25,9 +25,10 @@
 #include <algorithm>
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string.hpp>
+#include <boost/property_tree/ptree.hpp>
 
 using namespace shibsp;
-using namespace boost;
+using namespace boost::property_tree;
 using namespace std;
 
 PropertySet::PropertySet()
@@ -56,7 +57,7 @@ void BoostPropertySet::setParent(const PropertySet* parent)
     m_parent = parent;
 }
 
-void BoostPropertySet::load(const property_tree::ptree& pt, const char* unsetter)
+void BoostPropertySet::load(const ptree& pt, const char* unsetter)
 {
     m_pt = &pt;
 
@@ -64,7 +65,7 @@ void BoostPropertySet::load(const property_tree::ptree& pt, const char* unsetter
     if (unsetter) {
         const boost::optional<string> val = pt.get_optional<string>(unsetter);
         if (val) {
-            split(m_unset, val.get(), is_space(), algorithm::token_compress_on);
+            boost::split(m_unset, val.get(), boost::is_space(), boost::algorithm::token_compress_on);
         }
     }
 }
@@ -88,7 +89,7 @@ bool BoostPropertySet::getBool(const char* name, bool defaultValue) const
 {
     if (m_pt) {
         // Check for a child node with the target name and return its value as a bool.
-        const boost::optional<const property_tree::ptree&> child = m_pt->get_child_optional(name);
+        const boost::optional<const ptree&> child = m_pt->get_child_optional(name);
         if (child) {
             static string_to_bool_translator tr;
             return child.get().get_value(defaultValue, tr);
@@ -108,7 +109,7 @@ const char* BoostPropertySet::getString(const char* name, const char* defaultVal
 {
     if (m_pt) {
         // Check for a child node with the target name and return its value as a C string.
-        const boost::optional<const property_tree::ptree&> child = m_pt->get_child_optional(name);
+        const boost::optional<const ptree&> child = m_pt->get_child_optional(name);
         if (child) {
             return child->data().c_str();
         }
@@ -127,12 +128,12 @@ unsigned int BoostPropertySet::getUnsignedInt(const char* name, unsigned int def
 {
     if (m_pt) {
         // Check for a child node with the target name and return its value as a C string.
-        const boost::optional<const property_tree::ptree&> child = m_pt->get_child_optional(name);
+        const boost::optional<const ptree&> child = m_pt->get_child_optional(name);
         if (child) {
             try {
-                return lexical_cast<unsigned int>(child->data());
+                return boost::lexical_cast<unsigned int>(child->data());
             }
-            catch (const bad_lexical_cast&) {
+            catch (const boost::bad_lexical_cast&) {
             }
         }
     }
@@ -150,12 +151,12 @@ int BoostPropertySet::getInt(const char* name, int defaultValue) const
 {
     if (m_pt) {
         // Check for a child node with the target name and return its value as a C string.
-        const boost::optional<const property_tree::ptree&> child = m_pt->get_child_optional(name);
+        const boost::optional<const ptree&> child = m_pt->get_child_optional(name);
         if (child) {
             try {
-                return lexical_cast<int>(child->data());
+                return boost::lexical_cast<int>(child->data());
             }
-            catch (const bad_lexical_cast&) {
+            catch (const boost::bad_lexical_cast&) {
             }
         }
     }
diff --git a/shibsp/util/BoostPropertySet.h b/shibsp/util/BoostPropertySet.h
index 068bde6c..cecc0041 100644
--- a/shibsp/util/BoostPropertySet.h
+++ b/shibsp/util/BoostPropertySet.h
@@ -24,7 +24,7 @@
 #include <shibsp/util/PropertySet.h>
 
 #include <set>
-#include <boost/property_tree/ptree.hpp>
+#include <boost/property_tree/ptree_fwd.hpp>
 
 #if defined (_MSC_VER)
 #    pragma warning( push )

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list