From 5e527213a2430bb3018e5eebd909aef294edf9b5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- examples/cxx/tree/binary/boost/README | 49 ------ .../tree/binary/boost/boost-archive-extraction.hxx | 188 --------------------- .../tree/binary/boost/boost-archive-insertion.hxx | 177 ------------------- examples/cxx/tree/binary/boost/driver.cxx | 72 -------- .../cxx/tree/binary/boost/library-prologue.hxx | 9 - examples/cxx/tree/binary/boost/library.xml | 52 ------ examples/cxx/tree/binary/boost/library.xsd | 75 -------- examples/cxx/tree/binary/boost/makefile | 131 -------------- 8 files changed, 753 deletions(-) delete mode 100644 examples/cxx/tree/binary/boost/README delete mode 100644 examples/cxx/tree/binary/boost/boost-archive-extraction.hxx delete mode 100644 examples/cxx/tree/binary/boost/boost-archive-insertion.hxx delete mode 100644 examples/cxx/tree/binary/boost/driver.cxx delete mode 100644 examples/cxx/tree/binary/boost/library-prologue.hxx delete mode 100644 examples/cxx/tree/binary/boost/library.xml delete mode 100644 examples/cxx/tree/binary/boost/library.xsd delete mode 100644 examples/cxx/tree/binary/boost/makefile (limited to 'examples/cxx/tree/binary/boost') 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 // std::size_t -#include - -#include -#include - -#include - -namespace xsd -{ - namespace cxx - { - namespace tree - { - // as_size - // - template - inline istream& - operator>> (istream& s, istream_common::as_size& x) - { - std::size_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - // 8-bit - // - template - inline istream& - operator>> (istream& s, istream_common::as_int8& x) - { - boost::int8_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - template - inline istream& - operator>> (istream& s, istream_common::as_uint8& x) - { - boost::uint8_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - - // 16-bit - // - template - inline istream& - operator>> (istream& s, istream_common::as_int16& x) - { - boost::int16_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - template - inline istream& - operator>> (istream& s, istream_common::as_uint16& x) - { - boost::uint16_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - - // 32-bit - // - template - inline istream& - operator>> (istream& s, istream_common::as_int32& x) - { - boost::int32_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - template - inline istream& - operator>> (istream& s, istream_common::as_uint32& x) - { - boost::uint32_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - - // 64-bit - // - template - inline istream& - operator>> (istream& s, istream_common::as_int64& x) - { - boost::int64_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - template - inline istream& - operator>> (istream& s, istream_common::as_uint64& x) - { - boost::uint64_t r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - - // Boolean - // - template - inline istream& - operator>> (istream& s, istream_common::as_bool& x) - { - bool r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - - // Floating-point - // - template - inline istream& - operator>> (istream& s, istream_common::as_float32& x) - { - float r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - template - inline istream& - operator>> (istream& s, istream_common::as_float64& x) - { - double r; - s.impl () >> r; - x.x_ = static_cast (r); - return s; - } - - // Extraction of std::basic_string. - // - - template - inline istream& - operator>> (istream& s, std::basic_string& x) - { - s.impl () >> x; - return s; - } - - - // Extraction of a binary buffer. - // - template - istream& - operator>> (istream& s, buffer& 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 // std::size_t -#include - -#include -#include - -#include - -namespace xsd -{ - namespace cxx - { - namespace tree - { - // as_size - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_size x) - { - std::size_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - // 8-bit - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_int8 x) - { - boost::int8_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - template - inline ostream& - operator<< (ostream& s, ostream_common::as_uint8 x) - { - boost::uint8_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // 16-bit - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_int16 x) - { - boost::int16_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - template - inline ostream& - operator<< (ostream& s, ostream_common::as_uint16 x) - { - boost::uint16_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // 32-bit - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_int32 x) - { - boost::int32_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - template - inline ostream& - operator<< (ostream& s, ostream_common::as_uint32 x) - { - boost::uint32_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // 64-bit - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_int64 x) - { - boost::int64_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - template - inline ostream& - operator<< (ostream& s, ostream_common::as_uint64 x) - { - boost::uint64_t v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // Boolean - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_bool x) - { - bool v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // Floating-point - // - template - inline ostream& - operator<< (ostream& s, ostream_common::as_float32 x) - { - float v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - template - inline ostream& - operator<< (ostream& s, ostream_common::as_float64 x) - { - double v (static_cast (x.x_)); - s.impl () << v; - return s; - } - - - // Insertion of std::basic_string. - // - template - inline ostream& - operator<< (ostream& s, const std::basic_string& x) - { - s.impl () << x; - return s; - } - - - // Insertion of a binary buffer. - // - template - ostream& - operator<< (ostream& s, const buffer& 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 // std::auto_ptr -#include // std::memcpy -#include -#include - -// You can generate insertion/extraction code for other archive -// types (for example, binary, XML, etc). -// -#include -#include - -#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 c (catalog_ (argv[1])); - - cerr << *c << endl; - - // Save into a text archive. - // - std::ostringstream ostr; - text_oarchive oa (ostr); - xml_schema::ostream 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 is (ia); - - std::auto_ptr 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 -#include - -// 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 @@ - - - - - - - - 0679760806 - The Master and Margarita - fiction - - - Mikhail Bulgakov - 1891-05-15 - 1940-03-10 - - - - - - 0679600841 - War and Peace - history - - - Leo Tolstoy - 1828-09-09 - 1910-11-20 - - - - - - 0679420290 - Crime and Punishment - philosophy - - - Fyodor Dostoevsky - 1821-11-11 - 1881-02-09 - - - - 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/cxx/tree/binary/boost/makefile b/examples/cxx/tree/binary/boost/makefile deleted file mode 100644 index 6e2f4d8..0000000 --- a/examples/cxx/tree/binary/boost/makefile +++ /dev/null @@ -1,131 +0,0 @@ -# file : examples/cxx/tree/binary/boost/makefile -# 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) -- cgit v1.1