diff options
Diffstat (limited to 'xsd/xsd/pregenerated/xsd/cxx')
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/options.cxx | 739 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/options.hxx | 451 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/options.ixx | 615 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx | 776 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/parser/options.hxx | 186 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/parser/options.ixx | 162 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx | 1343 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/tree/options.hxx | 414 | ||||
-rw-r--r-- | xsd/xsd/pregenerated/xsd/cxx/tree/options.ixx | 504 |
9 files changed, 5190 insertions, 0 deletions
diff --git a/xsd/xsd/pregenerated/xsd/cxx/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/options.cxx new file mode 100644 index 0000000..9eea3a9 --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/options.cxx @@ -0,0 +1,739 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +#include <xsd/options-parser.hxx> +// +// End prologue. + +#include <xsd/cxx/options.hxx> + +#include <map> +#include <set> +#include <string> +#include <vector> +#include <utility> +#include <ostream> +#include <sstream> +#include <cstring> + +namespace cli +{ + template <typename X> + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + using namespace std; + + const char* o (s.next ()); + if (s.more ()) + { + string v (s.next ()); + istringstream is (v); + if (!(is >> x && is.peek () == istringstream::traits_type::eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<bool> + { + static void + parse (bool& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + + if (std::strcmp (v, "1") == 0 || + std::strcmp (v, "true") == 0 || + std::strcmp (v, "TRUE") == 0 || + std::strcmp (v, "True") == 0) + x = true; + else if (std::strcmp (v, "0") == 0 || + std::strcmp (v, "false") == 0 || + std::strcmp (v, "FALSE") == 0 || + std::strcmp (v, "False") == 0) + x = false; + else + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<std::string> + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X> + struct parser<std::pair<X, std::size_t> > + { + static void + parse (std::pair<X, std::size_t>& x, bool& xs, scanner& s) + { + x.second = s.position (); + parser<X>::parse (x.first, xs, s); + } + }; + + template <typename X> + struct parser<std::vector<X> > + { + static void + parse (std::vector<X>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.push_back (x); + xs = true; + } + }; + + template <typename X, typename C> + struct parser<std::set<X, C> > + { + static void + parse (std::set<X, C>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.insert (x); + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::map<K, V, C> > + { + static void + parse (std::map<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m[k] = v; + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::multimap<K, V, C> > + { + static void + parse (std::multimap<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m.insert (typename std::multimap<K, V, C>::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X, typename T, T X::*M> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, s); + } + + template <typename X, bool X::*M> + void + thunk (X& x, scanner& s) + { + s.next (); + x.*M = true; + } + + template <typename X, typename T, T X::*M, bool X::*S> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, x.*S, s); + } +} + +#include <map> + +namespace CXX +{ + // options + // + + options:: + options () + : std_ (cxx_version::cxx11), + std_specified_ (false), + char_type_ ("char"), + char_type_specified_ (false), + char_encoding_ (), + char_encoding_specified_ (false), + output_dir_ (), + output_dir_specified_ (false), + generate_inline_ (), + generate_xml_schema_ (), + extern_xml_schema_ (), + extern_xml_schema_specified_ (false), + namespace_map_ (), + namespace_map_specified_ (false), + namespace_regex_ (), + namespace_regex_specified_ (false), + namespace_regex_trace_ (), + reserved_name_ (), + reserved_name_specified_ (false), + include_with_brackets_ (), + include_prefix_ (), + include_prefix_specified_ (false), + include_regex_ (), + include_regex_specified_ (false), + include_regex_trace_ (), + guard_prefix_ (), + guard_prefix_specified_ (false), + hxx_suffix_ (".hxx"), + hxx_suffix_specified_ (false), + ixx_suffix_ (".ixx"), + ixx_suffix_specified_ (false), + cxx_suffix_ (".cxx"), + cxx_suffix_specified_ (false), + fwd_suffix_ ("-fwd.hxx"), + fwd_suffix_specified_ (false), + hxx_regex_ (), + hxx_regex_specified_ (false), + ixx_regex_ (), + ixx_regex_specified_ (false), + cxx_regex_ (), + cxx_regex_specified_ (false), + fwd_regex_ (), + fwd_regex_specified_ (false), + hxx_prologue_ (), + hxx_prologue_specified_ (false), + ixx_prologue_ (), + ixx_prologue_specified_ (false), + cxx_prologue_ (), + cxx_prologue_specified_ (false), + fwd_prologue_ (), + fwd_prologue_specified_ (false), + prologue_ (), + prologue_specified_ (false), + hxx_epilogue_ (), + hxx_epilogue_specified_ (false), + ixx_epilogue_ (), + ixx_epilogue_specified_ (false), + cxx_epilogue_ (), + cxx_epilogue_specified_ (false), + fwd_epilogue_ (), + fwd_epilogue_specified_ (false), + epilogue_ (), + epilogue_specified_ (false), + hxx_prologue_file_ (), + hxx_prologue_file_specified_ (false), + ixx_prologue_file_ (), + ixx_prologue_file_specified_ (false), + cxx_prologue_file_ (), + cxx_prologue_file_specified_ (false), + fwd_prologue_file_ (), + fwd_prologue_file_specified_ (false), + prologue_file_ (), + prologue_file_specified_ (false), + hxx_epilogue_file_ (), + hxx_epilogue_file_specified_ (false), + ixx_epilogue_file_ (), + ixx_epilogue_file_specified_ (false), + cxx_epilogue_file_ (), + cxx_epilogue_file_specified_ (false), + fwd_epilogue_file_ (), + fwd_epilogue_file_specified_ (false), + epilogue_file_ (), + epilogue_file_specified_ (false), + export_symbol_ (), + export_symbol_specified_ (false), + export_xml_schema_ (), + export_maps_ (), + import_maps_ (), + generate_dep_ (), + generate_dep_only_ (), + dep_phony_ (), + dep_target_ (), + dep_target_specified_ (false), + dep_suffix_ (".d"), + dep_suffix_specified_ (false), + dep_file_ (), + dep_file_specified_ (false), + dep_regex_ (), + dep_regex_specified_ (false) + { + } + + ::cli::usage_para options:: + print_usage (::std::wostream& os, ::cli::usage_para p) + { + CLI_POTENTIALLY_UNUSED (os); + + if (p == ::cli::usage_para::text) + os << ::std::endl; + + os << "--std <version> Specify the C++ standard that the generated code" << ::std::endl + << " should conform to." << ::std::endl; + + os << "--char-type <type> Generate code using the provided character <type>" << ::std::endl + << " instead of the default char." << ::std::endl; + + os << "--char-encoding <enc> Specify the character encoding that should be used" << ::std::endl + << " in the generated code." << ::std::endl; + + os << "--output-dir <dir> Write generated files to <dir> instead of the" << ::std::endl + << " current directory." << ::std::endl; + + os << "--generate-inline Generate simple functions inline." << ::std::endl; + + os << "--generate-xml-schema Generate a C++ header file as if the schema being" << ::std::endl + << " compiled defines the XML Schema namespace." << ::std::endl; + + os << "--extern-xml-schema <file> Include a header file derived from <file> instead" << ::std::endl + << " of generating the XML Schema namespace mapping" << ::std::endl + << " inline." << ::std::endl; + + os << "--namespace-map <xns>=<cns> Map XML Schema namespace <xns> to C++ namespace" << ::std::endl + << " <cns>." << ::std::endl; + + os << "--namespace-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema namespace names to" << ::std::endl + << " C++ namespace names." << ::std::endl; + + os << "--namespace-regex-trace Trace the process of applying regular expressions" << ::std::endl + << " specified with the --namespace-regex option." << ::std::endl; + + os << "--reserved-name <n>[=<r>] Add name <n> to the list of names that should not" << ::std::endl + << " be used as identifiers." << ::std::endl; + + os << "--include-with-brackets Use angle brackets (<>) instead of quotes (\"\") in" << ::std::endl + << " generated #include directives." << ::std::endl; + + os << "--include-prefix <prefix> Add <prefix> to generated #include directive" << ::std::endl + << " paths." << ::std::endl; + + os << "--include-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to transform #include directive paths." << ::std::endl; + + os << "--include-regex-trace Trace the process of applying regular expressions" << ::std::endl + << " specified with the --include-regex option." << ::std::endl; + + os << "--guard-prefix <prefix> Add <prefix> to generated header inclusion guards." << ::std::endl; + + os << "--hxx-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " .hxx to construct the name of the header file." << ::std::endl; + + os << "--ixx-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " .ixx to construct the name of the inline file." << ::std::endl; + + os << "--cxx-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " .cxx to construct the name of the source file." << ::std::endl; + + os << "--fwd-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " -fwd.hxx to construct the name of the forward" << ::std::endl + << " declaration file." << ::std::endl; + + os << "--hxx-regex <regex> Use the provided expression to construct the name" << ::std::endl + << " of the header file." << ::std::endl; + + os << "--ixx-regex <regex> Use the provided expression to construct the name" << ::std::endl + << " of the inline file." << ::std::endl; + + os << "--cxx-regex <regex> Use the provided expression to construct the name" << ::std::endl + << " of the source file." << ::std::endl; + + os << "--fwd-regex <regex> Use the provided expression to construct the name" << ::std::endl + << " of the forward declaration file." << ::std::endl; + + os << "--hxx-prologue <text> Insert <text> at the beginning of the header file." << ::std::endl; + + os << "--ixx-prologue <text> Insert <text> at the beginning of the inline file." << ::std::endl; + + os << "--cxx-prologue <text> Insert <text> at the beginning of the source file." << ::std::endl; + + os << "--fwd-prologue <text> Insert <text> at the beginning of the forward" << ::std::endl + << " declaration file." << ::std::endl; + + os << "--prologue <text> Insert <text> at the beginning of each generated" << ::std::endl + << " file for which there is no file-specific prologue." << ::std::endl; + + os << "--hxx-epilogue <text> Insert <text> at the end of the header file." << ::std::endl; + + os << "--ixx-epilogue <text> Insert <text> at the end of the inline file." << ::std::endl; + + os << "--cxx-epilogue <text> Insert <text> at the end of the source file." << ::std::endl; + + os << "--fwd-epilogue <text> Insert <text> at the end of the forward" << ::std::endl + << " declaration file." << ::std::endl; + + os << "--epilogue <text> Insert <text> at the end of each generated file" << ::std::endl + << " for which there is no file-specific epilogue." << ::std::endl; + + os << "--hxx-prologue-file <file> Insert the content of the <file> at the beginning" << ::std::endl + << " of the header file." << ::std::endl; + + os << "--ixx-prologue-file <file> Insert the content of the <file> at the beginning" << ::std::endl + << " of the inline file." << ::std::endl; + + os << "--cxx-prologue-file <file> Insert the content of the <file> at the beginning" << ::std::endl + << " of the source file." << ::std::endl; + + os << "--fwd-prologue-file <file> Insert the content of the <file> at the beginning" << ::std::endl + << " of the forward declaration file." << ::std::endl; + + os << "--prologue-file <file> Insert the content of the <file> at the beginning" << ::std::endl + << " of each generated file for which there is no" << ::std::endl + << " file-specific prologue file." << ::std::endl; + + os << "--hxx-epilogue-file <file> Insert the content of the <file> at the end of the" << ::std::endl + << " header file." << ::std::endl; + + os << "--ixx-epilogue-file <file> Insert the content of the <file> at the end of the" << ::std::endl + << " inline file." << ::std::endl; + + os << "--cxx-epilogue-file <file> Insert the content of the <file> at the end of the" << ::std::endl + << " source file." << ::std::endl; + + os << "--fwd-epilogue-file <file> Insert the content of the <file> at the end of the" << ::std::endl + << " forward declaration file." << ::std::endl; + + os << "--epilogue-file <file> Insert the content of the <file> at the end of" << ::std::endl + << " each generated file for which there is no" << ::std::endl + << " file-specific epilogue file." << ::std::endl; + + os << "--export-symbol <symbol> Insert <symbol> in places where DLL export/import" << ::std::endl + << " control statements" << ::std::endl + << " (__declspec(dllexport/dllimport)) are necessary." << ::std::endl; + + os << "--export-xml-schema Export/import types in the XML Schema namespace" << ::std::endl + << " using the export symbol provided with the" << ::std::endl + << " --export-symbol option." << ::std::endl; + + os << "--export-maps Export polymorphism support maps from a Win32 DLL" << ::std::endl + << " into which this generated code is placed." << ::std::endl; + + os << "--import-maps Import polymorphism support maps to a Win32 DLL or" << ::std::endl + << " executable into which this generated code is" << ::std::endl + << " linked." << ::std::endl; + + os << "--generate-dep Generate make dependency information." << ::std::endl; + + os << "--generate-dep-only Generate make dependency information only." << ::std::endl; + + os << "--dep-phony Generate phony targets for included/imported" << ::std::endl + << " schema files, causing each to depend on nothing." << ::std::endl; + + os << "--dep-target <target> Change the target of the dependency rule." << ::std::endl; + + os << "--dep-suffix <suffix> Use <suffix> instead of the default .d to" << ::std::endl + << " construct the name of the dependency file." << ::std::endl; + + os << "--dep-file <path> Use <path> as the generated dependency file path" << ::std::endl + << " instead of deriving it from the input file name." << ::std::endl; + + os << "--dep-regex <regex> Use the provided expression to construct the name" << ::std::endl + << " of the dependency file." << ::std::endl; + + p = ::cli::usage_para::option; + + return p; + } + + typedef + std::map<std::string, void (*) (options&, ::cli::scanner&)> + _cli_options_map; + + static _cli_options_map _cli_options_map_; + + struct _cli_options_map_init + { + _cli_options_map_init () + { + _cli_options_map_["--std"] = + &::cli::thunk< options, cxx_version, &options::std_, + &options::std_specified_ >; + _cli_options_map_["--char-type"] = + &::cli::thunk< options, NarrowString, &options::char_type_, + &options::char_type_specified_ >; + _cli_options_map_["--char-encoding"] = + &::cli::thunk< options, NarrowString, &options::char_encoding_, + &options::char_encoding_specified_ >; + _cli_options_map_["--output-dir"] = + &::cli::thunk< options, NarrowString, &options::output_dir_, + &options::output_dir_specified_ >; + _cli_options_map_["--generate-inline"] = + &::cli::thunk< options, &options::generate_inline_ >; + _cli_options_map_["--generate-xml-schema"] = + &::cli::thunk< options, &options::generate_xml_schema_ >; + _cli_options_map_["--extern-xml-schema"] = + &::cli::thunk< options, NarrowString, &options::extern_xml_schema_, + &options::extern_xml_schema_specified_ >; + _cli_options_map_["--namespace-map"] = + &::cli::thunk< options, NarrowStrings, &options::namespace_map_, + &options::namespace_map_specified_ >; + _cli_options_map_["--namespace-regex"] = + &::cli::thunk< options, NarrowStrings, &options::namespace_regex_, + &options::namespace_regex_specified_ >; + _cli_options_map_["--namespace-regex-trace"] = + &::cli::thunk< options, &options::namespace_regex_trace_ >; + _cli_options_map_["--reserved-name"] = + &::cli::thunk< options, NarrowStrings, &options::reserved_name_, + &options::reserved_name_specified_ >; + _cli_options_map_["--include-with-brackets"] = + &::cli::thunk< options, &options::include_with_brackets_ >; + _cli_options_map_["--include-prefix"] = + &::cli::thunk< options, NarrowString, &options::include_prefix_, + &options::include_prefix_specified_ >; + _cli_options_map_["--include-regex"] = + &::cli::thunk< options, NarrowStrings, &options::include_regex_, + &options::include_regex_specified_ >; + _cli_options_map_["--include-regex-trace"] = + &::cli::thunk< options, &options::include_regex_trace_ >; + _cli_options_map_["--guard-prefix"] = + &::cli::thunk< options, NarrowString, &options::guard_prefix_, + &options::guard_prefix_specified_ >; + _cli_options_map_["--hxx-suffix"] = + &::cli::thunk< options, NarrowString, &options::hxx_suffix_, + &options::hxx_suffix_specified_ >; + _cli_options_map_["--ixx-suffix"] = + &::cli::thunk< options, NarrowString, &options::ixx_suffix_, + &options::ixx_suffix_specified_ >; + _cli_options_map_["--cxx-suffix"] = + &::cli::thunk< options, NarrowString, &options::cxx_suffix_, + &options::cxx_suffix_specified_ >; + _cli_options_map_["--fwd-suffix"] = + &::cli::thunk< options, NarrowString, &options::fwd_suffix_, + &options::fwd_suffix_specified_ >; + _cli_options_map_["--hxx-regex"] = + &::cli::thunk< options, NarrowString, &options::hxx_regex_, + &options::hxx_regex_specified_ >; + _cli_options_map_["--ixx-regex"] = + &::cli::thunk< options, NarrowString, &options::ixx_regex_, + &options::ixx_regex_specified_ >; + _cli_options_map_["--cxx-regex"] = + &::cli::thunk< options, NarrowString, &options::cxx_regex_, + &options::cxx_regex_specified_ >; + _cli_options_map_["--fwd-regex"] = + &::cli::thunk< options, NarrowString, &options::fwd_regex_, + &options::fwd_regex_specified_ >; + _cli_options_map_["--hxx-prologue"] = + &::cli::thunk< options, NarrowStrings, &options::hxx_prologue_, + &options::hxx_prologue_specified_ >; + _cli_options_map_["--ixx-prologue"] = + &::cli::thunk< options, NarrowStrings, &options::ixx_prologue_, + &options::ixx_prologue_specified_ >; + _cli_options_map_["--cxx-prologue"] = + &::cli::thunk< options, NarrowStrings, &options::cxx_prologue_, + &options::cxx_prologue_specified_ >; + _cli_options_map_["--fwd-prologue"] = + &::cli::thunk< options, NarrowStrings, &options::fwd_prologue_, + &options::fwd_prologue_specified_ >; + _cli_options_map_["--prologue"] = + &::cli::thunk< options, NarrowStrings, &options::prologue_, + &options::prologue_specified_ >; + _cli_options_map_["--hxx-epilogue"] = + &::cli::thunk< options, NarrowStrings, &options::hxx_epilogue_, + &options::hxx_epilogue_specified_ >; + _cli_options_map_["--ixx-epilogue"] = + &::cli::thunk< options, NarrowStrings, &options::ixx_epilogue_, + &options::ixx_epilogue_specified_ >; + _cli_options_map_["--cxx-epilogue"] = + &::cli::thunk< options, NarrowStrings, &options::cxx_epilogue_, + &options::cxx_epilogue_specified_ >; + _cli_options_map_["--fwd-epilogue"] = + &::cli::thunk< options, NarrowStrings, &options::fwd_epilogue_, + &options::fwd_epilogue_specified_ >; + _cli_options_map_["--epilogue"] = + &::cli::thunk< options, NarrowStrings, &options::epilogue_, + &options::epilogue_specified_ >; + _cli_options_map_["--hxx-prologue-file"] = + &::cli::thunk< options, NarrowString, &options::hxx_prologue_file_, + &options::hxx_prologue_file_specified_ >; + _cli_options_map_["--ixx-prologue-file"] = + &::cli::thunk< options, NarrowString, &options::ixx_prologue_file_, + &options::ixx_prologue_file_specified_ >; + _cli_options_map_["--cxx-prologue-file"] = + &::cli::thunk< options, NarrowString, &options::cxx_prologue_file_, + &options::cxx_prologue_file_specified_ >; + _cli_options_map_["--fwd-prologue-file"] = + &::cli::thunk< options, NarrowString, &options::fwd_prologue_file_, + &options::fwd_prologue_file_specified_ >; + _cli_options_map_["--prologue-file"] = + &::cli::thunk< options, NarrowString, &options::prologue_file_, + &options::prologue_file_specified_ >; + _cli_options_map_["--hxx-epilogue-file"] = + &::cli::thunk< options, NarrowString, &options::hxx_epilogue_file_, + &options::hxx_epilogue_file_specified_ >; + _cli_options_map_["--ixx-epilogue-file"] = + &::cli::thunk< options, NarrowString, &options::ixx_epilogue_file_, + &options::ixx_epilogue_file_specified_ >; + _cli_options_map_["--cxx-epilogue-file"] = + &::cli::thunk< options, NarrowString, &options::cxx_epilogue_file_, + &options::cxx_epilogue_file_specified_ >; + _cli_options_map_["--fwd-epilogue-file"] = + &::cli::thunk< options, NarrowString, &options::fwd_epilogue_file_, + &options::fwd_epilogue_file_specified_ >; + _cli_options_map_["--epilogue-file"] = + &::cli::thunk< options, NarrowString, &options::epilogue_file_, + &options::epilogue_file_specified_ >; + _cli_options_map_["--export-symbol"] = + &::cli::thunk< options, NarrowString, &options::export_symbol_, + &options::export_symbol_specified_ >; + _cli_options_map_["--export-xml-schema"] = + &::cli::thunk< options, &options::export_xml_schema_ >; + _cli_options_map_["--export-maps"] = + &::cli::thunk< options, &options::export_maps_ >; + _cli_options_map_["--import-maps"] = + &::cli::thunk< options, &options::import_maps_ >; + _cli_options_map_["--generate-dep"] = + &::cli::thunk< options, &options::generate_dep_ >; + _cli_options_map_["--generate-dep-only"] = + &::cli::thunk< options, &options::generate_dep_only_ >; + _cli_options_map_["--dep-phony"] = + &::cli::thunk< options, &options::dep_phony_ >; + _cli_options_map_["--dep-target"] = + &::cli::thunk< options, NarrowStrings, &options::dep_target_, + &options::dep_target_specified_ >; + _cli_options_map_["--dep-suffix"] = + &::cli::thunk< options, NarrowString, &options::dep_suffix_, + &options::dep_suffix_specified_ >; + _cli_options_map_["--dep-file"] = + &::cli::thunk< options, NarrowString, &options::dep_file_, + &options::dep_file_specified_ >; + _cli_options_map_["--dep-regex"] = + &::cli::thunk< options, NarrowString, &options::dep_regex_, + &options::dep_regex_specified_ >; + } + }; + + static _cli_options_map_init _cli_options_map_init_; + + bool options:: + _parse (const char* o, ::cli::scanner& s) + { + _cli_options_map::const_iterator i (_cli_options_map_.find (o)); + + if (i != _cli_options_map_.end ()) + { + (*(i->second)) (*this, s); + return true; + } + + // options base + // + if (::options::_parse (o, s)) + return true; + + return false; + } +} + +// Begin epilogue. +// +// +// End epilogue. + diff --git a/xsd/xsd/pregenerated/xsd/cxx/options.hxx b/xsd/xsd/pregenerated/xsd/cxx/options.hxx new file mode 100644 index 0000000..085aa4c --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/options.hxx @@ -0,0 +1,451 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef XSD_CXX_OPTIONS_HXX +#define XSD_CXX_OPTIONS_HXX + +// Begin prologue. +// +// +// End prologue. + +#include <cstddef> + +#include <xsd/types.hxx> + +#include <xsd/cxx/option-types.hxx> + +#include <xsd/options.hxx> + +namespace CXX +{ + class options: public ::options + { + public: + // Option accessors. + // + const cxx_version& + std () const; + + bool + std_specified () const; + + const NarrowString& + char_type () const; + + bool + char_type_specified () const; + + const NarrowString& + char_encoding () const; + + bool + char_encoding_specified () const; + + const NarrowString& + output_dir () const; + + bool + output_dir_specified () const; + + const bool& + generate_inline () const; + + const bool& + generate_xml_schema () const; + + const NarrowString& + extern_xml_schema () const; + + bool + extern_xml_schema_specified () const; + + const NarrowStrings& + namespace_map () const; + + bool + namespace_map_specified () const; + + const NarrowStrings& + namespace_regex () const; + + bool + namespace_regex_specified () const; + + const bool& + namespace_regex_trace () const; + + const NarrowStrings& + reserved_name () const; + + bool + reserved_name_specified () const; + + const bool& + include_with_brackets () const; + + const NarrowString& + include_prefix () const; + + bool + include_prefix_specified () const; + + const NarrowStrings& + include_regex () const; + + bool + include_regex_specified () const; + + const bool& + include_regex_trace () const; + + const NarrowString& + guard_prefix () const; + + bool + guard_prefix_specified () const; + + const NarrowString& + hxx_suffix () const; + + bool + hxx_suffix_specified () const; + + const NarrowString& + ixx_suffix () const; + + bool + ixx_suffix_specified () const; + + const NarrowString& + cxx_suffix () const; + + bool + cxx_suffix_specified () const; + + const NarrowString& + fwd_suffix () const; + + bool + fwd_suffix_specified () const; + + const NarrowString& + hxx_regex () const; + + bool + hxx_regex_specified () const; + + const NarrowString& + ixx_regex () const; + + bool + ixx_regex_specified () const; + + const NarrowString& + cxx_regex () const; + + bool + cxx_regex_specified () const; + + const NarrowString& + fwd_regex () const; + + bool + fwd_regex_specified () const; + + const NarrowStrings& + hxx_prologue () const; + + bool + hxx_prologue_specified () const; + + const NarrowStrings& + ixx_prologue () const; + + bool + ixx_prologue_specified () const; + + const NarrowStrings& + cxx_prologue () const; + + bool + cxx_prologue_specified () const; + + const NarrowStrings& + fwd_prologue () const; + + bool + fwd_prologue_specified () const; + + const NarrowStrings& + prologue () const; + + bool + prologue_specified () const; + + const NarrowStrings& + hxx_epilogue () const; + + bool + hxx_epilogue_specified () const; + + const NarrowStrings& + ixx_epilogue () const; + + bool + ixx_epilogue_specified () const; + + const NarrowStrings& + cxx_epilogue () const; + + bool + cxx_epilogue_specified () const; + + const NarrowStrings& + fwd_epilogue () const; + + bool + fwd_epilogue_specified () const; + + const NarrowStrings& + epilogue () const; + + bool + epilogue_specified () const; + + const NarrowString& + hxx_prologue_file () const; + + bool + hxx_prologue_file_specified () const; + + const NarrowString& + ixx_prologue_file () const; + + bool + ixx_prologue_file_specified () const; + + const NarrowString& + cxx_prologue_file () const; + + bool + cxx_prologue_file_specified () const; + + const NarrowString& + fwd_prologue_file () const; + + bool + fwd_prologue_file_specified () const; + + const NarrowString& + prologue_file () const; + + bool + prologue_file_specified () const; + + const NarrowString& + hxx_epilogue_file () const; + + bool + hxx_epilogue_file_specified () const; + + const NarrowString& + ixx_epilogue_file () const; + + bool + ixx_epilogue_file_specified () const; + + const NarrowString& + cxx_epilogue_file () const; + + bool + cxx_epilogue_file_specified () const; + + const NarrowString& + fwd_epilogue_file () const; + + bool + fwd_epilogue_file_specified () const; + + const NarrowString& + epilogue_file () const; + + bool + epilogue_file_specified () const; + + const NarrowString& + export_symbol () const; + + bool + export_symbol_specified () const; + + const bool& + export_xml_schema () const; + + const bool& + export_maps () const; + + const bool& + import_maps () const; + + const bool& + generate_dep () const; + + const bool& + generate_dep_only () const; + + const bool& + dep_phony () const; + + const NarrowStrings& + dep_target () const; + + bool + dep_target_specified () const; + + const NarrowString& + dep_suffix () const; + + bool + dep_suffix_specified () const; + + const NarrowString& + dep_file () const; + + bool + dep_file_specified () const; + + const NarrowString& + dep_regex () const; + + bool + dep_regex_specified () const; + + // Print usage information. + // + static ::cli::usage_para + print_usage (::std::wostream&, + ::cli::usage_para = ::cli::usage_para::none); + + // Implementation details. + // + protected: + options (); + + bool + _parse (const char*, ::cli::scanner&); + + public: + cxx_version std_; + bool std_specified_; + NarrowString char_type_; + bool char_type_specified_; + NarrowString char_encoding_; + bool char_encoding_specified_; + NarrowString output_dir_; + bool output_dir_specified_; + bool generate_inline_; + bool generate_xml_schema_; + NarrowString extern_xml_schema_; + bool extern_xml_schema_specified_; + NarrowStrings namespace_map_; + bool namespace_map_specified_; + NarrowStrings namespace_regex_; + bool namespace_regex_specified_; + bool namespace_regex_trace_; + NarrowStrings reserved_name_; + bool reserved_name_specified_; + bool include_with_brackets_; + NarrowString include_prefix_; + bool include_prefix_specified_; + NarrowStrings include_regex_; + bool include_regex_specified_; + bool include_regex_trace_; + NarrowString guard_prefix_; + bool guard_prefix_specified_; + NarrowString hxx_suffix_; + bool hxx_suffix_specified_; + NarrowString ixx_suffix_; + bool ixx_suffix_specified_; + NarrowString cxx_suffix_; + bool cxx_suffix_specified_; + NarrowString fwd_suffix_; + bool fwd_suffix_specified_; + NarrowString hxx_regex_; + bool hxx_regex_specified_; + NarrowString ixx_regex_; + bool ixx_regex_specified_; + NarrowString cxx_regex_; + bool cxx_regex_specified_; + NarrowString fwd_regex_; + bool fwd_regex_specified_; + NarrowStrings hxx_prologue_; + bool hxx_prologue_specified_; + NarrowStrings ixx_prologue_; + bool ixx_prologue_specified_; + NarrowStrings cxx_prologue_; + bool cxx_prologue_specified_; + NarrowStrings fwd_prologue_; + bool fwd_prologue_specified_; + NarrowStrings prologue_; + bool prologue_specified_; + NarrowStrings hxx_epilogue_; + bool hxx_epilogue_specified_; + NarrowStrings ixx_epilogue_; + bool ixx_epilogue_specified_; + NarrowStrings cxx_epilogue_; + bool cxx_epilogue_specified_; + NarrowStrings fwd_epilogue_; + bool fwd_epilogue_specified_; + NarrowStrings epilogue_; + bool epilogue_specified_; + NarrowString hxx_prologue_file_; + bool hxx_prologue_file_specified_; + NarrowString ixx_prologue_file_; + bool ixx_prologue_file_specified_; + NarrowString cxx_prologue_file_; + bool cxx_prologue_file_specified_; + NarrowString fwd_prologue_file_; + bool fwd_prologue_file_specified_; + NarrowString prologue_file_; + bool prologue_file_specified_; + NarrowString hxx_epilogue_file_; + bool hxx_epilogue_file_specified_; + NarrowString ixx_epilogue_file_; + bool ixx_epilogue_file_specified_; + NarrowString cxx_epilogue_file_; + bool cxx_epilogue_file_specified_; + NarrowString fwd_epilogue_file_; + bool fwd_epilogue_file_specified_; + NarrowString epilogue_file_; + bool epilogue_file_specified_; + NarrowString export_symbol_; + bool export_symbol_specified_; + bool export_xml_schema_; + bool export_maps_; + bool import_maps_; + bool generate_dep_; + bool generate_dep_only_; + bool dep_phony_; + NarrowStrings dep_target_; + bool dep_target_specified_; + NarrowString dep_suffix_; + bool dep_suffix_specified_; + NarrowString dep_file_; + bool dep_file_specified_; + NarrowString dep_regex_; + bool dep_regex_specified_; + }; +} + +#include <xsd/cxx/options.ixx> + +// Begin epilogue. +// +// +// End epilogue. + +#endif // XSD_CXX_OPTIONS_HXX diff --git a/xsd/xsd/pregenerated/xsd/cxx/options.ixx b/xsd/xsd/pregenerated/xsd/cxx/options.ixx new file mode 100644 index 0000000..8266e31 --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/options.ixx @@ -0,0 +1,615 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +// +// End prologue. + +namespace CXX +{ + // options + // + + inline const cxx_version& options:: + std () const + { + return this->std_; + } + + inline bool options:: + std_specified () const + { + return this->std_specified_; + } + + inline const NarrowString& options:: + char_type () const + { + return this->char_type_; + } + + inline bool options:: + char_type_specified () const + { + return this->char_type_specified_; + } + + inline const NarrowString& options:: + char_encoding () const + { + return this->char_encoding_; + } + + inline bool options:: + char_encoding_specified () const + { + return this->char_encoding_specified_; + } + + inline const NarrowString& options:: + output_dir () const + { + return this->output_dir_; + } + + inline bool options:: + output_dir_specified () const + { + return this->output_dir_specified_; + } + + inline const bool& options:: + generate_inline () const + { + return this->generate_inline_; + } + + inline const bool& options:: + generate_xml_schema () const + { + return this->generate_xml_schema_; + } + + inline const NarrowString& options:: + extern_xml_schema () const + { + return this->extern_xml_schema_; + } + + inline bool options:: + extern_xml_schema_specified () const + { + return this->extern_xml_schema_specified_; + } + + inline const NarrowStrings& options:: + namespace_map () const + { + return this->namespace_map_; + } + + inline bool options:: + namespace_map_specified () const + { + return this->namespace_map_specified_; + } + + inline const NarrowStrings& options:: + namespace_regex () const + { + return this->namespace_regex_; + } + + inline bool options:: + namespace_regex_specified () const + { + return this->namespace_regex_specified_; + } + + inline const bool& options:: + namespace_regex_trace () const + { + return this->namespace_regex_trace_; + } + + inline const NarrowStrings& options:: + reserved_name () const + { + return this->reserved_name_; + } + + inline bool options:: + reserved_name_specified () const + { + return this->reserved_name_specified_; + } + + inline const bool& options:: + include_with_brackets () const + { + return this->include_with_brackets_; + } + + inline const NarrowString& options:: + include_prefix () const + { + return this->include_prefix_; + } + + inline bool options:: + include_prefix_specified () const + { + return this->include_prefix_specified_; + } + + inline const NarrowStrings& options:: + include_regex () const + { + return this->include_regex_; + } + + inline bool options:: + include_regex_specified () const + { + return this->include_regex_specified_; + } + + inline const bool& options:: + include_regex_trace () const + { + return this->include_regex_trace_; + } + + inline const NarrowString& options:: + guard_prefix () const + { + return this->guard_prefix_; + } + + inline bool options:: + guard_prefix_specified () const + { + return this->guard_prefix_specified_; + } + + inline const NarrowString& options:: + hxx_suffix () const + { + return this->hxx_suffix_; + } + + inline bool options:: + hxx_suffix_specified () const + { + return this->hxx_suffix_specified_; + } + + inline const NarrowString& options:: + ixx_suffix () const + { + return this->ixx_suffix_; + } + + inline bool options:: + ixx_suffix_specified () const + { + return this->ixx_suffix_specified_; + } + + inline const NarrowString& options:: + cxx_suffix () const + { + return this->cxx_suffix_; + } + + inline bool options:: + cxx_suffix_specified () const + { + return this->cxx_suffix_specified_; + } + + inline const NarrowString& options:: + fwd_suffix () const + { + return this->fwd_suffix_; + } + + inline bool options:: + fwd_suffix_specified () const + { + return this->fwd_suffix_specified_; + } + + inline const NarrowString& options:: + hxx_regex () const + { + return this->hxx_regex_; + } + + inline bool options:: + hxx_regex_specified () const + { + return this->hxx_regex_specified_; + } + + inline const NarrowString& options:: + ixx_regex () const + { + return this->ixx_regex_; + } + + inline bool options:: + ixx_regex_specified () const + { + return this->ixx_regex_specified_; + } + + inline const NarrowString& options:: + cxx_regex () const + { + return this->cxx_regex_; + } + + inline bool options:: + cxx_regex_specified () const + { + return this->cxx_regex_specified_; + } + + inline const NarrowString& options:: + fwd_regex () const + { + return this->fwd_regex_; + } + + inline bool options:: + fwd_regex_specified () const + { + return this->fwd_regex_specified_; + } + + inline const NarrowStrings& options:: + hxx_prologue () const + { + return this->hxx_prologue_; + } + + inline bool options:: + hxx_prologue_specified () const + { + return this->hxx_prologue_specified_; + } + + inline const NarrowStrings& options:: + ixx_prologue () const + { + return this->ixx_prologue_; + } + + inline bool options:: + ixx_prologue_specified () const + { + return this->ixx_prologue_specified_; + } + + inline const NarrowStrings& options:: + cxx_prologue () const + { + return this->cxx_prologue_; + } + + inline bool options:: + cxx_prologue_specified () const + { + return this->cxx_prologue_specified_; + } + + inline const NarrowStrings& options:: + fwd_prologue () const + { + return this->fwd_prologue_; + } + + inline bool options:: + fwd_prologue_specified () const + { + return this->fwd_prologue_specified_; + } + + inline const NarrowStrings& options:: + prologue () const + { + return this->prologue_; + } + + inline bool options:: + prologue_specified () const + { + return this->prologue_specified_; + } + + inline const NarrowStrings& options:: + hxx_epilogue () const + { + return this->hxx_epilogue_; + } + + inline bool options:: + hxx_epilogue_specified () const + { + return this->hxx_epilogue_specified_; + } + + inline const NarrowStrings& options:: + ixx_epilogue () const + { + return this->ixx_epilogue_; + } + + inline bool options:: + ixx_epilogue_specified () const + { + return this->ixx_epilogue_specified_; + } + + inline const NarrowStrings& options:: + cxx_epilogue () const + { + return this->cxx_epilogue_; + } + + inline bool options:: + cxx_epilogue_specified () const + { + return this->cxx_epilogue_specified_; + } + + inline const NarrowStrings& options:: + fwd_epilogue () const + { + return this->fwd_epilogue_; + } + + inline bool options:: + fwd_epilogue_specified () const + { + return this->fwd_epilogue_specified_; + } + + inline const NarrowStrings& options:: + epilogue () const + { + return this->epilogue_; + } + + inline bool options:: + epilogue_specified () const + { + return this->epilogue_specified_; + } + + inline const NarrowString& options:: + hxx_prologue_file () const + { + return this->hxx_prologue_file_; + } + + inline bool options:: + hxx_prologue_file_specified () const + { + return this->hxx_prologue_file_specified_; + } + + inline const NarrowString& options:: + ixx_prologue_file () const + { + return this->ixx_prologue_file_; + } + + inline bool options:: + ixx_prologue_file_specified () const + { + return this->ixx_prologue_file_specified_; + } + + inline const NarrowString& options:: + cxx_prologue_file () const + { + return this->cxx_prologue_file_; + } + + inline bool options:: + cxx_prologue_file_specified () const + { + return this->cxx_prologue_file_specified_; + } + + inline const NarrowString& options:: + fwd_prologue_file () const + { + return this->fwd_prologue_file_; + } + + inline bool options:: + fwd_prologue_file_specified () const + { + return this->fwd_prologue_file_specified_; + } + + inline const NarrowString& options:: + prologue_file () const + { + return this->prologue_file_; + } + + inline bool options:: + prologue_file_specified () const + { + return this->prologue_file_specified_; + } + + inline const NarrowString& options:: + hxx_epilogue_file () const + { + return this->hxx_epilogue_file_; + } + + inline bool options:: + hxx_epilogue_file_specified () const + { + return this->hxx_epilogue_file_specified_; + } + + inline const NarrowString& options:: + ixx_epilogue_file () const + { + return this->ixx_epilogue_file_; + } + + inline bool options:: + ixx_epilogue_file_specified () const + { + return this->ixx_epilogue_file_specified_; + } + + inline const NarrowString& options:: + cxx_epilogue_file () const + { + return this->cxx_epilogue_file_; + } + + inline bool options:: + cxx_epilogue_file_specified () const + { + return this->cxx_epilogue_file_specified_; + } + + inline const NarrowString& options:: + fwd_epilogue_file () const + { + return this->fwd_epilogue_file_; + } + + inline bool options:: + fwd_epilogue_file_specified () const + { + return this->fwd_epilogue_file_specified_; + } + + inline const NarrowString& options:: + epilogue_file () const + { + return this->epilogue_file_; + } + + inline bool options:: + epilogue_file_specified () const + { + return this->epilogue_file_specified_; + } + + inline const NarrowString& options:: + export_symbol () const + { + return this->export_symbol_; + } + + inline bool options:: + export_symbol_specified () const + { + return this->export_symbol_specified_; + } + + inline const bool& options:: + export_xml_schema () const + { + return this->export_xml_schema_; + } + + inline const bool& options:: + export_maps () const + { + return this->export_maps_; + } + + inline const bool& options:: + import_maps () const + { + return this->import_maps_; + } + + inline const bool& options:: + generate_dep () const + { + return this->generate_dep_; + } + + inline const bool& options:: + generate_dep_only () const + { + return this->generate_dep_only_; + } + + inline const bool& options:: + dep_phony () const + { + return this->dep_phony_; + } + + inline const NarrowStrings& options:: + dep_target () const + { + return this->dep_target_; + } + + inline bool options:: + dep_target_specified () const + { + return this->dep_target_specified_; + } + + inline const NarrowString& options:: + dep_suffix () const + { + return this->dep_suffix_; + } + + inline bool options:: + dep_suffix_specified () const + { + return this->dep_suffix_specified_; + } + + inline const NarrowString& options:: + dep_file () const + { + return this->dep_file_; + } + + inline bool options:: + dep_file_specified () const + { + return this->dep_file_specified_; + } + + inline const NarrowString& options:: + dep_regex () const + { + return this->dep_regex_; + } + + inline bool options:: + dep_regex_specified () const + { + return this->dep_regex_specified_; + } +} + +// Begin epilogue. +// +// +// End epilogue. diff --git a/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx new file mode 100644 index 0000000..60667ac --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/parser/options.cxx @@ -0,0 +1,776 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +#include <xsd/options-parser.hxx> +// +// End prologue. + +#include <xsd/cxx/parser/options.hxx> + +#include <map> +#include <set> +#include <string> +#include <vector> +#include <utility> +#include <ostream> +#include <sstream> +#include <cstring> + +namespace cli +{ + template <typename X> + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + using namespace std; + + const char* o (s.next ()); + if (s.more ()) + { + string v (s.next ()); + istringstream is (v); + if (!(is >> x && is.peek () == istringstream::traits_type::eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<bool> + { + static void + parse (bool& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + + if (std::strcmp (v, "1") == 0 || + std::strcmp (v, "true") == 0 || + std::strcmp (v, "TRUE") == 0 || + std::strcmp (v, "True") == 0) + x = true; + else if (std::strcmp (v, "0") == 0 || + std::strcmp (v, "false") == 0 || + std::strcmp (v, "FALSE") == 0 || + std::strcmp (v, "False") == 0) + x = false; + else + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<std::string> + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X> + struct parser<std::pair<X, std::size_t> > + { + static void + parse (std::pair<X, std::size_t>& x, bool& xs, scanner& s) + { + x.second = s.position (); + parser<X>::parse (x.first, xs, s); + } + }; + + template <typename X> + struct parser<std::vector<X> > + { + static void + parse (std::vector<X>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.push_back (x); + xs = true; + } + }; + + template <typename X, typename C> + struct parser<std::set<X, C> > + { + static void + parse (std::set<X, C>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.insert (x); + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::map<K, V, C> > + { + static void + parse (std::map<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m[k] = v; + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::multimap<K, V, C> > + { + static void + parse (std::multimap<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m.insert (typename std::multimap<K, V, C>::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X, typename T, T X::*M> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, s); + } + + template <typename X, bool X::*M> + void + thunk (X& x, scanner& s) + { + s.next (); + x.*M = true; + } + + template <typename X, typename T, T X::*M, bool X::*S> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, x.*S, s); + } +} + +#include <map> + +namespace CXX +{ + namespace Parser + { + // options + // + + options:: + options () + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + } + + options:: + options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + } + + options:: + options (int start, + int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + } + + options:: + options (int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + options:: + options (int start, + int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + options:: + options (::cli::scanner& s, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : type_map_ (), + type_map_specified_ (false), + xml_parser_ ("xerces"), + xml_parser_specified_ (false), + generate_validation_ (), + suppress_validation_ (), + generate_polymorphic_ (), + generate_noop_impl_ (), + generate_print_impl_ (), + generate_test_driver_ (), + force_overwrite_ (), + root_element_first_ (), + root_element_last_ (), + root_element_ (), + root_element_specified_ (false), + skel_type_suffix_ ("_pskel"), + skel_type_suffix_specified_ (false), + skel_file_suffix_ ("-pskel"), + skel_file_suffix_specified_ (false), + impl_type_suffix_ ("_pimpl"), + impl_type_suffix_specified_ (false), + impl_file_suffix_ ("-pimpl"), + impl_file_suffix_specified_ (false) + { + _parse (s, opt, arg); + } + + ::cli::usage_para options:: + print_usage (::std::wostream& os, ::cli::usage_para p) + { + CLI_POTENTIALLY_UNUSED (os); + + if (p == ::cli::usage_para::text) + os << ::std::endl; + + os << "--type-map <mapfile> Read XML Schema to C++ type mapping information" << ::std::endl + << " from <mapfile>." << ::std::endl; + + os << "--xml-parser <parser> Use <parser> as the underlying XML parser." << ::std::endl; + + os << "--generate-validation Generate validation code." << ::std::endl; + + os << "--suppress-validation Suppress the generation of validation code." << ::std::endl; + + os << "--generate-polymorphic Generate polymorphism-aware code." << ::std::endl; + + os << "--generate-noop-impl Generate a sample parser implementation that does" << ::std::endl + << " nothing (no operation)." << ::std::endl; + + os << "--generate-print-impl Generate a sample parser implementation that" << ::std::endl + << " prints the XML data to STDOUT." << ::std::endl; + + os << "--generate-test-driver Generate a test driver for the sample parser" << ::std::endl + << " implementation." << ::std::endl; + + os << "--force-overwrite Force overwriting of the existing implementation" << ::std::endl + << " and test driver files." << ::std::endl; + + os << "--root-element-first Indicate that the first global element is the" << ::std::endl + << " document root." << ::std::endl; + + os << "--root-element-last Indicate that the last global element is the" << ::std::endl + << " document root." << ::std::endl; + + os << "--root-element <element> Indicate that <element> is the document root." << ::std::endl; + + os << "--skel-type-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " _pskel to construct the names of the generated" << ::std::endl + << " parser skeletons." << ::std::endl; + + os << "--skel-file-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " -pskel to construct the names of the generated" << ::std::endl + << " parser skeleton files." << ::std::endl; + + os << "--impl-type-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " _pimpl to construct the names of the parser" << ::std::endl + << " implementations for the built-in XML Schema types" << ::std::endl + << " as well as sample parser implementations." << ::std::endl; + + os << "--impl-file-suffix <suffix> Use the provided <suffix> instead of the default" << ::std::endl + << " -pimpl to construct the names of the generated" << ::std::endl + << " sample parser implementation files." << ::std::endl; + + p = ::cli::usage_para::option; + + return p; + } + + typedef + std::map<std::string, void (*) (options&, ::cli::scanner&)> + _cli_options_map; + + static _cli_options_map _cli_options_map_; + + struct _cli_options_map_init + { + _cli_options_map_init () + { + _cli_options_map_["--type-map"] = + &::cli::thunk< options, NarrowStrings, &options::type_map_, + &options::type_map_specified_ >; + _cli_options_map_["--xml-parser"] = + &::cli::thunk< options, NarrowString, &options::xml_parser_, + &options::xml_parser_specified_ >; + _cli_options_map_["--generate-validation"] = + &::cli::thunk< options, &options::generate_validation_ >; + _cli_options_map_["--suppress-validation"] = + &::cli::thunk< options, &options::suppress_validation_ >; + _cli_options_map_["--generate-polymorphic"] = + &::cli::thunk< options, &options::generate_polymorphic_ >; + _cli_options_map_["--generate-noop-impl"] = + &::cli::thunk< options, &options::generate_noop_impl_ >; + _cli_options_map_["--generate-print-impl"] = + &::cli::thunk< options, &options::generate_print_impl_ >; + _cli_options_map_["--generate-test-driver"] = + &::cli::thunk< options, &options::generate_test_driver_ >; + _cli_options_map_["--force-overwrite"] = + &::cli::thunk< options, &options::force_overwrite_ >; + _cli_options_map_["--root-element-first"] = + &::cli::thunk< options, &options::root_element_first_ >; + _cli_options_map_["--root-element-last"] = + &::cli::thunk< options, &options::root_element_last_ >; + _cli_options_map_["--root-element"] = + &::cli::thunk< options, NarrowString, &options::root_element_, + &options::root_element_specified_ >; + _cli_options_map_["--skel-type-suffix"] = + &::cli::thunk< options, NarrowString, &options::skel_type_suffix_, + &options::skel_type_suffix_specified_ >; + _cli_options_map_["--skel-file-suffix"] = + &::cli::thunk< options, NarrowString, &options::skel_file_suffix_, + &options::skel_file_suffix_specified_ >; + _cli_options_map_["--impl-type-suffix"] = + &::cli::thunk< options, NarrowString, &options::impl_type_suffix_, + &options::impl_type_suffix_specified_ >; + _cli_options_map_["--impl-file-suffix"] = + &::cli::thunk< options, NarrowString, &options::impl_file_suffix_, + &options::impl_file_suffix_specified_ >; + } + }; + + static _cli_options_map_init _cli_options_map_init_; + + bool options:: + _parse (const char* o, ::cli::scanner& s) + { + _cli_options_map::const_iterator i (_cli_options_map_.find (o)); + + if (i != _cli_options_map_.end ()) + { + (*(i->second)) (*this, s); + return true; + } + + // options base + // + if (::CXX::options::_parse (o, s)) + return true; + + return false; + } + + bool options:: + _parse (::cli::scanner& s, + ::cli::unknown_mode opt_mode, + ::cli::unknown_mode arg_mode) + { + // Can't skip combined flags (--no-combined-flags). + // + assert (opt_mode != ::cli::unknown_mode::skip); + + bool r = false; + bool opt = true; + + while (s.more ()) + { + const char* o = s.peek (); + + if (std::strcmp (o, "--") == 0) + { + opt = false; + s.skip (); + r = true; + continue; + } + + if (opt) + { + if (_parse (o, s)) + { + r = true; + continue; + } + + if (std::strncmp (o, "-", 1) == 0 && o[1] != '\0') + { + // Handle combined option values. + // + std::string co; + if (const char* v = std::strchr (o, '=')) + { + co.assign (o, 0, v - o); + ++v; + + int ac (2); + char* av[] = + { + const_cast<char*> (co.c_str ()), + const_cast<char*> (v) + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (_parse (co.c_str (), ns)) + { + // Parsed the option but not its value? + // + if (ns.end () != 2) + throw ::cli::invalid_value (co, v); + + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = co.c_str (); + } + } + + // Handle combined flags. + // + char cf[3]; + { + const char* p = o + 1; + for (; *p != '\0'; ++p) + { + if (!((*p >= 'a' && *p <= 'z') || + (*p >= 'A' && *p <= 'Z') || + (*p >= '0' && *p <= '9'))) + break; + } + + if (*p == '\0') + { + for (p = o + 1; *p != '\0'; ++p) + { + std::strcpy (cf, "-"); + cf[1] = *p; + cf[2] = '\0'; + + int ac (1); + char* av[] = + { + cf + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (!_parse (cf, ns)) + break; + } + + if (*p == '\0') + { + // All handled. + // + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = cf; + } + } + } + + switch (opt_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_option (o); + } + } + + break; + } + } + + switch (arg_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_argument (o); + } + } + + break; + } + + return r; + } + } +} + +// Begin epilogue. +// +// +// End epilogue. + diff --git a/xsd/xsd/pregenerated/xsd/cxx/parser/options.hxx b/xsd/xsd/pregenerated/xsd/cxx/parser/options.hxx new file mode 100644 index 0000000..03b67fd --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/parser/options.hxx @@ -0,0 +1,186 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef XSD_CXX_PARSER_OPTIONS_HXX +#define XSD_CXX_PARSER_OPTIONS_HXX + +// Begin prologue. +// +// +// End prologue. + +#include <cstddef> + +#include <xsd/types.hxx> + +#include <xsd/cxx/options.hxx> + +namespace CXX +{ + namespace Parser + { + class options: public ::CXX::options + { + public: + options (); + + options (int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (::cli::scanner&, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + // Option accessors. + // + const NarrowStrings& + type_map () const; + + bool + type_map_specified () const; + + const NarrowString& + xml_parser () const; + + bool + xml_parser_specified () const; + + const bool& + generate_validation () const; + + const bool& + suppress_validation () const; + + const bool& + generate_polymorphic () const; + + const bool& + generate_noop_impl () const; + + const bool& + generate_print_impl () const; + + const bool& + generate_test_driver () const; + + const bool& + force_overwrite () const; + + const bool& + root_element_first () const; + + const bool& + root_element_last () const; + + const NarrowString& + root_element () const; + + bool + root_element_specified () const; + + const NarrowString& + skel_type_suffix () const; + + bool + skel_type_suffix_specified () const; + + const NarrowString& + skel_file_suffix () const; + + bool + skel_file_suffix_specified () const; + + const NarrowString& + impl_type_suffix () const; + + bool + impl_type_suffix_specified () const; + + const NarrowString& + impl_file_suffix () const; + + bool + impl_file_suffix_specified () const; + + // Print usage information. + // + static ::cli::usage_para + print_usage (::std::wostream&, + ::cli::usage_para = ::cli::usage_para::none); + + // Implementation details. + // + protected: + bool + _parse (const char*, ::cli::scanner&); + + private: + bool + _parse (::cli::scanner&, + ::cli::unknown_mode option, + ::cli::unknown_mode argument); + + public: + NarrowStrings type_map_; + bool type_map_specified_; + NarrowString xml_parser_; + bool xml_parser_specified_; + bool generate_validation_; + bool suppress_validation_; + bool generate_polymorphic_; + bool generate_noop_impl_; + bool generate_print_impl_; + bool generate_test_driver_; + bool force_overwrite_; + bool root_element_first_; + bool root_element_last_; + NarrowString root_element_; + bool root_element_specified_; + NarrowString skel_type_suffix_; + bool skel_type_suffix_specified_; + NarrowString skel_file_suffix_; + bool skel_file_suffix_specified_; + NarrowString impl_type_suffix_; + bool impl_type_suffix_specified_; + NarrowString impl_file_suffix_; + bool impl_file_suffix_specified_; + }; + } +} + +#include <xsd/cxx/parser/options.ixx> + +// Begin epilogue. +// +// +// End epilogue. + +#endif // XSD_CXX_PARSER_OPTIONS_HXX diff --git a/xsd/xsd/pregenerated/xsd/cxx/parser/options.ixx b/xsd/xsd/pregenerated/xsd/cxx/parser/options.ixx new file mode 100644 index 0000000..64c00c5 --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/parser/options.ixx @@ -0,0 +1,162 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +// +// End prologue. + +namespace CXX +{ + namespace Parser + { + // options + // + + inline const NarrowStrings& options:: + type_map () const + { + return this->type_map_; + } + + inline bool options:: + type_map_specified () const + { + return this->type_map_specified_; + } + + inline const NarrowString& options:: + xml_parser () const + { + return this->xml_parser_; + } + + inline bool options:: + xml_parser_specified () const + { + return this->xml_parser_specified_; + } + + inline const bool& options:: + generate_validation () const + { + return this->generate_validation_; + } + + inline const bool& options:: + suppress_validation () const + { + return this->suppress_validation_; + } + + inline const bool& options:: + generate_polymorphic () const + { + return this->generate_polymorphic_; + } + + inline const bool& options:: + generate_noop_impl () const + { + return this->generate_noop_impl_; + } + + inline const bool& options:: + generate_print_impl () const + { + return this->generate_print_impl_; + } + + inline const bool& options:: + generate_test_driver () const + { + return this->generate_test_driver_; + } + + inline const bool& options:: + force_overwrite () const + { + return this->force_overwrite_; + } + + inline const bool& options:: + root_element_first () const + { + return this->root_element_first_; + } + + inline const bool& options:: + root_element_last () const + { + return this->root_element_last_; + } + + inline const NarrowString& options:: + root_element () const + { + return this->root_element_; + } + + inline bool options:: + root_element_specified () const + { + return this->root_element_specified_; + } + + inline const NarrowString& options:: + skel_type_suffix () const + { + return this->skel_type_suffix_; + } + + inline bool options:: + skel_type_suffix_specified () const + { + return this->skel_type_suffix_specified_; + } + + inline const NarrowString& options:: + skel_file_suffix () const + { + return this->skel_file_suffix_; + } + + inline bool options:: + skel_file_suffix_specified () const + { + return this->skel_file_suffix_specified_; + } + + inline const NarrowString& options:: + impl_type_suffix () const + { + return this->impl_type_suffix_; + } + + inline bool options:: + impl_type_suffix_specified () const + { + return this->impl_type_suffix_specified_; + } + + inline const NarrowString& options:: + impl_file_suffix () const + { + return this->impl_file_suffix_; + } + + inline bool options:: + impl_file_suffix_specified () const + { + return this->impl_file_suffix_specified_; + } + } +} + +// Begin epilogue. +// +// +// End epilogue. diff --git a/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx new file mode 100644 index 0000000..17214c1 --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/tree/options.cxx @@ -0,0 +1,1343 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +#include <xsd/options-parser.hxx> +// +// End prologue. + +#include <xsd/cxx/tree/options.hxx> + +#include <map> +#include <set> +#include <string> +#include <vector> +#include <utility> +#include <ostream> +#include <sstream> +#include <cstring> + +namespace cli +{ + template <typename X> + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + using namespace std; + + const char* o (s.next ()); + if (s.more ()) + { + string v (s.next ()); + istringstream is (v); + if (!(is >> x && is.peek () == istringstream::traits_type::eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<bool> + { + static void + parse (bool& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + + if (std::strcmp (v, "1") == 0 || + std::strcmp (v, "true") == 0 || + std::strcmp (v, "TRUE") == 0 || + std::strcmp (v, "True") == 0) + x = true; + else if (std::strcmp (v, "0") == 0 || + std::strcmp (v, "false") == 0 || + std::strcmp (v, "FALSE") == 0 || + std::strcmp (v, "False") == 0) + x = false; + else + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser<std::string> + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X> + struct parser<std::pair<X, std::size_t> > + { + static void + parse (std::pair<X, std::size_t>& x, bool& xs, scanner& s) + { + x.second = s.position (); + parser<X>::parse (x.first, xs, s); + } + }; + + template <typename X> + struct parser<std::vector<X> > + { + static void + parse (std::vector<X>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.push_back (x); + xs = true; + } + }; + + template <typename X, typename C> + struct parser<std::set<X, C> > + { + static void + parse (std::set<X, C>& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser<X>::parse (x, dummy, s); + c.insert (x); + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::map<K, V, C> > + { + static void + parse (std::map<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m[k] = v; + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename K, typename V, typename C> + struct parser<std::multimap<K, V, C> > + { + static void + parse (std::multimap<K, V, C>& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::size_t pos (s.position ()); + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ())); + + int ac (2); + char* av[] = + { + const_cast<char*> (o), + 0 + }; + + bool dummy; + if (!kstr.empty ()) + { + av[1] = const_cast<char*> (kstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<K>::parse (k, dummy, s); + } + + if (!vstr.empty ()) + { + av[1] = const_cast<char*> (vstr.c_str ()); + argv_scanner s (0, ac, av, false, pos); + parser<V>::parse (v, dummy, s); + } + + m.insert (typename std::multimap<K, V, C>::value_type (k, v)); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <typename X, typename T, T X::*M> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, s); + } + + template <typename X, bool X::*M> + void + thunk (X& x, scanner& s) + { + s.next (); + x.*M = true; + } + + template <typename X, typename T, T X::*M, bool X::*S> + void + thunk (X& x, scanner& s) + { + parser<T>::parse (x.*M, x.*S, s); + } +} + +#include <map> + +namespace CXX +{ + namespace Tree + { + // options + // + + options:: + options () + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + } + + options:: + options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + } + + options:: + options (int start, + int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + } + + options:: + options (int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + options:: + options (int start, + int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + options:: + options (::cli::scanner& s, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : generate_polymorphic_ (), + polymorphic_type_ (), + polymorphic_type_specified_ (false), + polymorphic_type_all_ (), + polymorphic_plate_ (0), + polymorphic_plate_specified_ (false), + ordered_type_ (), + ordered_type_specified_ (false), + ordered_type_derived_ (), + ordered_type_mixed_ (), + ordered_type_all_ (), + order_container_ (), + order_container_specified_ (false), + generate_serialization_ (), + generate_ostream_ (), + generate_doxygen_ (), + generate_comparison_ (), + generate_default_ctor_ (), + generate_from_base_ctor_ (), + suppress_assignment_ (), + generate_detach_ (), + generate_wildcard_ (), + generate_any_type_ (), + generate_insertion_ (), + generate_insertion_specified_ (false), + generate_extraction_ (), + generate_extraction_specified_ (false), + generate_forward_ (), + suppress_parsing_ (), + generate_element_type_ (), + generate_element_map_ (), + generate_intellisense_ (), + omit_default_attributes_ (), + type_naming_ ("knr"), + type_naming_specified_ (false), + function_naming_ ("knr"), + function_naming_specified_ (false), + type_regex_ (), + type_regex_specified_ (false), + accessor_regex_ (), + accessor_regex_specified_ (false), + one_accessor_regex_ (), + one_accessor_regex_specified_ (false), + opt_accessor_regex_ (), + opt_accessor_regex_specified_ (false), + seq_accessor_regex_ (), + seq_accessor_regex_specified_ (false), + modifier_regex_ (), + modifier_regex_specified_ (false), + one_modifier_regex_ (), + one_modifier_regex_specified_ (false), + opt_modifier_regex_ (), + opt_modifier_regex_specified_ (false), + seq_modifier_regex_ (), + seq_modifier_regex_specified_ (false), + parser_regex_ (), + parser_regex_specified_ (false), + serializer_regex_ (), + serializer_regex_specified_ (false), + const_regex_ (), + const_regex_specified_ (false), + enumerator_regex_ (), + enumerator_regex_specified_ (false), + element_type_regex_ (), + element_type_regex_specified_ (false), + name_regex_trace_ (), + root_element_first_ (), + root_element_last_ (), + root_element_all_ (), + root_element_none_ (), + root_element_ (), + root_element_specified_ (false), + custom_type_ (), + custom_type_specified_ (false), + custom_type_regex_ (), + custom_type_regex_specified_ (false), + parts_ (1), + parts_specified_ (false), + parts_suffix_ ("-"), + parts_suffix_specified_ (false) + { + _parse (s, opt, arg); + } + + ::cli::usage_para options:: + print_usage (::std::wostream& os, ::cli::usage_para p) + { + CLI_POTENTIALLY_UNUSED (os); + + if (p == ::cli::usage_para::text) + os << ::std::endl; + + os << "--generate-polymorphic Generate polymorphism-aware code." << ::std::endl; + + os << "--polymorphic-type <type> Indicate that <type> is a root of a polymorphic" << ::std::endl + << " type hierarchy." << ::std::endl; + + os << "--polymorphic-type-all Indicate that all types should be treated as" << ::std::endl + << " polymorphic." << ::std::endl; + + os << "--polymorphic-plate <num> Specify the polymorphic map plate the generated" << ::std::endl + << " code should register on." << ::std::endl; + + os << "--ordered-type <type> Indicate that element order in <type> is" << ::std::endl + << " significant." << ::std::endl; + + os << "--ordered-type-derived Automatically treat types derived from ordered" << ::std::endl + << " bases as also ordered." << ::std::endl; + + os << "--ordered-type-mixed Automatically treat complex types with mixed" << ::std::endl + << " content as ordered." << ::std::endl; + + os << "--ordered-type-all Indicate that element order in all types is" << ::std::endl + << " significant." << ::std::endl; + + os << "--order-container <type> Specify a custom class template that should be" << ::std::endl + << " used as a container for the content order in" << ::std::endl + << " ordered types instead of the default std::vector." << ::std::endl; + + os << "--generate-serialization Generate serialization functions." << ::std::endl; + + os << "--generate-ostream Generate ostream insertion operators (operator<<)" << ::std::endl + << " for generated types." << ::std::endl; + + os << "--generate-doxygen Generate documentation comments suitable for" << ::std::endl + << " extraction by the Doxygen documentation system." << ::std::endl; + + os << "--generate-comparison Generate comparison operators (operator== and" << ::std::endl + << " operator!=) for complex types." << ::std::endl; + + os << "--generate-default-ctor Generate default constructors even for types that" << ::std::endl + << " have required members." << ::std::endl; + + os << "--generate-from-base-ctor Generate constructors that expect an instance of a" << ::std::endl + << " base type followed by all required members." << ::std::endl; + + os << "--suppress-assignment Suppress the generation of copy assignment" << ::std::endl + << " operators for complex types." << ::std::endl; + + os << "--generate-detach Generate detach functions for required elements" << ::std::endl + << " and attributes." << ::std::endl; + + os << "--generate-wildcard Generate accessors and modifiers as well as" << ::std::endl + << " parsing and serialization code for XML Schema" << ::std::endl + << " wildcards (any and anyAttribute)." << ::std::endl; + + os << "--generate-any-type Extract and store content of the XML Schema" << ::std::endl + << " anyType type as a DOM fragment." << ::std::endl; + + os << "--generate-insertion <os> Generate data representation stream insertion" << ::std::endl + << " operators for the <os> output stream type." << ::std::endl; + + os << "--generate-extraction <is> Generate data representation stream extraction" << ::std::endl + << " constructors for the <is> input stream type." << ::std::endl; + + os << "--generate-forward Generate a separate header file with forward" << ::std::endl + << " declarations for the types being generated." << ::std::endl; + + os << "--suppress-parsing Suppress the generation of the parsing functions" << ::std::endl + << " and constructors." << ::std::endl; + + os << "--generate-element-type Generate types instead of parsing and" << ::std::endl + << " serialization functions for root elements." << ::std::endl; + + os << "--generate-element-map Generate a root element map that allows uniform" << ::std::endl + << " parsing and serialization of multiple root" << ::std::endl + << " elements." << ::std::endl; + + os << "--generate-intellisense Generate workarounds for IntelliSense bugs in" << ::std::endl + << " Visual Studio 2005 (8.0)." << ::std::endl; + + os << "--omit-default-attributes Omit attributes with default and fixed values from" << ::std::endl + << " serialized XML documents." << ::std::endl; + + os << "--type-naming <style> Specify the type naming convention that should be" << ::std::endl + << " used in the generated code." << ::std::endl; + + os << "--function-naming <style> Specify the function naming convention that should" << ::std::endl + << " be used in the generated code." << ::std::endl; + + os << "--type-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema type names to C++" << ::std::endl + << " type names." << ::std::endl; + + os << "--accessor-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes to C++ accessor function" << ::std::endl + << " names." << ::std::endl; + + os << "--one-accessor-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality one to C++" << ::std::endl + << " accessor function names." << ::std::endl; + + os << "--opt-accessor-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality optional to" << ::std::endl + << " C++ accessor function names." << ::std::endl; + + os << "--seq-accessor-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality sequence to" << ::std::endl + << " C++ accessor function names." << ::std::endl; + + os << "--modifier-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes to C++ modifier function" << ::std::endl + << " names." << ::std::endl; + + os << "--one-modifier-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality one to C++" << ::std::endl + << " modifier function names." << ::std::endl; + + os << "--opt-modifier-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality optional to" << ::std::endl + << " C++ modifier function names." << ::std::endl; + + os << "--seq-modifier-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema names of" << ::std::endl + << " elements/attributes with cardinality sequence to" << ::std::endl + << " C++ modifier function names." << ::std::endl; + + os << "--parser-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema element names to C++" << ::std::endl + << " parsing function names." << ::std::endl; + + os << "--serializer-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema element names to C++" << ::std::endl + << " serialization function names." << ::std::endl; + + os << "--const-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema-derived names to C++" << ::std::endl + << " constant names." << ::std::endl; + + os << "--enumerator-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema enumeration values to" << ::std::endl + << " C++ enumerator names." << ::std::endl; + + os << "--element-type-regex <regex> Add <regex> to the list of regular expressions" << ::std::endl + << " used to translate XML Schema element names to C++" << ::std::endl + << " element type names." << ::std::endl; + + os << "--name-regex-trace Trace the process of applying regular expressions" << ::std::endl + << " specified with the name transformation options." << ::std::endl; + + os << "--root-element-first Treat only the first global element as a document" << ::std::endl + << " root." << ::std::endl; + + os << "--root-element-last Treat only the last global element as a document" << ::std::endl + << " root." << ::std::endl; + + os << "--root-element-all Treat all global elements as document roots." << ::std::endl; + + os << "--root-element-none Do not treat any global elements as document" << ::std::endl + << " roots." << ::std::endl; + + os << "--root-element <element> Treat only <element> as a document root." << ::std::endl; + + os << "--custom-type <map> Use a custom C++ type instead of the generated" << ::std::endl + << " class." << ::std::endl; + + os << "--custom-type-regex <regex> Use custom C++ types instead of the generated" << ::std::endl + << " classes." << ::std::endl; + + os << "--parts <num> Split generated source code into <num> parts." << ::std::endl; + + os << "--parts-suffix <suffix> Use <suffix> instead of the default '-' to" << ::std::endl + << " separate the file name from the part number." << ::std::endl; + + p = ::cli::usage_para::option; + + return p; + } + + typedef + std::map<std::string, void (*) (options&, ::cli::scanner&)> + _cli_options_map; + + static _cli_options_map _cli_options_map_; + + struct _cli_options_map_init + { + _cli_options_map_init () + { + _cli_options_map_["--generate-polymorphic"] = + &::cli::thunk< options, &options::generate_polymorphic_ >; + _cli_options_map_["--polymorphic-type"] = + &::cli::thunk< options, NarrowStrings, &options::polymorphic_type_, + &options::polymorphic_type_specified_ >; + _cli_options_map_["--polymorphic-type-all"] = + &::cli::thunk< options, &options::polymorphic_type_all_ >; + _cli_options_map_["--polymorphic-plate"] = + &::cli::thunk< options, unsigned long, &options::polymorphic_plate_, + &options::polymorphic_plate_specified_ >; + _cli_options_map_["--ordered-type"] = + &::cli::thunk< options, NarrowStrings, &options::ordered_type_, + &options::ordered_type_specified_ >; + _cli_options_map_["--ordered-type-derived"] = + &::cli::thunk< options, &options::ordered_type_derived_ >; + _cli_options_map_["--ordered-type-mixed"] = + &::cli::thunk< options, &options::ordered_type_mixed_ >; + _cli_options_map_["--ordered-type-all"] = + &::cli::thunk< options, &options::ordered_type_all_ >; + _cli_options_map_["--order-container"] = + &::cli::thunk< options, NarrowString, &options::order_container_, + &options::order_container_specified_ >; + _cli_options_map_["--generate-serialization"] = + &::cli::thunk< options, &options::generate_serialization_ >; + _cli_options_map_["--generate-ostream"] = + &::cli::thunk< options, &options::generate_ostream_ >; + _cli_options_map_["--generate-doxygen"] = + &::cli::thunk< options, &options::generate_doxygen_ >; + _cli_options_map_["--generate-comparison"] = + &::cli::thunk< options, &options::generate_comparison_ >; + _cli_options_map_["--generate-default-ctor"] = + &::cli::thunk< options, &options::generate_default_ctor_ >; + _cli_options_map_["--generate-from-base-ctor"] = + &::cli::thunk< options, &options::generate_from_base_ctor_ >; + _cli_options_map_["--suppress-assignment"] = + &::cli::thunk< options, &options::suppress_assignment_ >; + _cli_options_map_["--generate-detach"] = + &::cli::thunk< options, &options::generate_detach_ >; + _cli_options_map_["--generate-wildcard"] = + &::cli::thunk< options, &options::generate_wildcard_ >; + _cli_options_map_["--generate-any-type"] = + &::cli::thunk< options, &options::generate_any_type_ >; + _cli_options_map_["--generate-insertion"] = + &::cli::thunk< options, NarrowStrings, &options::generate_insertion_, + &options::generate_insertion_specified_ >; + _cli_options_map_["--generate-extraction"] = + &::cli::thunk< options, NarrowStrings, &options::generate_extraction_, + &options::generate_extraction_specified_ >; + _cli_options_map_["--generate-forward"] = + &::cli::thunk< options, &options::generate_forward_ >; + _cli_options_map_["--suppress-parsing"] = + &::cli::thunk< options, &options::suppress_parsing_ >; + _cli_options_map_["--generate-element-type"] = + &::cli::thunk< options, &options::generate_element_type_ >; + _cli_options_map_["--generate-element-map"] = + &::cli::thunk< options, &options::generate_element_map_ >; + _cli_options_map_["--generate-intellisense"] = + &::cli::thunk< options, &options::generate_intellisense_ >; + _cli_options_map_["--omit-default-attributes"] = + &::cli::thunk< options, &options::omit_default_attributes_ >; + _cli_options_map_["--type-naming"] = + &::cli::thunk< options, NarrowString, &options::type_naming_, + &options::type_naming_specified_ >; + _cli_options_map_["--function-naming"] = + &::cli::thunk< options, NarrowString, &options::function_naming_, + &options::function_naming_specified_ >; + _cli_options_map_["--type-regex"] = + &::cli::thunk< options, NarrowStrings, &options::type_regex_, + &options::type_regex_specified_ >; + _cli_options_map_["--accessor-regex"] = + &::cli::thunk< options, NarrowStrings, &options::accessor_regex_, + &options::accessor_regex_specified_ >; + _cli_options_map_["--one-accessor-regex"] = + &::cli::thunk< options, NarrowStrings, &options::one_accessor_regex_, + &options::one_accessor_regex_specified_ >; + _cli_options_map_["--opt-accessor-regex"] = + &::cli::thunk< options, NarrowStrings, &options::opt_accessor_regex_, + &options::opt_accessor_regex_specified_ >; + _cli_options_map_["--seq-accessor-regex"] = + &::cli::thunk< options, NarrowStrings, &options::seq_accessor_regex_, + &options::seq_accessor_regex_specified_ >; + _cli_options_map_["--modifier-regex"] = + &::cli::thunk< options, NarrowStrings, &options::modifier_regex_, + &options::modifier_regex_specified_ >; + _cli_options_map_["--one-modifier-regex"] = + &::cli::thunk< options, NarrowStrings, &options::one_modifier_regex_, + &options::one_modifier_regex_specified_ >; + _cli_options_map_["--opt-modifier-regex"] = + &::cli::thunk< options, NarrowStrings, &options::opt_modifier_regex_, + &options::opt_modifier_regex_specified_ >; + _cli_options_map_["--seq-modifier-regex"] = + &::cli::thunk< options, NarrowStrings, &options::seq_modifier_regex_, + &options::seq_modifier_regex_specified_ >; + _cli_options_map_["--parser-regex"] = + &::cli::thunk< options, NarrowStrings, &options::parser_regex_, + &options::parser_regex_specified_ >; + _cli_options_map_["--serializer-regex"] = + &::cli::thunk< options, NarrowStrings, &options::serializer_regex_, + &options::serializer_regex_specified_ >; + _cli_options_map_["--const-regex"] = + &::cli::thunk< options, NarrowStrings, &options::const_regex_, + &options::const_regex_specified_ >; + _cli_options_map_["--enumerator-regex"] = + &::cli::thunk< options, NarrowStrings, &options::enumerator_regex_, + &options::enumerator_regex_specified_ >; + _cli_options_map_["--element-type-regex"] = + &::cli::thunk< options, NarrowStrings, &options::element_type_regex_, + &options::element_type_regex_specified_ >; + _cli_options_map_["--name-regex-trace"] = + &::cli::thunk< options, &options::name_regex_trace_ >; + _cli_options_map_["--root-element-first"] = + &::cli::thunk< options, &options::root_element_first_ >; + _cli_options_map_["--root-element-last"] = + &::cli::thunk< options, &options::root_element_last_ >; + _cli_options_map_["--root-element-all"] = + &::cli::thunk< options, &options::root_element_all_ >; + _cli_options_map_["--root-element-none"] = + &::cli::thunk< options, &options::root_element_none_ >; + _cli_options_map_["--root-element"] = + &::cli::thunk< options, NarrowStrings, &options::root_element_, + &options::root_element_specified_ >; + _cli_options_map_["--custom-type"] = + &::cli::thunk< options, NarrowStrings, &options::custom_type_, + &options::custom_type_specified_ >; + _cli_options_map_["--custom-type-regex"] = + &::cli::thunk< options, NarrowStrings, &options::custom_type_regex_, + &options::custom_type_regex_specified_ >; + _cli_options_map_["--parts"] = + &::cli::thunk< options, std::size_t, &options::parts_, + &options::parts_specified_ >; + _cli_options_map_["--parts-suffix"] = + &::cli::thunk< options, NarrowString, &options::parts_suffix_, + &options::parts_suffix_specified_ >; + } + }; + + static _cli_options_map_init _cli_options_map_init_; + + bool options:: + _parse (const char* o, ::cli::scanner& s) + { + _cli_options_map::const_iterator i (_cli_options_map_.find (o)); + + if (i != _cli_options_map_.end ()) + { + (*(i->second)) (*this, s); + return true; + } + + // options base + // + if (::CXX::options::_parse (o, s)) + return true; + + return false; + } + + bool options:: + _parse (::cli::scanner& s, + ::cli::unknown_mode opt_mode, + ::cli::unknown_mode arg_mode) + { + // Can't skip combined flags (--no-combined-flags). + // + assert (opt_mode != ::cli::unknown_mode::skip); + + bool r = false; + bool opt = true; + + while (s.more ()) + { + const char* o = s.peek (); + + if (std::strcmp (o, "--") == 0) + { + opt = false; + s.skip (); + r = true; + continue; + } + + if (opt) + { + if (_parse (o, s)) + { + r = true; + continue; + } + + if (std::strncmp (o, "-", 1) == 0 && o[1] != '\0') + { + // Handle combined option values. + // + std::string co; + if (const char* v = std::strchr (o, '=')) + { + co.assign (o, 0, v - o); + ++v; + + int ac (2); + char* av[] = + { + const_cast<char*> (co.c_str ()), + const_cast<char*> (v) + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (_parse (co.c_str (), ns)) + { + // Parsed the option but not its value? + // + if (ns.end () != 2) + throw ::cli::invalid_value (co, v); + + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = co.c_str (); + } + } + + // Handle combined flags. + // + char cf[3]; + { + const char* p = o + 1; + for (; *p != '\0'; ++p) + { + if (!((*p >= 'a' && *p <= 'z') || + (*p >= 'A' && *p <= 'Z') || + (*p >= '0' && *p <= '9'))) + break; + } + + if (*p == '\0') + { + for (p = o + 1; *p != '\0'; ++p) + { + std::strcpy (cf, "-"); + cf[1] = *p; + cf[2] = '\0'; + + int ac (1); + char* av[] = + { + cf + }; + + ::cli::argv_scanner ns (0, ac, av); + + if (!_parse (cf, ns)) + break; + } + + if (*p == '\0') + { + // All handled. + // + s.next (); + r = true; + continue; + } + else + { + // Set the unknown option and fall through. + // + o = cf; + } + } + } + + switch (opt_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_option (o); + } + } + + break; + } + } + + switch (arg_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + r = true; + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_argument (o); + } + } + + break; + } + + return r; + } + } +} + +// Begin epilogue. +// +// +// End epilogue. + diff --git a/xsd/xsd/pregenerated/xsd/cxx/tree/options.hxx b/xsd/xsd/pregenerated/xsd/cxx/tree/options.hxx new file mode 100644 index 0000000..f5a808c --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/tree/options.hxx @@ -0,0 +1,414 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef XSD_CXX_TREE_OPTIONS_HXX +#define XSD_CXX_TREE_OPTIONS_HXX + +// Begin prologue. +// +// +// End prologue. + +#include <cstddef> + +#include <xsd/types.hxx> + +#include <xsd/cxx/options.hxx> + +namespace CXX +{ + namespace Tree + { + class options: public ::CXX::options + { + public: + options (); + + options (int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + options (::cli::scanner&, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + // Option accessors. + // + const bool& + generate_polymorphic () const; + + const NarrowStrings& + polymorphic_type () const; + + bool + polymorphic_type_specified () const; + + const bool& + polymorphic_type_all () const; + + const unsigned long& + polymorphic_plate () const; + + bool + polymorphic_plate_specified () const; + + const NarrowStrings& + ordered_type () const; + + bool + ordered_type_specified () const; + + const bool& + ordered_type_derived () const; + + const bool& + ordered_type_mixed () const; + + const bool& + ordered_type_all () const; + + const NarrowString& + order_container () const; + + bool + order_container_specified () const; + + const bool& + generate_serialization () const; + + const bool& + generate_ostream () const; + + const bool& + generate_doxygen () const; + + const bool& + generate_comparison () const; + + const bool& + generate_default_ctor () const; + + const bool& + generate_from_base_ctor () const; + + const bool& + suppress_assignment () const; + + const bool& + generate_detach () const; + + const bool& + generate_wildcard () const; + + const bool& + generate_any_type () const; + + const NarrowStrings& + generate_insertion () const; + + bool + generate_insertion_specified () const; + + const NarrowStrings& + generate_extraction () const; + + bool + generate_extraction_specified () const; + + const bool& + generate_forward () const; + + const bool& + suppress_parsing () const; + + const bool& + generate_element_type () const; + + const bool& + generate_element_map () const; + + const bool& + generate_intellisense () const; + + const bool& + omit_default_attributes () const; + + const NarrowString& + type_naming () const; + + bool + type_naming_specified () const; + + const NarrowString& + function_naming () const; + + bool + function_naming_specified () const; + + const NarrowStrings& + type_regex () const; + + bool + type_regex_specified () const; + + const NarrowStrings& + accessor_regex () const; + + bool + accessor_regex_specified () const; + + const NarrowStrings& + one_accessor_regex () const; + + bool + one_accessor_regex_specified () const; + + const NarrowStrings& + opt_accessor_regex () const; + + bool + opt_accessor_regex_specified () const; + + const NarrowStrings& + seq_accessor_regex () const; + + bool + seq_accessor_regex_specified () const; + + const NarrowStrings& + modifier_regex () const; + + bool + modifier_regex_specified () const; + + const NarrowStrings& + one_modifier_regex () const; + + bool + one_modifier_regex_specified () const; + + const NarrowStrings& + opt_modifier_regex () const; + + bool + opt_modifier_regex_specified () const; + + const NarrowStrings& + seq_modifier_regex () const; + + bool + seq_modifier_regex_specified () const; + + const NarrowStrings& + parser_regex () const; + + bool + parser_regex_specified () const; + + const NarrowStrings& + serializer_regex () const; + + bool + serializer_regex_specified () const; + + const NarrowStrings& + const_regex () const; + + bool + const_regex_specified () const; + + const NarrowStrings& + enumerator_regex () const; + + bool + enumerator_regex_specified () const; + + const NarrowStrings& + element_type_regex () const; + + bool + element_type_regex_specified () const; + + const bool& + name_regex_trace () const; + + const bool& + root_element_first () const; + + const bool& + root_element_last () const; + + const bool& + root_element_all () const; + + const bool& + root_element_none () const; + + const NarrowStrings& + root_element () const; + + bool + root_element_specified () const; + + const NarrowStrings& + custom_type () const; + + bool + custom_type_specified () const; + + const NarrowStrings& + custom_type_regex () const; + + bool + custom_type_regex_specified () const; + + const std::size_t& + parts () const; + + bool + parts_specified () const; + + const NarrowString& + parts_suffix () const; + + bool + parts_suffix_specified () const; + + // Print usage information. + // + static ::cli::usage_para + print_usage (::std::wostream&, + ::cli::usage_para = ::cli::usage_para::none); + + // Implementation details. + // + protected: + bool + _parse (const char*, ::cli::scanner&); + + private: + bool + _parse (::cli::scanner&, + ::cli::unknown_mode option, + ::cli::unknown_mode argument); + + public: + bool generate_polymorphic_; + NarrowStrings polymorphic_type_; + bool polymorphic_type_specified_; + bool polymorphic_type_all_; + unsigned long polymorphic_plate_; + bool polymorphic_plate_specified_; + NarrowStrings ordered_type_; + bool ordered_type_specified_; + bool ordered_type_derived_; + bool ordered_type_mixed_; + bool ordered_type_all_; + NarrowString order_container_; + bool order_container_specified_; + bool generate_serialization_; + bool generate_ostream_; + bool generate_doxygen_; + bool generate_comparison_; + bool generate_default_ctor_; + bool generate_from_base_ctor_; + bool suppress_assignment_; + bool generate_detach_; + bool generate_wildcard_; + bool generate_any_type_; + NarrowStrings generate_insertion_; + bool generate_insertion_specified_; + NarrowStrings generate_extraction_; + bool generate_extraction_specified_; + bool generate_forward_; + bool suppress_parsing_; + bool generate_element_type_; + bool generate_element_map_; + bool generate_intellisense_; + bool omit_default_attributes_; + NarrowString type_naming_; + bool type_naming_specified_; + NarrowString function_naming_; + bool function_naming_specified_; + NarrowStrings type_regex_; + bool type_regex_specified_; + NarrowStrings accessor_regex_; + bool accessor_regex_specified_; + NarrowStrings one_accessor_regex_; + bool one_accessor_regex_specified_; + NarrowStrings opt_accessor_regex_; + bool opt_accessor_regex_specified_; + NarrowStrings seq_accessor_regex_; + bool seq_accessor_regex_specified_; + NarrowStrings modifier_regex_; + bool modifier_regex_specified_; + NarrowStrings one_modifier_regex_; + bool one_modifier_regex_specified_; + NarrowStrings opt_modifier_regex_; + bool opt_modifier_regex_specified_; + NarrowStrings seq_modifier_regex_; + bool seq_modifier_regex_specified_; + NarrowStrings parser_regex_; + bool parser_regex_specified_; + NarrowStrings serializer_regex_; + bool serializer_regex_specified_; + NarrowStrings const_regex_; + bool const_regex_specified_; + NarrowStrings enumerator_regex_; + bool enumerator_regex_specified_; + NarrowStrings element_type_regex_; + bool element_type_regex_specified_; + bool name_regex_trace_; + bool root_element_first_; + bool root_element_last_; + bool root_element_all_; + bool root_element_none_; + NarrowStrings root_element_; + bool root_element_specified_; + NarrowStrings custom_type_; + bool custom_type_specified_; + NarrowStrings custom_type_regex_; + bool custom_type_regex_specified_; + std::size_t parts_; + bool parts_specified_; + NarrowString parts_suffix_; + bool parts_suffix_specified_; + }; + } +} + +#include <xsd/cxx/tree/options.ixx> + +// Begin epilogue. +// +// +// End epilogue. + +#endif // XSD_CXX_TREE_OPTIONS_HXX diff --git a/xsd/xsd/pregenerated/xsd/cxx/tree/options.ixx b/xsd/xsd/pregenerated/xsd/cxx/tree/options.ixx new file mode 100644 index 0000000..4d34fd9 --- /dev/null +++ b/xsd/xsd/pregenerated/xsd/cxx/tree/options.ixx @@ -0,0 +1,504 @@ +// -*- C++ -*- +// +// This file was generated by CLI, a command line interface +// compiler for C++. +// + +// Begin prologue. +// +// +// End prologue. + +namespace CXX +{ + namespace Tree + { + // options + // + + inline const bool& options:: + generate_polymorphic () const + { + return this->generate_polymorphic_; + } + + inline const NarrowStrings& options:: + polymorphic_type () const + { + return this->polymorphic_type_; + } + + inline bool options:: + polymorphic_type_specified () const + { + return this->polymorphic_type_specified_; + } + + inline const bool& options:: + polymorphic_type_all () const + { + return this->polymorphic_type_all_; + } + + inline const unsigned long& options:: + polymorphic_plate () const + { + return this->polymorphic_plate_; + } + + inline bool options:: + polymorphic_plate_specified () const + { + return this->polymorphic_plate_specified_; + } + + inline const NarrowStrings& options:: + ordered_type () const + { + return this->ordered_type_; + } + + inline bool options:: + ordered_type_specified () const + { + return this->ordered_type_specified_; + } + + inline const bool& options:: + ordered_type_derived () const + { + return this->ordered_type_derived_; + } + + inline const bool& options:: + ordered_type_mixed () const + { + return this->ordered_type_mixed_; + } + + inline const bool& options:: + ordered_type_all () const + { + return this->ordered_type_all_; + } + + inline const NarrowString& options:: + order_container () const + { + return this->order_container_; + } + + inline bool options:: + order_container_specified () const + { + return this->order_container_specified_; + } + + inline const bool& options:: + generate_serialization () const + { + return this->generate_serialization_; + } + + inline const bool& options:: + generate_ostream () const + { + return this->generate_ostream_; + } + + inline const bool& options:: + generate_doxygen () const + { + return this->generate_doxygen_; + } + + inline const bool& options:: + generate_comparison () const + { + return this->generate_comparison_; + } + + inline const bool& options:: + generate_default_ctor () const + { + return this->generate_default_ctor_; + } + + inline const bool& options:: + generate_from_base_ctor () const + { + return this->generate_from_base_ctor_; + } + + inline const bool& options:: + suppress_assignment () const + { + return this->suppress_assignment_; + } + + inline const bool& options:: + generate_detach () const + { + return this->generate_detach_; + } + + inline const bool& options:: + generate_wildcard () const + { + return this->generate_wildcard_; + } + + inline const bool& options:: + generate_any_type () const + { + return this->generate_any_type_; + } + + inline const NarrowStrings& options:: + generate_insertion () const + { + return this->generate_insertion_; + } + + inline bool options:: + generate_insertion_specified () const + { + return this->generate_insertion_specified_; + } + + inline const NarrowStrings& options:: + generate_extraction () const + { + return this->generate_extraction_; + } + + inline bool options:: + generate_extraction_specified () const + { + return this->generate_extraction_specified_; + } + + inline const bool& options:: + generate_forward () const + { + return this->generate_forward_; + } + + inline const bool& options:: + suppress_parsing () const + { + return this->suppress_parsing_; + } + + inline const bool& options:: + generate_element_type () const + { + return this->generate_element_type_; + } + + inline const bool& options:: + generate_element_map () const + { + return this->generate_element_map_; + } + + inline const bool& options:: + generate_intellisense () const + { + return this->generate_intellisense_; + } + + inline const bool& options:: + omit_default_attributes () const + { + return this->omit_default_attributes_; + } + + inline const NarrowString& options:: + type_naming () const + { + return this->type_naming_; + } + + inline bool options:: + type_naming_specified () const + { + return this->type_naming_specified_; + } + + inline const NarrowString& options:: + function_naming () const + { + return this->function_naming_; + } + + inline bool options:: + function_naming_specified () const + { + return this->function_naming_specified_; + } + + inline const NarrowStrings& options:: + type_regex () const + { + return this->type_regex_; + } + + inline bool options:: + type_regex_specified () const + { + return this->type_regex_specified_; + } + + inline const NarrowStrings& options:: + accessor_regex () const + { + return this->accessor_regex_; + } + + inline bool options:: + accessor_regex_specified () const + { + return this->accessor_regex_specified_; + } + + inline const NarrowStrings& options:: + one_accessor_regex () const + { + return this->one_accessor_regex_; + } + + inline bool options:: + one_accessor_regex_specified () const + { + return this->one_accessor_regex_specified_; + } + + inline const NarrowStrings& options:: + opt_accessor_regex () const + { + return this->opt_accessor_regex_; + } + + inline bool options:: + opt_accessor_regex_specified () const + { + return this->opt_accessor_regex_specified_; + } + + inline const NarrowStrings& options:: + seq_accessor_regex () const + { + return this->seq_accessor_regex_; + } + + inline bool options:: + seq_accessor_regex_specified () const + { + return this->seq_accessor_regex_specified_; + } + + inline const NarrowStrings& options:: + modifier_regex () const + { + return this->modifier_regex_; + } + + inline bool options:: + modifier_regex_specified () const + { + return this->modifier_regex_specified_; + } + + inline const NarrowStrings& options:: + one_modifier_regex () const + { + return this->one_modifier_regex_; + } + + inline bool options:: + one_modifier_regex_specified () const + { + return this->one_modifier_regex_specified_; + } + + inline const NarrowStrings& options:: + opt_modifier_regex () const + { + return this->opt_modifier_regex_; + } + + inline bool options:: + opt_modifier_regex_specified () const + { + return this->opt_modifier_regex_specified_; + } + + inline const NarrowStrings& options:: + seq_modifier_regex () const + { + return this->seq_modifier_regex_; + } + + inline bool options:: + seq_modifier_regex_specified () const + { + return this->seq_modifier_regex_specified_; + } + + inline const NarrowStrings& options:: + parser_regex () const + { + return this->parser_regex_; + } + + inline bool options:: + parser_regex_specified () const + { + return this->parser_regex_specified_; + } + + inline const NarrowStrings& options:: + serializer_regex () const + { + return this->serializer_regex_; + } + + inline bool options:: + serializer_regex_specified () const + { + return this->serializer_regex_specified_; + } + + inline const NarrowStrings& options:: + const_regex () const + { + return this->const_regex_; + } + + inline bool options:: + const_regex_specified () const + { + return this->const_regex_specified_; + } + + inline const NarrowStrings& options:: + enumerator_regex () const + { + return this->enumerator_regex_; + } + + inline bool options:: + enumerator_regex_specified () const + { + return this->enumerator_regex_specified_; + } + + inline const NarrowStrings& options:: + element_type_regex () const + { + return this->element_type_regex_; + } + + inline bool options:: + element_type_regex_specified () const + { + return this->element_type_regex_specified_; + } + + inline const bool& options:: + name_regex_trace () const + { + return this->name_regex_trace_; + } + + inline const bool& options:: + root_element_first () const + { + return this->root_element_first_; + } + + inline const bool& options:: + root_element_last () const + { + return this->root_element_last_; + } + + inline const bool& options:: + root_element_all () const + { + return this->root_element_all_; + } + + inline const bool& options:: + root_element_none () const + { + return this->root_element_none_; + } + + inline const NarrowStrings& options:: + root_element () const + { + return this->root_element_; + } + + inline bool options:: + root_element_specified () const + { + return this->root_element_specified_; + } + + inline const NarrowStrings& options:: + custom_type () const + { + return this->custom_type_; + } + + inline bool options:: + custom_type_specified () const + { + return this->custom_type_specified_; + } + + inline const NarrowStrings& options:: + custom_type_regex () const + { + return this->custom_type_regex_; + } + + inline bool options:: + custom_type_regex_specified () const + { + return this->custom_type_regex_specified_; + } + + inline const std::size_t& options:: + parts () const + { + return this->parts_; + } + + inline bool options:: + parts_specified () const + { + return this->parts_specified_; + } + + inline const NarrowString& options:: + parts_suffix () const + { + return this->parts_suffix_; + } + + inline bool options:: + parts_suffix_specified () const + { + return this->parts_suffix_specified_; + } + } +} + +// Begin epilogue. +// +// +// End epilogue. |