From 2b4dbf124539938d4dba42eec2af8b0bd3bd3686 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann <christoph.lehmann@ufz.de> Date: Fri, 29 Jan 2016 10:09:14 +0100 Subject: [PATCH] md [BL] changed docu --- BaseLib/ConfigTreeNew.cpp | 4 ++-- BaseLib/ConfigTreeNew.h | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/BaseLib/ConfigTreeNew.cpp b/BaseLib/ConfigTreeNew.cpp index fffbdad9efb..a15409eb8bf 100644 --- a/BaseLib/ConfigTreeNew.cpp +++ b/BaseLib/ConfigTreeNew.cpp @@ -350,7 +350,7 @@ ConfigTreeNew::checkAndInvalidate() auto const& tag = p.first.second; auto const& count = p.second.count; - if (p.first.first) { // tag + if (p.first.first) { // XML attribute if (count > 0) { warning("XML attribute \"" + tag + "\" has been read " + std::to_string(count) + " time(s) more than it was present in the configuration tree."); @@ -358,7 +358,7 @@ ConfigTreeNew::checkAndInvalidate() warning("XML attribute \"" + tag + "\" has been read " + std::to_string(-count) + " time(s) less than it was present in the configuration tree."); } - } else { // XML attribute + } else { // tag if (count > 0) { warning("Key <" + tag + "> has been read " + std::to_string(count) + " time(s) more than it was present in the configuration tree."); diff --git a/BaseLib/ConfigTreeNew.h b/BaseLib/ConfigTreeNew.h index 61c85c70bc6..dab5e2a33f0 100644 --- a/BaseLib/ConfigTreeNew.h +++ b/BaseLib/ConfigTreeNew.h @@ -220,11 +220,16 @@ public: ConfigTreeNew const& _parent; }; + //! The tree being wrapped by this class. using PTree = boost::property_tree::ptree; - //! Type of the function objects used as callbacks. - //! The first argument denotes the path in the tree at which an event (warning/error) - //! occured, the second argument is the associated message + /*! Type of the function objects used as callbacks. + * + * Arguments of the callback: + * \arg \c filename the file being from which this ConfigTree has been read. + * \arg \c path the path in the tree where the message was generated. + * \arg \c message the message to be printed. + */ using Callback = std::function<void(const std::string& filename, const std::string& path, const std::string& message)>; @@ -581,7 +586,8 @@ private: //! The path of the file from which this tree has been read. std::string _filename; - //! A pair (is attribute, tag/attribute name) + //! A pair (is attribute, tag/attribute name). + //! The first entry is true for an XML attribute and false for a tag. using KeyType = std::pair<bool, std::string>; //! A map KeyType -> (count, type) keeping track which parameters have been read -- GitLab