aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsde/xsde/cxx/serializer/non-validating/qname.cxx')
-rw-r--r--libxsde/xsde/cxx/serializer/non-validating/qname.cxx62
1 files changed, 62 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/serializer/non-validating/qname.cxx b/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
new file mode 100644
index 0000000..d2e41ff
--- /dev/null
+++ b/libxsde/xsde/cxx/serializer/non-validating/qname.cxx
@@ -0,0 +1,62 @@
+// file : xsde/cxx/serializer/non-validating/qname.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#include <xsde/cxx/serializer/non-validating/qname.hxx>
+
+namespace xsde
+{
+ namespace cxx
+ {
+ namespace serializer
+ {
+ namespace non_validating
+ {
+ qname_simpl::
+ ~qname_simpl ()
+ {
+ if (free_)
+ delete const_cast<qname*> (value_);
+ }
+
+ void qname_simpl::
+ pre (const qname* value)
+ {
+ value_ = value;
+ }
+
+ void qname_simpl::
+ _serialize_content ()
+ {
+ const char* p = value_->prefix ();
+
+ if (p != 0 && *p != '\0')
+ {
+#ifdef XSDE_EXCEPTIONS
+ _characters (p);
+ _characters (":", 1);
+ _characters (value_->name ());
+#else
+ if (_characters (p))
+ {
+ if (_characters (":", 1))
+ _characters (value_->name ());
+ }
+#endif
+ }
+ else
+ {
+ _characters (value_->name ());
+ }
+
+ if (free_)
+ {
+ delete const_cast<qname*> (value_);
+ value_ = 0;
+ }
+ }
+ }
+ }
+ }
+}