diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:11 +0100 |
commit | 4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch) | |
tree | bbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/examples/cxx/tree/polymorphism/driver.cxx | |
parent | 23d41842168ac1a1580111b9c5c73500ceee3d57 (diff) | |
parent | aad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff) |
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0'
with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'xsd/examples/cxx/tree/polymorphism/driver.cxx')
-rw-r--r-- | xsd/examples/cxx/tree/polymorphism/driver.cxx | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/xsd/examples/cxx/tree/polymorphism/driver.cxx b/xsd/examples/cxx/tree/polymorphism/driver.cxx deleted file mode 100644 index 3f1598f..0000000 --- a/xsd/examples/cxx/tree/polymorphism/driver.cxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : examples/cxx/tree/polymorphism/driver.cxx -// copyright : not copyrighted - public domain - -#include <memory> // std::auto_ptr -#include <iostream> - -#include "supermen.hxx" - -using std::cerr; -using std::endl; -using std::auto_ptr; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " supermen.xml" << endl; - return 1; - } - - try - { - auto_ptr<supermen> sm (supermen_ (argv[1])); - - supermen copy (*sm); // Dynamic types are preserved in copies. - - // Print what we've got. - // - for (supermen::person_const_iterator i (copy.person ().begin ()); - i != copy.person ().end (); - ++i) - { - cerr << i->name (); - - if (const superman* s = dynamic_cast<const superman*> (&*i)) - { - if (s->can_fly ()) - cerr << ", flying superman"; - else - cerr << ", superman"; - } - - cerr << endl; - } - - // Serialize back to XML. - // - xml_schema::namespace_infomap map; - map[""].schema = "supermen.xsd"; - - supermen_ (std::cout, copy, map); - } - catch (const xml_schema::exception& e) - { - cerr << e << endl; - return 1; - } -} |