diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-10-29 19:25:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-10-29 19:25:51 +0200 |
commit | 7275dc4d919b0cb6f8713d0b4a9a2b507051cded (patch) | |
tree | 3ffc5b1df9a479bcddb20187ae9fb7152d8bb8b6 /xml | |
parent | 382f3ebd7ffe0a12e2ad1e0dc14e02f1122ac3df (diff) |
Add value_traits specialization for std::string
The default implementation uses istream::operator>> which ignores
spaces.
Diffstat (limited to 'xml')
-rw-r--r-- | xml/value-traits | 16 |
1 files changed, 16 insertions, 0 deletions
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<std::string> + { + static std::string + parse (std::string s, const parser&) + { + return s; + } + + static std::string + serialize (const std::string& v, const serializer&) + { + return v; + } + }; + template <typename T> struct value_traits: default_value_traits<T> {}; |