aboutsummaryrefslogtreecommitdiff
path: root/xml/serializer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-08-11 23:47:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-08-11 23:47:47 +0200
commit503cd7a8cbb54719db115391de17ec265ea2b543 (patch)
tree0db5c25a13b30d90c34c2efc2b8591896bbe197d /xml/serializer.cxx
parentd49c8876bc97a900c61bb053ecec9374be448014 (diff)
Add support for "checked" end_element(), end_attribute()
Diffstat (limited to 'xml/serializer.cxx')
-rw-r--r--xml/serializer.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/xml/serializer.cxx b/xml/serializer.cxx
index 5ed5c5e..df31b09 100644
--- a/xml/serializer.cxx
+++ b/xml/serializer.cxx
@@ -173,6 +173,21 @@ namespace xml
}
void serializer::
+ end_element (const string& ns, const string& name)
+ {
+ constUtf8 cns, cn;
+ genxStatus e;
+ if ((e = genxGetCurrentElement (s_, &cns, &cn)) ||
+ reinterpret_cast<const char*> (cn) != name ||
+ (cns == 0 ? !ns.empty () : reinterpret_cast<const char*> (cns) != ns))
+ {
+ handle_error (e != GENX_SUCCESS ? e : GENX_SEQUENCE_ERROR);
+ }
+
+ end_element ();
+ }
+
+ void serializer::
element (const string& ns, const string& n, const string& v)
{
start_element (ns, n);
@@ -197,6 +212,21 @@ namespace xml
}
void serializer::
+ end_attribute (const string& ns, const string& name)
+ {
+ constUtf8 cns, cn;
+ genxStatus e;
+ if ((e = genxGetCurrentAttribute (s_, &cns, &cn)) ||
+ reinterpret_cast<const char*> (cn) != name ||
+ (cns == 0 ? !ns.empty () : reinterpret_cast<const char*> (cns) != ns))
+ {
+ handle_error (e != GENX_SUCCESS ? e : GENX_SEQUENCE_ERROR);
+ }
+
+ end_attribute ();
+ }
+
+ void serializer::
attribute (const string& ns,
const string& name,
const string& value)