File indexing completed on 2025-12-16 10:07:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_PROPERTY_TREE_DETAIL_EXCEPTIONS_IMPLEMENTATION_HPP_INCLUDED
0012 #define BOOST_PROPERTY_TREE_DETAIL_EXCEPTIONS_IMPLEMENTATION_HPP_INCLUDED
0013
0014 #include <boost/property_tree/exceptions.hpp>
0015
0016 #include <string>
0017
0018 namespace boost { namespace property_tree
0019 {
0020
0021 namespace detail
0022 {
0023
0024
0025 template<class P> inline
0026 std::string prepare_bad_path_what(const std::string &what,
0027 const P &path)
0028 {
0029 return what + " (" + path.dump() + ")";
0030 }
0031
0032 }
0033
0034
0035
0036
0037 inline ptree_error::ptree_error(const std::string &w):
0038 std::runtime_error(w)
0039 {
0040 }
0041
0042
0043
0044
0045 template<class D> inline
0046 ptree_bad_data::ptree_bad_data(const std::string &w, const D &d):
0047 ptree_error(w), m_data(d)
0048 {
0049 }
0050
0051 template<class D> inline
0052 D ptree_bad_data::data() const
0053 {
0054 return boost::any_cast<D>(m_data);
0055 }
0056
0057
0058
0059
0060 template<class P> inline
0061 ptree_bad_path::ptree_bad_path(const std::string &w, const P &p):
0062 ptree_error(detail::prepare_bad_path_what(w, p)), m_path(p)
0063 {
0064
0065 }
0066
0067 template<class P> inline
0068 P ptree_bad_path::path() const
0069 {
0070 return boost::any_cast<P>(m_path);
0071 }
0072
0073 }}
0074
0075 #endif