// ---------------------------------------------------------------------------- // 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_ID_TRANSLATOR_HPP_INCLUDED #define BOOST_PROPERTY_TREE_ID_TRANSLATOR_HPP_INCLUDED #include #include #include namespace boost { namespace property_tree { /// Simple implementation of the Translator concept. It does no translation. template struct id_translator { typedef T internal_type; typedef T external_type; boost::optional get_value(const T &v) { return v; } boost::optional put_value(const T &v) { return v; } }; // This is the default translator whenever you get two equal types. template struct translator_between { typedef id_translator type; }; // A more specific specialization for std::basic_string. Otherwise, // stream_translator's specialization wins. template struct translator_between< std::basic_string, std::basic_string > { typedef id_translator< std::basic_string > type; }; }} #endif