Back to home page

EIC code displayed by LXR

 
 

    


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

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_PTREE_FWD_HPP_INCLUDED
0012 #define BOOST_PROPERTY_TREE_PTREE_FWD_HPP_INCLUDED
0013 
0014 #include <boost/config.hpp>
0015 #include <boost/optional/optional_fwd.hpp>
0016 #include <boost/throw_exception.hpp>
0017 #include <functional>           // for std::less
0018 #include <memory>               // for std::allocator
0019 #include <string>
0020 
0021 namespace boost { namespace property_tree
0022 {
0023     namespace detail {
0024         template <typename T> struct less_nocase;
0025     }
0026 
0027     // Classes
0028 
0029     template < class Key, class Data, class KeyCompare = std::less<Key> >
0030     class basic_ptree;
0031 
0032     template <typename T>
0033     struct id_translator;
0034 
0035     template <typename String, typename Translator>
0036     class string_path;
0037 
0038     // Texas-style concepts for documentation only.
0039 #if 0
0040     concept PropertyTreePath<class Path> {
0041         // The key type for which this path works.
0042         typename key_type;
0043         // Return the key that the first segment of the path names.
0044         // Split the head off the state.
0045         key_type Path::reduce();
0046 
0047         // Return true if the path is empty.
0048         bool Path::empty() const;
0049 
0050         // Return true if the path contains a single element.
0051         bool Path::single() const;
0052 
0053         // Dump as a std::string, for exception messages.
0054         std::string Path::dump() const;
0055     }
0056     concept PropertyTreeKey<class Key> {
0057         PropertyTreePath path;
0058         requires SameType<Key, PropertyTreePath<path>::key_type>;
0059     }
0060     concept PropertyTreeTranslator<class Tr> {
0061         typename internal_type;
0062         typename external_type;
0063 
0064         boost::optional<external_type> Tr::get_value(internal_type);
0065         boost::optional<internal_type> Tr::put_value(external_type);
0066     }
0067 #endif
0068     /// If you want to use a custom key type, specialize this struct for it
0069     /// and give it a 'type' typedef that specifies your path type. The path
0070     /// type must conform to the Path concept described in the documentation.
0071     /// This is already specialized for std::basic_string.
0072     template <typename Key>
0073     struct path_of;
0074 
0075     /// Specialize this struct to specify a default translator between the data
0076     /// in a tree whose data_type is Internal, and the external data_type
0077     /// specified in a get_value, get, put_value or put operation.
0078     /// This is already specialized for Internal being std::basic_string.
0079     template <typename Internal, typename External>
0080     struct translator_between;
0081 
0082     class ptree_error;
0083     class ptree_bad_data;
0084     class ptree_bad_path;
0085 
0086     // Typedefs
0087 
0088     /** Implements a path using a std::string as the key. */
0089     typedef string_path<std::string, id_translator<std::string> > path;
0090 
0091     /**
0092      * A property tree with std::string for key and data, and default
0093      * comparison.
0094      */
0095     typedef basic_ptree<std::string, std::string> ptree;
0096 
0097     /**
0098      * A property tree with std::string for key and data, and case-insensitive
0099      * comparison.
0100      */
0101     typedef basic_ptree<std::string, std::string,
0102                         detail::less_nocase<std::string> >
0103         iptree;
0104 
0105 #ifndef BOOST_NO_STD_WSTRING
0106     /** Implements a path using a std::wstring as the key. */
0107     typedef string_path<std::wstring, id_translator<std::wstring> > wpath;
0108 
0109     /**
0110      * A property tree with std::wstring for key and data, and default
0111      * comparison.
0112      * @note The type only exists if the platform supports @c wchar_t.
0113      */
0114     typedef basic_ptree<std::wstring, std::wstring> wptree;
0115 
0116     /**
0117      * A property tree with std::wstring for key and data, and case-insensitive
0118      * comparison.
0119      * @note The type only exists if the platform supports @c wchar_t.
0120      */
0121     typedef basic_ptree<std::wstring, std::wstring,
0122                         detail::less_nocase<std::wstring> >
0123         wiptree;
0124 #endif
0125 
0126     // Free functions
0127 
0128     /**
0129      * Swap two property tree instances.
0130      */
0131     template<class K, class D, class C>
0132     void swap(basic_ptree<K, D, C> &pt1,
0133               basic_ptree<K, D, C> &pt2);
0134 
0135 } }
0136 
0137 
0138 #if !defined(BOOST_PROPERTY_TREE_DOXYGEN_INVOKED)
0139     // Throwing macro to avoid no return warnings portably
0140 #   define BOOST_PROPERTY_TREE_THROW(e) BOOST_THROW_EXCEPTION(e)
0141 #endif
0142 
0143 #endif