summaryrefslogtreecommitdiff
path: root/libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx')
-rw-r--r--libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx b/libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx
new file mode 100644
index 0000000..287ec5e
--- /dev/null
+++ b/libxsd/libxsd/cxx/tree/serialization/unsigned-byte.hxx
@@ -0,0 +1,44 @@
+// file : libxsd/cxx/tree/serialization/unsigned-byte.hxx
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#ifndef LIBXSD_CXX_TREE_SERIALIZATION_UNSIGNED_BYTE_HXX
+#define LIBXSD_CXX_TREE_SERIALIZATION_UNSIGNED_BYTE_HXX
+
+#include <sstream>
+
+namespace XERCES_CPP_NAMESPACE
+{
+ inline void
+ operator<< (xercesc::DOMElement& e, unsigned char c)
+ {
+ std::basic_ostringstream<char> os;
+ os << static_cast<unsigned short> (c);
+ e << os.str ();
+ }
+
+ inline void
+ operator<< (xercesc::DOMAttr& a, unsigned char c)
+ {
+ std::basic_ostringstream<char> os;
+ os << static_cast<unsigned short> (c);
+ a << os.str ();
+ }
+}
+
+namespace xsd
+{
+ namespace cxx
+ {
+ namespace tree
+ {
+ template <typename C>
+ inline void
+ operator<< (list_stream<C>& ls, unsigned char c)
+ {
+ ls.os_ << static_cast<unsigned short> (c);
+ }
+ }
+ }
+}
+
+#endif // LIBXSD_CXX_TREE_SERIALIZATION_UNSIGNED_BYTE_HXX