diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-08 17:23:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-03-08 17:23:30 +0200 |
commit | 0bce70a0e483294b83b8bf9d5468838a63405612 (patch) | |
tree | d11afb4998d6980435c15c4df6e40b1979531672 /xsde/cxx/hybrid/elements.cxx | |
parent | 6c63b913179127e09ed7d9da8920493ccceec6ce (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 'xsde/cxx/hybrid/elements.cxx')
-rw-r--r-- | xsde/cxx/hybrid/elements.cxx | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx index 454d0c3..c7609ff 100644 --- a/xsde/cxx/hybrid/elements.cxx +++ b/xsde/cxx/hybrid/elements.cxx @@ -41,11 +41,29 @@ namespace CXX fwd_expr (fe), hxx_expr (he), ixx_expr (ie), - ns_stack (ns_stack_) + ns_stack (ns_stack_), + istreams (ops.value<CLI::generate_extraction> ()), + ostreams (ops.value<CLI::generate_insertion> ()), + icdrstream (icdrstream_), + ocdrstream (ocdrstream_), + ixdrstream (ixdrstream_), + oxdrstream (oxdrstream_) { String xs_ns (xs_ns_name ()); string_type = L"::xsde::cxx::ro_string"; + + if (!ostreams.empty ()) + { + ocdrstream = xs_ns + L"::ocdrstream"; + oxdrstream = xs_ns + L"::oxdrstream"; + } + + if (!istreams.empty ()) + { + icdrstream = xs_ns + L"::icdrstream"; + ixdrstream = xs_ns + L"::ixdrstream"; + } } // Parser @@ -384,6 +402,28 @@ namespace CXX } } + String Context:: + istream (NarrowString const& is) const + { + if (is == "CDR") + return icdrstream; + else if (is == "XDR") + return ixdrstream; + else + return is; + } + + String Context:: + ostream (NarrowString const& os) const + { + if (os == "CDR") + return ocdrstream; + else if (os == "XDR") + return oxdrstream; + else + return os; + } + // Namespace // Namespace:: |