From 0bce70a0e483294b83b8bf9d5468838a63405612 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Mar 2009 17:23:30 +0200 Subject: 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 --- examples/cxx/hybrid/binary/custom/irawstream.hxx | 92 ++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 examples/cxx/hybrid/binary/custom/irawstream.hxx (limited to 'examples/cxx/hybrid/binary/custom/irawstream.hxx') diff --git a/examples/cxx/hybrid/binary/custom/irawstream.hxx b/examples/cxx/hybrid/binary/custom/irawstream.hxx new file mode 100644 index 0000000..94d2382 --- /dev/null +++ b/examples/cxx/hybrid/binary/custom/irawstream.hxx @@ -0,0 +1,92 @@ +// file : examples/cxx/hybrid/binary/custom/irawstream.hxx +// author : Boris Kolpackov +// copyright : not copyrighted - public domain + +#ifndef IRAWSTREAM_HXX +#define IRAWSTREAM_HXX + +#include // size_t + +#include + +#include "exceptions.hxx" +#include "xml-schema.hxx" + +class irawstream +{ +public: + explicit + irawstream (const xml_schema::buffer&, size_t start = 0); + +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>> (std::string&); + void operator>> (xml_schema::buffer&); + +private: + irawstream (const irawstream&); + irawstream& operator= (const irawstream&); + +public: + const char* + align (size_t alignment, size_t size); + +private: + const xml_schema::buffer& buf_; + size_t pos_; +}; + +void operator>> (irawstream&, xml_schema::any_type&); +void operator>> (irawstream&, xml_schema::any_simple_type&); +void operator>> (irawstream&, xml_schema::qname&); +void operator>> (irawstream&, xml_schema::time_zone&); +void operator>> (irawstream&, xml_schema::date&); +void operator>> (irawstream&, xml_schema::date_time&); +void operator>> (irawstream&, xml_schema::duration&); +void operator>> (irawstream&, xml_schema::gday&); +void operator>> (irawstream&, xml_schema::gmonth&); +void operator>> (irawstream&, xml_schema::gmonth_day&); +void operator>> (irawstream&, xml_schema::gyear&); +void operator>> (irawstream&, xml_schema::gyear_month&); +void operator>> (irawstream&, xml_schema::time&); + +void operator>> (irawstream&, xml_schema::str_seq&); + +template +void operator>> (irawstream&, xml_schema::pod_seq&); + +template +void operator>> (irawstream&, xml_schema::fix_seq&); + +template +void operator>> (irawstream&, xml_schema::var_seq&); + +#include "irawstream.ixx" +#include "irawstream.txx" + +#endif // IRAWSTREAM_HXX -- cgit v1.1