// file : libstudxml/value-traits.hxx -*- C++ -*- // copyright : Copyright (c) 2013-2019 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #ifndef LIBSTUDXML_VALUE_TRAITS_HXX #define LIBSTUDXML_VALUE_TRAITS_HXX #include #include #include // std::size_t #include #include namespace xml { template struct default_value_traits { static T parse (std::string, const parser&); static std::string serialize (const T&, const serializer&); }; template <> struct LIBSTUDXML_EXPORT default_value_traits { static bool parse (std::string, const parser&); static std::string serialize (bool v, const serializer&) { return v ? "true" : "false"; } }; template <> struct default_value_traits { static std::string parse (std::string s, const parser&) { return s; } static std::string serialize (const std::string& v, const serializer&) { return v; } }; template struct value_traits: default_value_traits {}; template struct value_traits: default_value_traits {}; } #include #include #endif // LIBSTUDXML_VALUE_TRAITS_HXX