summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/binary
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cxx/tree/binary')
-rw-r--r--examples/cxx/tree/binary/README16
-rw-r--r--examples/cxx/tree/binary/boost/README49
-rw-r--r--examples/cxx/tree/binary/boost/boost-archive-extraction.hxx188
-rw-r--r--examples/cxx/tree/binary/boost/boost-archive-insertion.hxx177
-rw-r--r--examples/cxx/tree/binary/boost/driver.cxx72
-rw-r--r--examples/cxx/tree/binary/boost/library-prologue.hxx9
-rw-r--r--examples/cxx/tree/binary/boost/library.xml52
-rw-r--r--examples/cxx/tree/binary/boost/library.xsd75
-rw-r--r--examples/cxx/tree/binary/boost/makefile132
-rw-r--r--examples/cxx/tree/binary/cdr/README36
-rw-r--r--examples/cxx/tree/binary/cdr/driver.cxx87
-rw-r--r--examples/cxx/tree/binary/cdr/library.xml52
-rw-r--r--examples/cxx/tree/binary/cdr/library.xsd75
-rw-r--r--examples/cxx/tree/binary/cdr/makefile120
-rw-r--r--examples/cxx/tree/binary/makefile56
-rw-r--r--examples/cxx/tree/binary/xdr/README34
-rw-r--r--examples/cxx/tree/binary/xdr/driver.cxx148
-rw-r--r--examples/cxx/tree/binary/xdr/library.xml52
-rw-r--r--examples/cxx/tree/binary/xdr/library.xsd75
-rw-r--r--examples/cxx/tree/binary/xdr/makefile114
20 files changed, 0 insertions, 1619 deletions
diff --git a/examples/cxx/tree/binary/README b/examples/cxx/tree/binary/README
deleted file mode 100644
index 365551e..0000000
--- a/examples/cxx/tree/binary/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This directory contains a number of examples that show how to serialize
-the object model into a number of predefined and custom binary formats.
-The following list gives an overview of each example:
-
-boost
- Shows how to save/load the object model to/from a custom format
- using the Boost serialization library as an example.
-
-cdr
- Shows how to save/load the object model to/from CDR (Common Data
- Representation) binary format using ACE CDR streams.
-
-xdr
- Shows how to save/load the object model to/from XDR (eXternal Data
- Representation) binary format using the XDR API provided as part of
- Sun RPC.
diff --git a/examples/cxx/tree/binary/boost/README b/examples/cxx/tree/binary/boost/README
deleted file mode 100644
index 6cdd2dd..0000000
--- a/examples/cxx/tree/binary/boost/README
+++ /dev/null
@@ -1,49 +0,0 @@
-This example shows how to save/load the object model to/from a custom
-format using the Boost serialization library as an example. You will
-need the Boost serialization library[1] installed in order to build
-and run this example.
-
-[1] http://www.boost.org
-
-The example consists of the following files:
-
-library.xsd
- XML Schema which describes a library of books.
-
-library.xml
- Sample XML instance document.
-
-boost-archive-extraction.hxx
-boost-archive-insertion.hxx
- Boost archive insertion and extraction operators for fundamental
- types. You will need to provide a similar set of operators for
- your own stream types.
-
-library-prologue.hxx
- Contains a number of #include directives that are inserted into
- the generated code by the XSD compiler. The included files are:
- boost/archive/text_oarchive.hpp, boost/archive/text_oarchive.hpp,
- boost-archive-insertion.hxx, and boost-archive-insertion.hxx.
-
-library.hxx
-library.cxx
- C++ types that represent the given vocabulary as well as Boost
- archive insertion and extraction operations. These are generated
- by the XSD compiler from library.xsd. The --hxx-prologue-file
- option is used to insert the contents of the library-prologue.hxx
- file into the generated header file. The --generate-insertion and
- --generate-extraction options are used to generate the insertion
- and extraction operations for text_oarchive and text_iarchive
- types.
-
-driver.cxx
- Driver for the example. It first calls one of the parsing functions
- that constructs the object model from the input XML file. It then
- saves the object model to text_oarchive and loads it back from
- text_iarchive. Additionally, it prints the resulting text
- representation as well as the content of the object model before
- saving it to text_oarchive and after loading it from text_iarchive.
-
-To run the example on the sample XML instance document simply execute:
-
-$ ./driver library.xml
diff --git a/examples/cxx/tree/binary/boost/boost-archive-extraction.hxx b/examples/cxx/tree/binary/boost/boost-archive-extraction.hxx
deleted file mode 100644
index 8a1c1ef..0000000
--- a/examples/cxx/tree/binary/boost/boost-archive-extraction.hxx
+++ /dev/null
@@ -1,188 +0,0 @@
-// file : examples/cxx/tree/binary/boost/boost-archive-insertion.cxx
-// copyright : not copyrighted - public domain
-
-#ifndef BOOST_ARCHIVE_EXTRACTION_HXX
-#define BOOST_ARCHIVE_EXTRACTION_HXX
-
-#include <cstddef> // std::size_t
-#include <string>
-
-#include <xsd/cxx/tree/buffer.hxx>
-#include <xsd/cxx/tree/istream.hxx>
-
-#include <boost/cstdint.hpp>
-
-namespace xsd
-{
- namespace cxx
- {
- namespace tree
- {
- // as_size
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_size<T>& x)
- {
- std::size_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- // 8-bit
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_int8<T>& x)
- {
- boost::int8_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_uint8<T>& x)
- {
- boost::uint8_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
-
- // 16-bit
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_int16<T>& x)
- {
- boost::int16_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_uint16<T>& x)
- {
- boost::uint16_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
-
- // 32-bit
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_int32<T>& x)
- {
- boost::int32_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_uint32<T>& x)
- {
- boost::uint32_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
-
- // 64-bit
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_int64<T>& x)
- {
- boost::int64_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_uint64<T>& x)
- {
- boost::uint64_t r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
-
- // Boolean
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_bool<T>& x)
- {
- bool r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
-
- // Floating-point
- //
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_float32<T>& x)
- {
- float r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- template <typename Archive, typename T>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, istream_common::as_float64<T>& x)
- {
- double r;
- s.impl () >> r;
- x.x_ = static_cast<T> (r);
- return s;
- }
-
- // Extraction of std::basic_string.
- //
-
- template <typename Archive, typename C>
- inline istream<Archive>&
- operator>> (istream<Archive>& s, std::basic_string<C>& x)
- {
- s.impl () >> x;
- return s;
- }
-
-
- // Extraction of a binary buffer.
- //
- template <typename Archive, typename C>
- istream<Archive>&
- operator>> (istream<Archive>& s, buffer<C>& x)
- {
- std::size_t size;
- s.impl () >> size;
- x.size (size);
- s.impl ().load_binary (x.data (), size);
- return s;
- }
- }
- }
-}
-
-#endif // BOOST_ARCHIVE_EXTRACTION_HXX
diff --git a/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx b/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
deleted file mode 100644
index 4c89104..0000000
--- a/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
+++ /dev/null
@@ -1,177 +0,0 @@
-// file : examples/cxx/tree/binary/boost/boost-archive-insertion.cxx
-// copyright : not copyrighted - public domain
-
-#ifndef BOOST_ARCHIVE_INSERTION_HXX
-#define BOOST_ARCHIVE_INSERTION_HXX
-
-#include <cstddef> // std::size_t
-#include <string>
-
-#include <xsd/cxx/tree/buffer.hxx>
-#include <xsd/cxx/tree/ostream.hxx>
-
-#include <boost/cstdint.hpp>
-
-namespace xsd
-{
- namespace cxx
- {
- namespace tree
- {
- // as_size
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_size<T> x)
- {
- std::size_t v (static_cast<std::size_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- // 8-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int8<T> x)
- {
- boost::int8_t v (static_cast<boost::int8_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint8<T> x)
- {
- boost::uint8_t v (static_cast<boost::uint8_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 16-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int16<T> x)
- {
- boost::int16_t v (static_cast<boost::int16_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint16<T> x)
- {
- boost::uint16_t v (static_cast<boost::uint16_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 32-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int32<T> x)
- {
- boost::int32_t v (static_cast<boost::int32_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint32<T> x)
- {
- boost::uint32_t v (static_cast<boost::uint32_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 64-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int64<T> x)
- {
- boost::int64_t v (static_cast<boost::int64_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint64<T> x)
- {
- boost::uint64_t v (static_cast<boost::uint64_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Boolean
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_bool<T> x)
- {
- bool v (static_cast<bool> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Floating-point
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_float32<T> x)
- {
- float v (static_cast<float> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_float64<T> x)
- {
- double v (static_cast<double> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Insertion of std::basic_string.
- //
- template <typename Archive, typename C>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, const std::basic_string<C>& x)
- {
- s.impl () << x;
- return s;
- }
-
-
- // Insertion of a binary buffer.
- //
- template <typename Archive, typename C>
- ostream<Archive>&
- operator<< (ostream<Archive>& s, const buffer<C>& x)
- {
- // Boost.Serialization needs an lvalue.
- //
- std::size_t size (x.size());
- s.impl () << size;
- s.impl ().save_binary (x.data (), x.size ());
- return s;
- }
- }
- }
-}
-
-#endif // BOOST_ARCHIVE_INSERTION_HXX
diff --git a/examples/cxx/tree/binary/boost/driver.cxx b/examples/cxx/tree/binary/boost/driver.cxx
deleted file mode 100644
index df053b6..0000000
--- a/examples/cxx/tree/binary/boost/driver.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-// file : examples/cxx/tree/binary/boost/driver.cxx
-// copyright : not copyrighted - public domain
-
-#include <memory> // std::auto_ptr
-#include <cstring> // std::memcpy
-#include <sstream>
-#include <iostream>
-
-// You can generate insertion/extraction code for other archive
-// types (for example, binary, XML, etc).
-//
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-#include "library.hxx"
-
-using std::cerr;
-using std::endl;
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " library.xml" << endl;
- return 1;
- }
-
- try
- {
- using namespace library;
- using boost::archive::text_oarchive;
- using boost::archive::text_iarchive;
-
- // Read in the file.
- //
- std::auto_ptr<catalog> c (catalog_ (argv[1]));
-
- cerr << *c << endl;
-
- // Save into a text archive.
- //
- std::ostringstream ostr;
- text_oarchive oa (ostr);
- xml_schema::ostream<text_oarchive> os (oa);
-
- os << *c;
-
- // Print the text representation.
- //
- std::string str (ostr.str ());
-
- cerr << endl
- << "text representation: " << endl
- << str << endl;
-
- // Load from a text archive.
- //
- std::istringstream istr (str);
- text_iarchive ia (istr);
- xml_schema::istream<text_iarchive> is (ia);
-
- std::auto_ptr<catalog> copy (new catalog (is));
-
- cerr << *copy << endl;
- }
- catch (const xml_schema::exception& e)
- {
- cerr << e << endl;
- return 1;
- }
-}
diff --git a/examples/cxx/tree/binary/boost/library-prologue.hxx b/examples/cxx/tree/binary/boost/library-prologue.hxx
deleted file mode 100644
index ba0d35f..0000000
--- a/examples/cxx/tree/binary/boost/library-prologue.hxx
+++ /dev/null
@@ -1,9 +0,0 @@
-// Include declarations for the archive types.
-//
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-// Include insertion/extraction operators for fundamental types.
-//
-#include "boost-archive-insertion.hxx"
-#include "boost-archive-extraction.hxx"
diff --git a/examples/cxx/tree/binary/boost/library.xml b/examples/cxx/tree/binary/boost/library.xml
deleted file mode 100644
index ceb4443..0000000
--- a/examples/cxx/tree/binary/boost/library.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/boost/library.xml
-copyright : not copyrighted - public domain
-
--->
-
-<lib:catalog xmlns:lib="http://www.codesynthesis.com/library"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.codesynthesis.com/library library.xsd">
-
- <book id="MM" available="false">
- <isbn>0679760806</isbn>
- <title>The Master and Margarita</title>
- <genre>fiction</genre>
-
- <author recommends="WP">
- <name>Mikhail Bulgakov</name>
- <born>1891-05-15</born>
- <died>1940-03-10</died>
- </author>
- </book>
-
-
- <book id="WP">
- <isbn>0679600841</isbn>
- <title>War and Peace</title>
- <genre>history</genre>
-
- <author recommends="CP">
- <name>Leo Tolstoy</name>
- <born>1828-09-09</born>
- <died>1910-11-20</died>
- </author>
- </book>
-
-
- <book id="CP" available="false">
- <isbn>0679420290</isbn>
- <title>Crime and Punishment</title>
- <genre>philosophy</genre>
-
- <author>
- <name>Fyodor Dostoevsky</name>
- <born>1821-11-11</born>
- <died>1881-02-09</died>
- </author>
- </book>
-
-</lib:catalog>
diff --git a/examples/cxx/tree/binary/boost/library.xsd b/examples/cxx/tree/binary/boost/library.xsd
deleted file mode 100644
index 4bfdd1e..0000000
--- a/examples/cxx/tree/binary/boost/library.xsd
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/boost/library.xsd
-copyright : not copyrighted - public domain
-
--->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
- xmlns:lib="http://www.codesynthesis.com/library"
- targetNamespace="http://www.codesynthesis.com/library">
-
- <xsd:simpleType name="isbn">
- <xsd:restriction base="xsd:unsignedInt"/>
- </xsd:simpleType>
-
-
- <xsd:complexType name="title">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lang" type="xsd:language"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="genre">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="romance"/>
- <xsd:enumeration value="fiction"/>
- <xsd:enumeration value="horror"/>
- <xsd:enumeration value="history"/>
- <xsd:enumeration value="philosophy"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="person">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="born" type="xsd:date"/>
- <xsd:element name="died" type="xsd:date" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="author">
- <xsd:complexContent>
- <xsd:extension base="lib:person">
- <xsd:attribute name="recommends" type="xsd:IDREF" xse:refType="lib:book"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="book">
- <xsd:sequence>
- <xsd:element name="isbn" type="lib:isbn"/>
- <xsd:element name="title" type="lib:title"/>
- <xsd:element name="genre" type="lib:genre"/>
- <xsd:element name="author" type="lib:author" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="available" type="xsd:boolean" default="true"/>
- <xsd:attribute name="id" type="xsd:ID" use="required"/>
- </xsd:complexType>
-
-
- <xsd:complexType name="catalog">
- <xsd:sequence>
- <xsd:element name="book" type="lib:book" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
- <xsd:element name="catalog" type="lib:catalog"/>
-
-</xsd:schema>
diff --git a/examples/cxx/tree/binary/boost/makefile b/examples/cxx/tree/binary/boost/makefile
deleted file mode 100644
index cb4a943..0000000
--- a/examples/cxx/tree/binary/boost/makefile
+++ /dev/null
@@ -1,132 +0,0 @@
-# file : examples/cxx/tree/binary/boost/makefile
-# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make
-
-xsd := library.xsd
-cxx := driver.cxx
-
-obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
-dep := $(obj:.o=.o.d)
-
-driver := $(out_base)/driver
-install := $(out_base)/.install
-dist := $(out_base)/.dist
-dist-win := $(out_base)/.dist-win
-clean := $(out_base)/.clean
-
-
-# Import.
-#
-$(call import,\
- $(scf_root)/import/libxerces-c/stub.make,\
- l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
-
-ifeq ($(filter $(MAKECMDGOALS),dist dist-win install),)
-$(call import,\
- $(scf_root)/import/libboost/serialization/stub.make,\
- l: boost_serialization.l,cpp-options: boost_serialization.l.cpp-options)
-endif
-
-
-# Build.
-#
-$(driver): $(obj) $(xerces_c.l) $(boost_serialization.l)
-
-$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
-$(obj) $(dep): $(xerces_c.l.cpp-options) $(boost_serialization.l.cpp-options)
-
-genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
-gen := $(addprefix $(out_base)/,$(genf))
-
-$(gen): xsd := $(out_root)/xsd/xsd
-
-$(gen): xsd_options += --generate-ostream \
---hxx-prologue-file $(src_base)/library-prologue.hxx \
---generate-insertion boost::archive::text_oarchive \
---generate-extraction boost::archive::text_iarchive
-
-$(gen): $(out_root)/xsd/xsd
-
-$(call include-dep,$(dep),$(obj),$(gen))
-
-# Convenience alias for default target.
-#
-$(out_base)/: $(driver)
-
-
-# Install & Dist.
-#
-dist-common := $(out_base)/.dist-common
-
-$(install) $(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
-
-$(install):
- $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README)
- $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/xsd/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(install_doc_dir)/xsd/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(install_doc_dir)/xsd/$(path)/library.xml)
- $(call install-data,$(src_base)/library-prologue.hxx,$(install_doc_dir)/xsd/$(path)/library-prologue.hxx)
- $(call install-data,$(src_base)/boost-archive-extraction.hxx,$(install_doc_dir)/xsd/$(path)/boost-archive-extraction.hxx)
- $(call install-data,$(src_base)/boost-archive-insertion.hxx,$(install_doc_dir)/xsd/$(path)/boost-archive-insertion.hxx)
-
-$(dist-common):
- $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
- $(call install-data,$(src_base)/library-prologue.hxx,$(dist_prefix)/$(path)/library-prologue.hxx)
- $(call install-data,$(src_base)/boost-archive-extraction.hxx,$(dist_prefix)/$(path)/boost-archive-extraction.hxx)
- $(call install-data,$(src_base)/boost-archive-insertion.hxx,$(dist_prefix)/$(path)/boost-archive-insertion.hxx)
-
-$(dist): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): |$(out_root)/.dist-pre
-$(dist-win): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
- $(call meta-vc8sln,$(src_root)/dist/template-vc8.sln,boost-vc8.sln)
- $(call meta-vc9sln,$(src_root)/dist/template-vc9.sln,boost-vc9.sln)
- $(call meta-vc10sln,$(src_root)/dist/template-vc10.sln,boost-vc10.sln)
- $(call meta-vc11sln,$(src_root)/dist/template-vc11.sln,boost-vc11.sln)
- $(call meta-vc12sln,$(src_root)/dist/template-vc12.sln,boost-vc12.sln)
-
-
-# Clean.
-#
-$(clean): $(driver).o.clean \
- $(addsuffix .cxx.clean,$(obj)) \
- $(addsuffix .cxx.clean,$(dep)) \
- $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean))
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(gen): | $(out_base)/.gitignore
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver $(genf)
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
-
-$(call include,$(bld_root)/install.make)
-$(call include,$(bld_root)/meta/vc8sln.make)
-$(call include,$(bld_root)/meta/vc9sln.make)
-$(call include,$(bld_root)/meta/vc10sln.make)
-$(call include,$(bld_root)/meta/vc11sln.make)
-$(call include,$(bld_root)/meta/vc12sln.make)
-
-
-# Dependencies.
-#
-$(call import,$(src_root)/xsd/makefile)
diff --git a/examples/cxx/tree/binary/cdr/README b/examples/cxx/tree/binary/cdr/README
deleted file mode 100644
index 914d27c..0000000
--- a/examples/cxx/tree/binary/cdr/README
+++ /dev/null
@@ -1,36 +0,0 @@
-This example shows how to save/load the object model to/from CDR
-(Common Data Representation) binary format using ACE CDR streams.
-Support for other data representation streams can be easily added. You
-will need the ACE library[1] installed in order to build and run this
-example.
-
-[1] http://www.cs.wustl.edu/~schmidt/ACE.html
-
-The example consists of the following files:
-
-library.xsd
- XML Schema which describes a library of books.
-
-library.xml
- Sample XML instance document.
-
-library.hxx
-library.cxx
- C++ types that represent the given vocabulary as well as data
- representation stream insertion and extraction operations. These
- are generated by XSD from library.xsd. Note that the
- --generate-insertion and --generate-extraction options are used
- to generate the insertion and extraction operations for ACE CDR
- stream.
-
-driver.cxx
- Driver for the example. It first calls one of the parsing functions
- that constructs the object model from the input XML file. It then
- saves the object model to ACE_OuputCDR and loads it back from
- ACE_InputCDR. Additionally, it prints the resulting binary
- representation as well as the content of the object model before
- saving it to the CDR stream and after loading it from the CDR stream.
-
-To run the example on the sample XML instance document simply execute:
-
-$ ./driver library.xml
diff --git a/examples/cxx/tree/binary/cdr/driver.cxx b/examples/cxx/tree/binary/cdr/driver.cxx
deleted file mode 100644
index ec1ff32..0000000
--- a/examples/cxx/tree/binary/cdr/driver.cxx
+++ /dev/null
@@ -1,87 +0,0 @@
-// file : examples/cxx/tree/binary/cdr/driver.cxx
-// copyright : not copyrighted - public domain
-
-#include <memory> // std::auto_ptr
-#include <cstring> // std::memcpy
-#include <iostream>
-
-#include <ace/Log_Msg.h> // ACE_HEX_DUMP
-#include <ace/CDR_Stream.h>
-
-// The following two headers define XSD-specific insertion/extraction
-// operations for ACE CDR streams. You can use the content of these
-// headers as a guide to implementing insertion/extraction to/from
-// your own data representation streams:
-//
-// xsd/cxx/tree/ace-cdr-stream-insertion.hxx
-// xsd/cxx/tree/ace-cdr-stream-extraction.hxx
-
-#include "library.hxx"
-
-using std::cerr;
-using std::endl;
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " library.xml" << endl;
- return 1;
- }
-
- try
- {
- using namespace library;
-
- // Read in the file.
- //
- std::auto_ptr<catalog> c (catalog_ (argv[1]));
-
- cerr << *c << endl;
-
- // Save to a CDR stream.
- //
- ACE_OutputCDR ace_ocdr;
- xml_schema::ostream<ACE_OutputCDR> ocdr (ace_ocdr);
-
- ocdr << *c;
-
- // Print the binary representation and at the same time save
- // it into a continuous buffer.
- //
- cerr << endl
- << "binary representation size: " << ace_ocdr.total_length () << endl;
-
- xml_schema::buffer buf (ace_ocdr.total_length ());
- char* data (buf.data ());
-
- for (const ACE_Message_Block* mb = ace_ocdr.begin ();
- mb != 0;
- mb = mb->cont ())
- {
- std::memcpy (data, mb->rd_ptr (), mb->length ());
- data += mb->length ();
-
- ACE_HEX_DUMP ((LM_DEBUG, mb->rd_ptr (), mb->length ()));
- }
-
- // Load from a CDR stream. Note that ACE_InputCDR expects the
- // buffer to be properly aligned. Since our buffer is dynamically
- // allocated, its alignment should be good enough.
- //
- ACE_InputCDR ace_icdr (buf.data (), buf.size ());
- xml_schema::istream<ACE_InputCDR> icdr (ace_icdr);
-
- std::auto_ptr<catalog> copy (new catalog (icdr));
-
- cerr << *copy << endl;
- }
- catch (const xml_schema::exception& e)
- {
- cerr << e << endl;
- return 1;
- }
-
- return 0; // ACE makes our main() an ordinary function.
-}
diff --git a/examples/cxx/tree/binary/cdr/library.xml b/examples/cxx/tree/binary/cdr/library.xml
deleted file mode 100644
index 941c03f..0000000
--- a/examples/cxx/tree/binary/cdr/library.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/cdr/library.xml
-copyright : not copyrighted - public domain
-
--->
-
-<lib:catalog xmlns:lib="http://www.codesynthesis.com/library"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.codesynthesis.com/library library.xsd">
-
- <book id="MM" available="false">
- <isbn>0679760806</isbn>
- <title>The Master and Margarita</title>
- <genre>fiction</genre>
-
- <author recommends="WP">
- <name>Mikhail Bulgakov</name>
- <born>1891-05-15</born>
- <died>1940-03-10</died>
- </author>
- </book>
-
-
- <book id="WP">
- <isbn>0679600841</isbn>
- <title>War and Peace</title>
- <genre>history</genre>
-
- <author recommends="CP">
- <name>Leo Tolstoy</name>
- <born>1828-09-09</born>
- <died>1910-11-20</died>
- </author>
- </book>
-
-
- <book id="CP" available="false">
- <isbn>0679420290</isbn>
- <title>Crime and Punishment</title>
- <genre>philosophy</genre>
-
- <author>
- <name>Fyodor Dostoevsky</name>
- <born>1821-11-11</born>
- <died>1881-02-09</died>
- </author>
- </book>
-
-</lib:catalog>
diff --git a/examples/cxx/tree/binary/cdr/library.xsd b/examples/cxx/tree/binary/cdr/library.xsd
deleted file mode 100644
index 5659e1b..0000000
--- a/examples/cxx/tree/binary/cdr/library.xsd
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/cdr/library.xsd
-copyright : not copyrighted - public domain
-
--->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
- xmlns:lib="http://www.codesynthesis.com/library"
- targetNamespace="http://www.codesynthesis.com/library">
-
- <xsd:simpleType name="isbn">
- <xsd:restriction base="xsd:unsignedInt"/>
- </xsd:simpleType>
-
-
- <xsd:complexType name="title">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lang" type="xsd:language"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="genre">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="romance"/>
- <xsd:enumeration value="fiction"/>
- <xsd:enumeration value="horror"/>
- <xsd:enumeration value="history"/>
- <xsd:enumeration value="philosophy"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="person">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="born" type="xsd:date"/>
- <xsd:element name="died" type="xsd:date" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="author">
- <xsd:complexContent>
- <xsd:extension base="lib:person">
- <xsd:attribute name="recommends" type="xsd:IDREF" xse:refType="lib:book"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="book">
- <xsd:sequence>
- <xsd:element name="isbn" type="lib:isbn"/>
- <xsd:element name="title" type="lib:title"/>
- <xsd:element name="genre" type="lib:genre"/>
- <xsd:element name="author" type="lib:author" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="available" type="xsd:boolean" default="true"/>
- <xsd:attribute name="id" type="xsd:ID" use="required"/>
- </xsd:complexType>
-
-
- <xsd:complexType name="catalog">
- <xsd:sequence>
- <xsd:element name="book" type="lib:book" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
- <xsd:element name="catalog" type="lib:catalog"/>
-
-</xsd:schema>
diff --git a/examples/cxx/tree/binary/cdr/makefile b/examples/cxx/tree/binary/cdr/makefile
deleted file mode 100644
index 0ef39b3..0000000
--- a/examples/cxx/tree/binary/cdr/makefile
+++ /dev/null
@@ -1,120 +0,0 @@
-# file : examples/cxx/tree/binary/cdr/makefile
-# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make
-
-xsd := library.xsd
-cxx := driver.cxx
-
-obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
-dep := $(obj:.o=.o.d)
-
-driver := $(out_base)/driver
-install := $(out_base)/.install
-dist := $(out_base)/.dist
-dist-win := $(out_base)/.dist-win
-clean := $(out_base)/.clean
-
-
-# Import.
-#
-$(call import,\
- $(scf_root)/import/libxerces-c/stub.make,\
- l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
-
-ifeq ($(filter $(MAKECMDGOALS),dist dist-win install),)
-$(call import,\
- $(scf_root)/import/libace/stub.make,\
- l: ace.l,cpp-options: ace.l.cpp-options)
-endif
-
-
-# Build.
-#
-$(driver): $(obj) $(xerces_c.l) $(ace.l)
-
-$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
-$(obj) $(dep): $(xerces_c.l.cpp-options) $(ace.l.cpp-options)
-
-genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
-gen := $(addprefix $(out_base)/,$(genf))
-
-$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): xsd_options += --generate-ostream \
---generate-insertion ACE_OutputCDR --generate-extraction ACE_InputCDR
-$(gen): $(out_root)/xsd/xsd
-
-$(call include-dep,$(dep),$(obj),$(gen))
-
-# Convenience alias for default target.
-#
-$(out_base)/: $(driver)
-
-
-# Install & Dist.
-#
-dist-common := $(out_base)/.dist-common
-
-$(install) $(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
-
-$(install):
- $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README)
- $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/xsd/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(install_doc_dir)/xsd/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(install_doc_dir)/xsd/$(path)/library.xml)
-
-$(dist-common):
- $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
-
-$(dist): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): |$(out_root)/.dist-pre
-$(dist-win): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
- $(call meta-vc8sln,$(src_root)/dist/template-vc8.sln,cdr-vc8.sln)
- $(call meta-vc9sln,$(src_root)/dist/template-vc9.sln,cdr-vc9.sln)
- $(call meta-vc10sln,$(src_root)/dist/template-vc10.sln,cdr-vc10.sln)
- $(call meta-vc11sln,$(src_root)/dist/template-vc11.sln,cdr-vc11.sln)
- $(call meta-vc12sln,$(src_root)/dist/template-vc12.sln,cdr-vc12.sln)
-
-# Clean.
-#
-$(clean): $(driver).o.clean \
- $(addsuffix .cxx.clean,$(obj)) \
- $(addsuffix .cxx.clean,$(dep)) \
- $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean))
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(gen): | $(out_base)/.gitignore
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver $(genf)
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
-
-$(call include,$(bld_root)/install.make)
-$(call include,$(bld_root)/meta/vc8sln.make)
-$(call include,$(bld_root)/meta/vc9sln.make)
-$(call include,$(bld_root)/meta/vc10sln.make)
-$(call include,$(bld_root)/meta/vc11sln.make)
-$(call include,$(bld_root)/meta/vc12sln.make)
-
-# Dependencies.
-#
-$(call import,$(src_root)/xsd/makefile)
diff --git a/examples/cxx/tree/binary/makefile b/examples/cxx/tree/binary/makefile
deleted file mode 100644
index 37ae68f..0000000
--- a/examples/cxx/tree/binary/makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-# file : examples/cxx/tree/binary/makefile
-# copyright : Copyright (c) 2006-2017 Code Synthesis Tools CC
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-
-all_examples := boost cdr xdr
-build_examples :=
-
-ifeq ($(xsd_with_boost_serialization),y)
-build_examples += boost
-endif
-
-ifeq ($(xsd_with_ace),y)
-build_examples += cdr
-endif
-
-ifeq ($(xsd_with_xdr),y)
-build_examples += xdr
-endif
-
-default := $(out_base)/
-install := $(out_base)/.install
-dist := $(out_base)/.dist
-dist-win := $(out_base)/.dist-win
-clean := $(out_base)/.clean
-
-# Build.
-#
-$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_examples)))
-
-# Install & Dist.
-#
-$(install) $(dist) $(dist-win): path := $(subst $(src_root)/,,$(src_base))
-
-$(install): $(addprefix $(out_base)/,$(addsuffix /.install,$(all_examples)))
- $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README)
-
-$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_examples)))
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): $(addprefix $(out_base)/,$(addsuffix /.dist-win,$(all_examples)))
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
-
-# Clean.
-#
-$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(build_examples)))
-
-$(call include,$(bld_root)/install.make)
-
-ifneq ($(filter $(MAKECMDGOALS),dist dist-win install),)
-$(foreach e,$(all_examples),$(call import,$(src_base)/$e/makefile))
-else
-$(foreach e,$(build_examples),$(call import,$(src_base)/$e/makefile))
-endif
diff --git a/examples/cxx/tree/binary/xdr/README b/examples/cxx/tree/binary/xdr/README
deleted file mode 100644
index 22d5693..0000000
--- a/examples/cxx/tree/binary/xdr/README
+++ /dev/null
@@ -1,34 +0,0 @@
-This example shows how to save/load the object model to/from XDR
-(eXternal Data Representation) binary format using XDR streams.
-The XDR API is available out of the box on most UNIX and GNU/Linux
-systems as part of Sun RPC. On Windows you may need to install a
-third-party library which provides the XDR API.
-
-The example consists of the following files:
-
-library.xsd
- XML Schema which describes a library of books.
-
-library.xml
- Sample XML instance document.
-
-library.hxx
-library.cxx
- C++ types that represent the given vocabulary as well as data
- representation stream insertion and extraction operations. These
- are generated by XSD from library.xsd. Note that the
- --generate-insertion and --generate-extraction options are used
- to generate the insertion and extraction operations for XDR
- stream.
-
-driver.cxx
- Driver for the example. It first calls one of the parsing functions
- that constructs the object model from the input XML file. It then
- saves the object model to the XDR representation and loads it back.
- Additionally, it prints the content of the object model before saving
- it to the XDR representation and after loading it from the XDR
- representation.
-
-To run the example on the sample XML instance document simply execute:
-
-$ ./driver library.xml
diff --git a/examples/cxx/tree/binary/xdr/driver.cxx b/examples/cxx/tree/binary/xdr/driver.cxx
deleted file mode 100644
index d109322..0000000
--- a/examples/cxx/tree/binary/xdr/driver.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-// file : examples/cxx/tree/binary/xdr/driver.cxx
-// copyright : not copyrighted - public domain
-
-#include <memory> // std::auto_ptr
-#include <cstring> // std::memcpy
-#include <cstddef> // std::size_t
-#include <iostream>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-
-#include "library.hxx"
-
-using std::cerr;
-using std::endl;
-using std::size_t;
-
-// XDR output functions. Their implementations are provided after main().
-//
-struct underflow_info
-{
- xml_schema::buffer* buf;
- size_t pos;
-};
-
-extern "C" int
-overflow (void* user_data, char* buf, int n);
-
-extern "C" int
-underflow (void* user_data, char* buf, int n);
-
-// The xdrrec_create function (used below) has slightly different
-// prototypes on different platforms. To make this example portable
-// we will need to cast the actual function to the following common
-// prototype.
-//
-extern "C"
-typedef void (*xdrrec_create_p) (
- XDR*,
- unsigned int write_size,
- unsigned int read_size,
- void* user_data,
- int (*read) (void* user_data, char* buf, int n),
- int (*write) (void* user_data, char* buf, int n));
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " library.xml" << endl;
- return 1;
- }
-
- try
- {
- using namespace library;
-
- xdrrec_create_p xdrrec_create_ =
- reinterpret_cast<xdrrec_create_p> (::xdrrec_create);
-
- // Read in the file.
- //
- std::auto_ptr<catalog> c (catalog_ (argv[1]));
-
- cerr << *c << endl;
-
- // Save to an XDR stream.
- //
- XDR xdr;
- xml_schema::buffer buf;
-
- xdrrec_create_ (&xdr, 0, 0, reinterpret_cast<char*> (&buf), 0, &overflow);
- xdr.x_op = XDR_ENCODE;
-
- xml_schema::ostream<XDR> oxdr (xdr);
-
- oxdr << *c;
-
- xdrrec_endofrecord (&xdr, true); // Flush the data.
- xdr_destroy (&xdr);
-
- // The binary representation is now in the memory buffer 'buf'.
- // To get to the raw data use buf.data() and buf.size().
- //
- cerr << endl
- << "binary representation size: " << buf.size () << endl;
-
- // Load from an XDR stream.
- //
- underflow_info ui;
- ui.buf = &buf;
- ui.pos = 0;
-
- xdrrec_create_ (&xdr, 0, 0, reinterpret_cast<char*> (&ui), &underflow, 0);
- xdr.x_op = XDR_DECODE;
-
- xdrrec_skiprecord (&xdr);
-
- xml_schema::istream<XDR> ixdr (xdr);
-
- std::auto_ptr<catalog> copy (new catalog (ixdr));
-
- xdr_destroy (&xdr);
-
- cerr << *copy << endl;
- }
- catch (const xml_schema::exception& e)
- {
- cerr << e << endl;
- return 1;
- }
-}
-
-extern "C" int
-overflow (void* p, char* buf, int n_)
-{
- xml_schema::buffer* dst (reinterpret_cast<xml_schema::buffer*> (p));
- size_t n (static_cast<size_t> (n_));
-
- size_t size (dst->size ());
- size_t capacity (dst->capacity ());
-
- // Implement exponential growth.
- //
- if (size + n > capacity && size + n < capacity * 2)
- dst->capacity (capacity * 2);
-
- dst->size (size + n);
- std::memcpy (dst->data () + size, buf, n);
-
- return n;
-}
-
-extern "C" int
-underflow (void* p, char* buf, int n_)
-{
- underflow_info* ui (reinterpret_cast<underflow_info*> (p));
- size_t n (static_cast<size_t> (n_));
-
- size_t size (ui->buf->size () - ui->pos);
- n = size > n ? n : size;
-
- std::memcpy (buf, ui->buf->data () + ui->pos, n);
- ui->pos += n;
-
- return n;
-}
diff --git a/examples/cxx/tree/binary/xdr/library.xml b/examples/cxx/tree/binary/xdr/library.xml
deleted file mode 100644
index dab6afb..0000000
--- a/examples/cxx/tree/binary/xdr/library.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/xdr/library.xml
-copyright : not copyrighted - public domain
-
--->
-
-<lib:catalog xmlns:lib="http://www.codesynthesis.com/library"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.codesynthesis.com/library library.xsd">
-
- <book id="MM" available="false">
- <isbn>0679760806</isbn>
- <title>The Master and Margarita</title>
- <genre>fiction</genre>
-
- <author recommends="WP">
- <name>Mikhail Bulgakov</name>
- <born>1891-05-15</born>
- <died>1940-03-10</died>
- </author>
- </book>
-
-
- <book id="WP">
- <isbn>0679600841</isbn>
- <title>War and Peace</title>
- <genre>history</genre>
-
- <author recommends="CP">
- <name>Leo Tolstoy</name>
- <born>1828-09-09</born>
- <died>1910-11-20</died>
- </author>
- </book>
-
-
- <book id="CP" available="false">
- <isbn>0679420290</isbn>
- <title>Crime and Punishment</title>
- <genre>philosophy</genre>
-
- <author>
- <name>Fyodor Dostoevsky</name>
- <born>1821-11-11</born>
- <died>1881-02-09</died>
- </author>
- </book>
-
-</lib:catalog>
diff --git a/examples/cxx/tree/binary/xdr/library.xsd b/examples/cxx/tree/binary/xdr/library.xsd
deleted file mode 100644
index 7513e3b..0000000
--- a/examples/cxx/tree/binary/xdr/library.xsd
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/binary/xdr/library.xsd
-copyright : not copyrighted - public domain
-
--->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
- xmlns:lib="http://www.codesynthesis.com/library"
- targetNamespace="http://www.codesynthesis.com/library">
-
- <xsd:simpleType name="isbn">
- <xsd:restriction base="xsd:unsignedInt"/>
- </xsd:simpleType>
-
-
- <xsd:complexType name="title">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="lang" type="xsd:language"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="genre">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="romance"/>
- <xsd:enumeration value="fiction"/>
- <xsd:enumeration value="horror"/>
- <xsd:enumeration value="history"/>
- <xsd:enumeration value="philosophy"/>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="person">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="born" type="xsd:date"/>
- <xsd:element name="died" type="xsd:date" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="author">
- <xsd:complexContent>
- <xsd:extension base="lib:person">
- <xsd:attribute name="recommends" type="xsd:IDREF" xse:refType="lib:book"/>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="book">
- <xsd:sequence>
- <xsd:element name="isbn" type="lib:isbn"/>
- <xsd:element name="title" type="lib:title"/>
- <xsd:element name="genre" type="lib:genre"/>
- <xsd:element name="author" type="lib:author" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="available" type="xsd:boolean" default="true"/>
- <xsd:attribute name="id" type="xsd:ID" use="required"/>
- </xsd:complexType>
-
-
- <xsd:complexType name="catalog">
- <xsd:sequence>
- <xsd:element name="book" type="lib:book" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-
-
- <xsd:element name="catalog" type="lib:catalog"/>
-
-</xsd:schema>
diff --git a/examples/cxx/tree/binary/xdr/makefile b/examples/cxx/tree/binary/xdr/makefile
deleted file mode 100644
index 8a7b88a..0000000
--- a/examples/cxx/tree/binary/xdr/makefile
+++ /dev/null
@@ -1,114 +0,0 @@
-# file : examples/cxx/tree/binary/xdr/makefile
-# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make
-
-xsd := library.xsd
-cxx := driver.cxx
-
-obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o))
-dep := $(obj:.o=.o.d)
-
-driver := $(out_base)/driver
-install := $(out_base)/.install
-dist := $(out_base)/.dist
-dist-win := $(out_base)/.dist-win
-clean := $(out_base)/.clean
-
-# Import.
-#
-$(call import,\
- $(scf_root)/import/libxerces-c/stub.make,\
- l: xerces_c.l,cpp-options: xerces_c.l.cpp-options)
-
-# Build.
-#
-$(driver): $(obj) $(xerces_c.l) -lnsl
-
-$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
-$(obj) $(dep): $(xerces_c.l.cpp-options)
-
-genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
-gen := $(addprefix $(out_base)/,$(genf))
-
-$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): xsd_options += --generate-ostream \
---generate-insertion XDR --generate-extraction XDR
-$(gen): $(out_root)/xsd/xsd
-
-$(call include-dep,$(dep),$(obj),$(gen))
-
-# Convenience alias for default target.
-#
-$(out_base)/: $(driver)
-
-
-# Install & Dist.
-#
-dist-common := $(out_base)/.dist-common
-
-$(install) $(dist) $(dist-win) $(dist-common): path := $(subst $(src_root)/,,$(src_base))
-
-$(install):
- $(call install-data,$(src_base)/README,$(install_doc_dir)/xsd/$(path)/README)
- $(call install-data,$(src_base)/driver.cxx,$(install_doc_dir)/xsd/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(install_doc_dir)/xsd/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(install_doc_dir)/xsd/$(path)/library.xml)
-
-$(dist-common):
- $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
- $(call install-data,$(src_base)/library.xsd,$(dist_prefix)/$(path)/library.xsd)
- $(call install-data,$(src_base)/library.xml,$(dist_prefix)/$(path)/library.xml)
-
-$(dist): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): |$(out_root)/.dist-pre
-$(dist-win): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
- $(call meta-vc8sln,$(src_root)/dist/template-vc8.sln,xdr-vc8.sln)
- $(call meta-vc9sln,$(src_root)/dist/template-vc9.sln,xdr-vc9.sln)
- $(call meta-vc10sln,$(src_root)/dist/template-vc10.sln,xdr-vc10.sln)
- $(call meta-vc11sln,$(src_root)/dist/template-vc11.sln,xdr-vc11.sln)
- $(call meta-vc12sln,$(src_root)/dist/template-vc12.sln,xdr-vc12.sln)
-
-
-# Clean.
-#
-$(clean): $(driver).o.clean \
- $(addsuffix .cxx.clean,$(obj)) \
- $(addsuffix .cxx.clean,$(dep)) \
- $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean))
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(gen): | $(out_base)/.gitignore
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver $(genf)
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
-
-$(call include,$(bld_root)/install.make)
-$(call include,$(bld_root)/meta/vc8sln.make)
-$(call include,$(bld_root)/meta/vc9sln.make)
-$(call include,$(bld_root)/meta/vc10sln.make)
-$(call include,$(bld_root)/meta/vc11sln.make)
-$(call include,$(bld_root)/meta/vc12sln.make)
-
-
-# Dependencies.
-#
-$(call import,$(src_root)/xsd/makefile)