Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:16

0001 // ----------------------------------------------------------------------------
0002 // Copyright (C) 2002-2006 Marcin Kalicinski
0003 // Copyright (C) 2009 Sebastian Redl
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. 
0006 // (See accompanying file LICENSE_1_0.txt or copy at 
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // For more information, see www.boost.org
0010 // ----------------------------------------------------------------------------
0011 #ifndef BOOST_PROPERTY_TREE_DETAIL_EXCEPTIONS_IMPLEMENTATION_HPP_INCLUDED
0012 #define BOOST_PROPERTY_TREE_DETAIL_EXCEPTIONS_IMPLEMENTATION_HPP_INCLUDED
0013 
0014 namespace boost { namespace property_tree
0015 {
0016 
0017     namespace detail
0018     {
0019 
0020         // Helper for preparing what string in ptree_bad_path exception
0021         template<class P> inline
0022         std::string prepare_bad_path_what(const std::string &what,
0023                                           const P &path)
0024         {
0025             return what + " (" + path.dump() + ")";
0026         }
0027 
0028     }
0029 
0030     ///////////////////////////////////////////////////////////////////////////
0031     // ptree_error
0032 
0033     inline ptree_error::ptree_error(const std::string &w): 
0034         std::runtime_error(w) 
0035     {
0036     }
0037 
0038     inline ptree_error::~ptree_error() throw()
0039     {
0040     }
0041 
0042     ///////////////////////////////////////////////////////////////////////////
0043     // ptree_bad_data
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     inline ptree_bad_data::~ptree_bad_data() throw()
0052     {
0053     }
0054 
0055     template<class D> inline
0056     D ptree_bad_data::data() const
0057     {
0058         return boost::any_cast<D>(m_data);
0059     }
0060 
0061     ///////////////////////////////////////////////////////////////////////////
0062     // ptree_bad_path
0063 
0064     template<class P> inline
0065     ptree_bad_path::ptree_bad_path(const std::string &w, const P &p):
0066         ptree_error(detail::prepare_bad_path_what(w, p)), m_path(p)
0067     {
0068 
0069     }
0070 
0071     inline ptree_bad_path::~ptree_bad_path() throw()
0072     {
0073     }
0074 
0075     template<class P> inline
0076     P ptree_bad_path::path() const
0077     {
0078         return boost::any_cast<P>(m_path);
0079     }
0080 
0081 }}
0082 
0083 #endif