aboutsummaryrefslogtreecommitdiff
path: root/cutl/xml/serializer.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'cutl/xml/serializer.ixx')
-rw-r--r--cutl/xml/serializer.ixx30
1 files changed, 30 insertions, 0 deletions
diff --git a/cutl/xml/serializer.ixx b/cutl/xml/serializer.ixx
index 115b77b..11ff33a 100644
--- a/cutl/xml/serializer.ixx
+++ b/cutl/xml/serializer.ixx
@@ -2,6 +2,8 @@
// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
+#include <cutl/xml/value-traits.hxx>
+
namespace cutl
{
namespace xml
@@ -36,10 +38,38 @@ namespace cutl
attribute (qname.namespace_ (), qname.name (), value);
}
+ template <typename T>
+ inline void serializer::
+ attribute (const qname_type& qname, const T& value)
+ {
+ attribute (qname, value_traits<T>::serialize (value, *this));
+ }
+
inline void serializer::
attribute (const std::string& name, const std::string& value)
{
attribute (std::string (), name, value);
}
+
+ template <typename T>
+ inline void serializer::
+ attribute (const std::string& name, const T& value)
+ {
+ attribute (name, value_traits<T>::serialize (value, *this));
+ }
+
+ template <typename T>
+ inline void serializer::
+ attribute (const std::string& ns, const std::string& name, const T& value)
+ {
+ attribute (ns, name, value_traits<T>::serialize (value, *this));
+ }
+
+ template <typename T>
+ inline void serializer::
+ characters (const T& value)
+ {
+ characters (value_traits<T>::serialize (value, *this));
+ }
}
}