aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/hybrid/binary/custom/orawstream.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-08 17:23:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-08 17:23:30 +0200
commit0bce70a0e483294b83b8bf9d5468838a63405612 (patch)
treed11afb4998d6980435c15c4df6e40b1979531672 /examples/cxx/hybrid/binary/custom/orawstream.hxx
parent6c63b913179127e09ed7d9da8920493ccceec6ce (diff)
Add support for binary representations
xsde/cxx/hybrid/insertion-*: insertion operators generator xsde/cxx/hybrid/extraction-*: extraction operators generator libxsde/xsde/cxx/hybrid/cdr/: CDR support code libxsde/xsde/cxx/hybrid/xdr/: XDR support code tests/cxx/hybrid/binary/: new tests examples/cxx/hybrid/binary/: new examples documentation/cxx/hybrid/guide/: new chapter
Diffstat (limited to 'examples/cxx/hybrid/binary/custom/orawstream.hxx')
-rw-r--r--examples/cxx/hybrid/binary/custom/orawstream.hxx91
1 files changed, 91 insertions, 0 deletions
diff --git a/examples/cxx/hybrid/binary/custom/orawstream.hxx b/examples/cxx/hybrid/binary/custom/orawstream.hxx
new file mode 100644
index 0000000..9689e61
--- /dev/null
+++ b/examples/cxx/hybrid/binary/custom/orawstream.hxx
@@ -0,0 +1,91 @@
+// file : examples/cxx/hybrid/binary/custom/orawstream.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : not copyrighted - public domain
+
+#ifndef ORAWSTREAM_HXX
+#define ORAWSTREAM_HXX
+
+#include <stddef.h> // size_t
+
+#include <string>
+
+#include "exceptions.hxx"
+#include "xml-schema.hxx"
+
+class orawstream
+{
+public:
+ explicit
+ orawstream (xml_schema::buffer&);
+
+public:
+ struct as_size
+ {
+ explicit as_size (size_t s) : s_ (s) {}
+ size_t s_;
+ };
+
+public:
+ void operator<< (bool);
+ void operator<< (signed char);
+ void operator<< (unsigned char);
+ void operator<< (short);
+ void operator<< (unsigned short);
+ void operator<< (int);
+ void operator<< (unsigned int);
+ void operator<< (long);
+ void operator<< (unsigned long);
+
+#ifdef XSDE_LONGLONG
+ void operator<< (long long);
+ void operator<< (unsigned long long);
+#endif
+
+ void operator<< (as_size);
+ void operator<< (float);
+ void operator<< (double);
+
+ void operator<< (const std::string&);
+ void operator<< (const xml_schema::buffer&);
+
+private:
+ orawstream (const orawstream&);
+ orawstream& operator= (const orawstream&);
+
+public:
+ char*
+ align (size_t alignment, size_t size);
+
+private:
+ xml_schema::buffer& buf_;
+};
+
+void operator<< (orawstream&, const xml_schema::any_type&);
+void operator<< (orawstream&, const xml_schema::any_simple_type&);
+void operator<< (orawstream&, const xml_schema::qname&);
+void operator<< (orawstream&, const xml_schema::time_zone&);
+void operator<< (orawstream&, const xml_schema::date&);
+void operator<< (orawstream&, const xml_schema::date_time&);
+void operator<< (orawstream&, const xml_schema::duration&);
+void operator<< (orawstream&, const xml_schema::gday&);
+void operator<< (orawstream&, const xml_schema::gmonth&);
+void operator<< (orawstream&, const xml_schema::gmonth_day&);
+void operator<< (orawstream&, const xml_schema::gyear&);
+void operator<< (orawstream&, const xml_schema::gyear_month&);
+void operator<< (orawstream&, const xml_schema::time&);
+
+void operator<< (orawstream&, const xml_schema::str_seq&);
+
+template <typename T>
+void operator<< (orawstream&, const xml_schema::pod_seq<T>&);
+
+template <typename T>
+void operator<< (orawstream&, const xml_schema::fix_seq<T>&);
+
+template <typename T>
+void operator<< (orawstream&, const xml_schema::var_seq<T>&);
+
+#include "orawstream.ixx"
+#include "orawstream.txx"
+
+#endif // ORAWSTREAM_HXX