aboutsummaryrefslogtreecommitdiff
path: root/xml/serializer.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'xml/serializer.ixx')
-rw-r--r--xml/serializer.ixx49
1 files changed, 49 insertions, 0 deletions
diff --git a/xml/serializer.ixx b/xml/serializer.ixx
index d329bbd..81631f2 100644
--- a/xml/serializer.ixx
+++ b/xml/serializer.ixx
@@ -19,6 +19,55 @@ namespace xml
}
inline void serializer::
+ element (const std::string& v)
+ {
+ if (!v.empty ())
+ characters (v);
+
+ end_element ();
+ }
+
+ template <typename T>
+ inline void serializer::
+ element (const T& v)
+ {
+ element (value_traits<T>::serialize (v, *this));
+ }
+
+ inline void serializer::
+ element (const std::string& n, const std::string& v)
+ {
+ element (std::string (), n, v);
+ }
+
+ template <typename T>
+ inline void serializer::
+ element (const std::string& n, const T& v)
+ {
+ element (n, value_traits<T>::serialize (v, *this));
+ }
+
+ inline void serializer::
+ element (const qname_type& qn, const std::string& v)
+ {
+ element (qn.namespace_ (), qn.name (), v);
+ }
+
+ template <typename T>
+ inline void serializer::
+ element (const qname_type& qn, const T& v)
+ {
+ element (qn, value_traits<T>::serialize (v, *this));
+ }
+
+ template <typename T>
+ inline void serializer::
+ element (const std::string& ns, const std::string& n, const T& v)
+ {
+ element (ns, n, value_traits<T>::serialize (v, *this));
+ }
+
+ inline void serializer::
start_attribute (const qname_type& qname)
{
start_attribute (qname.namespace_ (), qname.name ());