// file : xml/value-traits -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #ifndef XML_VALUE_TRAITS #define XML_VALUE_TRAITS #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 LIBSTUDXML_EXPORT 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 // XML_VALUE_TRAITS