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/parser/performance/gen.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/parser/performance/gen.cxx')
-rw-r--r-- | xsd/examples/cxx/parser/performance/gen.cxx | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/xsd/examples/cxx/parser/performance/gen.cxx b/xsd/examples/cxx/parser/performance/gen.cxx deleted file mode 100644 index b6392c0..0000000 --- a/xsd/examples/cxx/parser/performance/gen.cxx +++ /dev/null @@ -1,76 +0,0 @@ -#include <fstream> -#include <sstream> -#include <iostream> - -using namespace std; - -static const char* enums[] = -{ - "romance", - "fiction", - "horror", - "history", - "philosophy" -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 3) - { - cerr << "usage: " << argv[0] << " <count> <output-file>" << endl; - return 1; - } - - unsigned long n (0); - istringstream is (argv[1]); - is >> n; - - if (n == 0) - { - cerr << "record count argument should be a positive number" << endl; - return 1; - } - - ofstream ofs (argv[2]); - - if (!ofs.is_open ()) - { - cerr << "unable to open '" << argv[2] << "' in write mode" << endl; - return 1; - } - - ofs << "<t:root xmlns:t='test' " << - "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " << - "xsi:schemaLocation='test test.xsd'>"; - - unsigned short ch (1), en (0); - - for (unsigned long i (0); i < n; ++i) - { - ofs << "<record orange=\"" << i << "\""; - - if (i % 2 == 0) - ofs << " apple=\"true\""; - - ofs << ">" - << "<int>42</int>" - << "<double>42345.4232</double>" - << "<name>name123_45</name>"; - - if (i % 2 == 1) - ofs << "<string>one two three</string>"; - - ofs << "<choice" << ch << ">" << ch << " choice</choice" << ch << ">" - << "<enum>" << enums[en] << "</enum>" - << "</record>"; - - if (++ch > 4) - ch = 1; - - if (++en > 4) - en = 0; - } - - ofs << "</t:root>"; -} |