From 7275dc4d919b0cb6f8713d0b4a9a2b507051cded Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Oct 2014 19:25:51 +0200 Subject: Add value_traits specialization for std::string The default implementation uses istream::operator>> which ignores spaces. --- xml/value-traits | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xml/value-traits') diff --git a/xml/value-traits b/xml/value-traits index 3bf10e0..0c79229 100644 --- a/xml/value-traits +++ b/xml/value-traits @@ -39,6 +39,22 @@ namespace xml } }; + 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 {}; -- cgit v1.1