From 8e5392bc022097b9768a9f631914a1ea853d821c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Oct 2014 19:29:42 +0200 Subject: Add xml::value_traits specialization for std::string The default implementation uses istream::operator>> which ignores spaces. --- cutl/xml/value-traits.hxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cutl/xml') diff --git a/cutl/xml/value-traits.hxx b/cutl/xml/value-traits.hxx index 0b95205..b98a6fe 100644 --- a/cutl/xml/value-traits.hxx +++ b/cutl/xml/value-traits.hxx @@ -40,6 +40,22 @@ namespace cutl } }; + template <> + struct LIBCUTL_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