summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/hello
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-12-18 18:48:46 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-02-25 13:45:48 +0300
commit5e527213a2430bb3018e5eebd909aef294edf9b5 (patch)
tree94de33c82080b53d9a9e300170f6d221d89078f4 /examples/cxx/tree/hello
parent7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff)
Switch to build2
Diffstat (limited to 'examples/cxx/tree/hello')
-rw-r--r--examples/cxx/tree/hello/README26
-rw-r--r--examples/cxx/tree/hello/driver.cxx36
-rw-r--r--examples/cxx/tree/hello/hello.xml19
-rw-r--r--examples/cxx/tree/hello/hello.xsd52
-rw-r--r--examples/cxx/tree/hello/makefile100
5 files changed, 0 insertions, 233 deletions
diff --git a/examples/cxx/tree/hello/README b/examples/cxx/tree/hello/README
deleted file mode 100644
index bb98584..0000000
--- a/examples/cxx/tree/hello/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This is a "Hello, world!" example that shows how to use the C++/Tree
-mapping to access XML instance documents described by XML Schema
-definitions.
-
-The example consists of the following files:
-
-hello.xsd
- XML Schema which describes "hello" instance documents.
-
-hello.xml
- Sample XML instance document.
-
-hello.hxx
-hello.cxx
- C++ types that represent the given vocabulary and a set of parsing
- functions that convert XML instance documents to a tree-like in-memory
- object model. These are generated by XSD from hello.xsd.
-
-driver.cxx
- Driver for the example. It first calls one of the parsing functions
- that constructs the object model from the input file. It then prints
- the content of the object model to STDERR.
-
-To run the example on the sample XML instance document simply execute:
-
-$ ./driver hello.xml
diff --git a/examples/cxx/tree/hello/driver.cxx b/examples/cxx/tree/hello/driver.cxx
deleted file mode 100644
index b6629b3..0000000
--- a/examples/cxx/tree/hello/driver.cxx
+++ /dev/null
@@ -1,36 +0,0 @@
-// file : examples/cxx/tree/hello/driver.cxx
-// copyright : not copyrighted - public domain
-
-#include <memory> // std::auto_ptr
-#include <iostream>
-
-#include "hello.hxx"
-
-using namespace std;
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " hello.xml" << endl;
- return 1;
- }
-
- try
- {
- auto_ptr<hello_t> h (hello (argv[1]));
-
- for (hello_t::name_const_iterator i (h->name ().begin ());
- i != h->name ().end ();
- ++i)
- {
- cout << h->greeting () << ", " << *i << "!" << endl;
- }
- }
- catch (const xml_schema::exception& e)
- {
- cerr << e << endl;
- return 1;
- }
-}
diff --git a/examples/cxx/tree/hello/hello.xml b/examples/cxx/tree/hello/hello.xml
deleted file mode 100644
index 8b25b5b..0000000
--- a/examples/cxx/tree/hello/hello.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/hello/hello.xml
-copyright : not copyrighted - public domain
-
--->
-
-<hello xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="hello.xsd">
-
- <greeting>Hello</greeting>
-
- <name>sun</name>
- <name>moon</name>
- <name>world</name>
-
-</hello>
diff --git a/examples/cxx/tree/hello/hello.xsd b/examples/cxx/tree/hello/hello.xsd
deleted file mode 100644
index 8326ff0..0000000
--- a/examples/cxx/tree/hello/hello.xsd
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-
-file : examples/cxx/tree/hello/hello.xsd
-copyright : not copyrighted - public domain
-
--->
-
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="hello_t">
-
- <xsd:annotation>
- <xsd:documentation>
- The hello_t type consists of a greeting phrase and a
- collection of names to which this greeting applies.
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:sequence>
-
- <xsd:element name="greeting" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The greeting element contains the greeting phrase
- for this hello object.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- <xsd:element name="name" type="xsd:string" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>
- The name elements contains names to be greeted.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="hello" type="hello_t">
- <xsd:annotation>
- <xsd:documentation>
- The hello element is a root of the Hello XML vocabulary.
- Every conforming document should start with this element.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
-</xsd:schema>
diff --git a/examples/cxx/tree/hello/makefile b/examples/cxx/tree/hello/makefile
deleted file mode 100644
index 57d7f49..0000000
--- a/examples/cxx/tree/hello/makefile
+++ /dev/null
@@ -1,100 +0,0 @@
-# file : examples/cxx/tree/hello/makefile
-# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
-
-xsd := hello.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)
-
-$(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): $(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)/hello.xsd,$(install_doc_dir)/xsd/$(path)/hello.xsd)
- $(call install-data,$(src_base)/hello.xml,$(install_doc_dir)/xsd/$(path)/hello.xml)
-
-$(dist-common):
- $(call install-data,$(src_base)/driver.cxx,$(dist_prefix)/$(path)/driver.cxx)
- $(call install-data,$(src_base)/hello.xsd,$(dist_prefix)/$(path)/hello.xsd)
- $(call install-data,$(src_base)/hello.xml,$(dist_prefix)/$(path)/hello.xml)
-
-$(dist): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README)
-
-$(dist-win): $(dist-common)
- $(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,todos $(dist_prefix)/$(path)/README.txt)
-
-
-# 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,$(bld_root)/install.make)
-$(call include,$(scf_root)/xsd/tree/xsd-cxx.make)
-
-# Dependencies.
-#
-$(call import,$(src_root)/xsd/makefile)