From a15cf65c44d5c224169c32ef5495b68c758134b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 18 May 2014 16:08:14 +0200 Subject: Imported Upstream version 3.3.0.2 --- xsd/examples/cxx/tree/hello/driver.cxx | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 xsd/examples/cxx/tree/hello/driver.cxx (limited to 'xsd/examples/cxx/tree/hello/driver.cxx') diff --git a/xsd/examples/cxx/tree/hello/driver.cxx b/xsd/examples/cxx/tree/hello/driver.cxx new file mode 100644 index 0000000..6ea6823 --- /dev/null +++ b/xsd/examples/cxx/tree/hello/driver.cxx @@ -0,0 +1,37 @@ +// file : examples/cxx/tree/hello/driver.cxx +// author : Boris Kolpackov +// copyright : not copyrighted - public domain + +#include // std::auto_ptr +#include + +#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 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; + } +} -- cgit v1.2.3