// ---------------------------------------------------------------------------- // Copyright (C) 2002-2006 Marcin Kalicinski // Copyright (C) 2009 Sebastian Redl // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see www.boost.org // ---------------------------------------------------------------------------- #ifndef BOOST_PROPERTY_TREE_PTREE_FWD_HPP_INCLUDED #define BOOST_PROPERTY_TREE_PTREE_FWD_HPP_INCLUDED #include #include #include #include // for std::less #include // for std::allocator #include namespace lslboost { namespace property_tree { namespace detail { template struct less_nocase; } // Classes template < class Key, class Data, class KeyCompare = std::less > class basic_ptree; template struct id_translator; template class string_path; // Texas-style concepts for documentation only. #if 0 concept PropertyTreePath { // The key type for which this path works. typename key_type; // Return the key that the first segment of the path names. // Split the head off the state. key_type Path::reduce(); // Return true if the path is empty. bool Path::empty() const; // Return true if the path contains a single element. bool Path::single() const; // Dump as a std::string, for exception messages. std::string Path::dump() const; } concept PropertyTreeKey { PropertyTreePath path; requires SameType::key_type>; } concept PropertyTreeTranslator { typename internal_type; typename external_type; lslboost::optional Tr::get_value(internal_type); lslboost::optional Tr::put_value(external_type); } #endif /// If you want to use a custom key type, specialize this struct for it /// and give it a 'type' typedef that specifies your path type. The path /// type must conform to the Path concept described in the documentation. /// This is already specialized for std::basic_string. template struct path_of; /// Specialize this struct to specify a default translator between the data /// in a tree whose data_type is Internal, and the external data_type /// specified in a get_value, get, put_value or put operation. /// This is already specialized for Internal being std::basic_string. template struct translator_between; class ptree_error; class ptree_bad_data; class ptree_bad_path; // Typedefs /** Implements a path using a std::string as the key. */ typedef string_path > path; /** * A property tree with std::string for key and data, and default * comparison. */ typedef basic_ptree ptree; /** * A property tree with std::string for key and data, and case-insensitive * comparison. */ typedef basic_ptree > iptree; #ifndef BOOST_NO_STD_WSTRING /** Implements a path using a std::wstring as the key. */ typedef string_path > wpath; /** * A property tree with std::wstring for key and data, and default * comparison. * @note The type only exists if the platform supports @c wchar_t. */ typedef basic_ptree wptree; /** * A property tree with std::wstring for key and data, and case-insensitive * comparison. * @note The type only exists if the platform supports @c wchar_t. */ typedef basic_ptree > wiptree; #endif // Free functions /** * Swap two property tree instances. */ template void swap(basic_ptree &pt1, basic_ptree &pt2); } } #if !defined(BOOST_PROPERTY_TREE_DOXYGEN_INVOKED) // Throwing macro to avoid no return warnings portably # define BOOST_PROPERTY_TREE_THROW(e) BOOST_THROW_EXCEPTION(e) #endif #endif