aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-10-29 19:29:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-10-29 19:29:42 +0200
commit8e5392bc022097b9768a9f631914a1ea853d821c (patch)
tree687982d38c055646fe157391725b278163b142a4
parent75205dd307c57df24d282b94f1bca3b668579c1e (diff)
Add xml::value_traits specialization for std::string
The default implementation uses istream::operator>> which ignores spaces.
-rw-r--r--cutl/xml/value-traits.hxx16
1 files changed, 16 insertions, 0 deletions
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<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> {};