aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid/generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsde/cxx/hybrid/generator.cxx')
-rw-r--r--xsde/cxx/hybrid/generator.cxx516
1 files changed, 3 insertions, 513 deletions
diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx
index 4db77ea..3a61c95 100644
--- a/xsde/cxx/hybrid/generator.cxx
+++ b/xsde/cxx/hybrid/generator.cxx
@@ -17,8 +17,6 @@
#include <cutl/compiler/cxx-indenter.hxx>
#include <cutl/compiler/sloc-counter.hxx>
-#include <backend-elements/indentation/clip.hxx>
-
#include <xsd-frontend/semantic-graph.hxx>
#include <cxx/hybrid/elements.hxx>
@@ -52,7 +50,7 @@
#include <cxx/hybrid/serializer-aggregate-header.hxx>
#include <cxx/hybrid/serializer-aggregate-source.hxx>
-#include <usage.hxx>
+#include <cxx/hybrid/options.hxx>
#include "../../../libxsde/xsde/cxx/version.hxx"
@@ -61,7 +59,6 @@ using std::wcerr;
using std::wcout;
using namespace XSDFrontend::SemanticGraph;
-namespace Indentation = BackendElements::Indentation;
//
//
@@ -213,515 +210,8 @@ namespace CXX
Void Hybrid::Generator::
usage ()
{
- std::wostream& o (wcout);
- ::CLI::Indent::Clip< ::CLI::OptionsUsage, WideChar> clip (o);
-
- o << "--char-encoding <enc>" << endl
- << " Specify the character encoding that should be\n"
- << " used in the object model. Valid values are 'utf8'\n"
- << " (default) and 'iso8859-1'."
- << endl;
-
- o << "--no-stl" << endl
- << " Generate code that does not use STL."
- << endl;
-
- o << "--no-iostream" << endl
- << " Generate code that does not use the iostream\n"
- << " library."
- << endl;
-
- o << "--no-exceptions" << endl
- << " Generate code that does not use C++ exceptions."
- << endl;
-
- o << "--no-long-long" << endl
- << " Generate code that does not use the long long\n"
- << " and unsigned long long types."
- << endl;
-
- o << "--generate-parser" << endl
- << " Generate XML parsing code."
- << endl;
-
- o << "--generate-serializer" << endl
- << " Generate XML serialization code."
- << endl;
-
- o << "--generate-aggregate" << endl
- << " Generate parser/serializer aggregates for root\n"
- << " elements and/or types."
- << endl;
-
- o << "--suppress-validation" << endl
- << " Suppress the generation of validation code in\n"
- << " parser and serializer."
- << endl;
-
- o << "--suppress-parser-val" << endl
- << " Suppress the generation of validation code in\n"
- << " parser."
- << endl;
-
- o << "--suppress-serializer-val" << endl
- << " Suppress the generation of validation code in\n"
- << " serializer."
- << endl;
-
- o << "--omit-default-attributes" << endl
- << " Omit attributes with default and fixed values\n"
- << " from serialized XML documents."
- << endl;
-
- o << "--suppress-enum" << endl
- << " Suppress the generation of the XML Schema\n"
- << " enumeration to C++ enum mapping."
- << endl;
-
- o << "--generate-clone" << endl
- << " Generate clone functions for variable-length\n"
- << " types."
- << endl;
-
- o << "--generate-detach" << endl
- << " Generate detach functions for elements and\n"
- << " attributes of variable-length types."
- << endl;
-
- o << "--generate-insertion <os>" << endl
- << " Generate data representation stream insertion\n"
- << " operators for the <os> output stream type."
- << endl;
-
- o << "--generate-extraction <is>" << endl
- << " Generate data representation stream extraction\n"
- << " operators for the <is> input stream type."
- << endl;
-
- o << "--generate-inline" << endl
- << " Generate certain functions inline."
- << endl;
-
- o << "--generate-forward" << endl
- << " Generate forward declaration file."
- << endl;
-
- o << "--generate-xml-schema" << endl
- << " Generate C++ header files as if the schema being\n"
- << " compiled defines the XML Schema namespace."
- << endl;
-
- o << "--extern-xml-schema <file>" << endl
- << " Generate code as if the XML Schema namespace was\n"
- << " defined in <file> and xsd:included in the schema\n"
- << " being compiled."
- << endl;
-
- o << "--suppress-reset" << endl
- << " Suppress the generation of parser and serializer\n"
- << " reset code."
- << endl;
-
- o << "--custom-allocator" << endl
- << " Generate code that uses custom allocator functions\n"
- << " instead of operator new/delete."
- << endl;
-
- o << "--generate-polymorphic" << endl
- << " Generate polymorphism-aware code. Specify this\n"
- << " option if you use substitution groups or xsi:type."
- << endl;
-
- o << "--runtime-polymorphic" << endl
- << " Generate non-polymorphic code that uses the\n"
- << " runtime library configured with polymorphism\n"
- << " support."
- << endl;
-
- o << "--polymorphic-type <type>" << endl
- << " Indicate that <type> is a root of a polymorphic\n"
- << " type hierarchy."
- << endl;
-
- o << "--generate-typeinfo" << endl
- << " Generate type information functions for\n"
- << " polymorphic object model types."
- << endl;
-
- o << "--polymorphic-schema <file>" << endl
- << " Indicate that <file> contains derivations of\n"
- << " polymorphic types."
- << endl;
-
- o << "--reuse-style-mixin" << endl
- << " Generate code that supports the mixin base\n"
- << " parser/serializer implementation reuse style."
- << endl;
-
- o << "--custom-data <type>" << endl
- << " Add custom data to the C++ class generated for\n"
- << " XML Schema type <type>."
- << endl;
-
- o << "--custom-type <map>" << endl
- << " Use a custom type implementation instead of the\n"
- << " generated version. The <map> argument is in the\n"
- << " form name[=[flags][/[type][/[base][/include]]]],\n"
- << " where <name> is an XML Schema type name,\n"
- << " optional <flags> specify whether the custom type\n"
- << " is fixed or variable-length, optional <type> is\n"
- << " a C++ type name that should be used instead,\n"
- << " optional <base> is a C++ name that should be\n"
- << " given to the generated version, and optional\n"
- << " <include> is the header file that defines the\n"
- << " custom implementation."
- << endl;
-
- o << "--custom-parser <map>" << endl
- << " Use a custom parser implementation instead of the\n"
- << " generated version. The <map> argument is in the\n"
- << " form name[=[base][/include]], where <name> is an\n"
- << " XML Schema type name, optional <base> is a C++\n"
- << " name that should be given to the generated\n"
- << " version, and optional <include> is the header\n"
- << " file that defines the custom implementation."
- << endl;
-
- o << "--custom-serializer <map>" << endl
- << " Use a custom serializer implementation instead of\n"
- << " the generated version. The <map> argument is in\n"
- << " the form name[=[base][/include]], where <name> is\n"
- << " an XML Schema type name, optional <base> is a C++\n"
- << " name that should be given to the generated\n"
- << " version, and optional <include> is the header\n"
- << " file that defines the custom implementation."
- << endl;
-
- o << "--root-element-first" << endl
- << " Treat only the first global element as a document\n"
- << " root."
- << endl;
-
- o << "--root-element-last" << endl
- << " Treat only the last global element as a document\n"
- << " root."
- << endl;
-
- o << "--root-element-all" << endl
- << " Treat all global elements as document roots."
- << endl;
-
- o << "--root-element-none" << endl
- << " Don't treat any global elements as document roots."
- << endl;
-
- o << "--root-element <element>" << endl
- << " Treat only <element> as a document root. Repeat\n"
- << " this option to specify more than one root element."
- << endl;
-
- o << "--root-type <type>" << endl
- << " Generate parser/serializer aggregate for <type>.\n"
- << " Repeat this option to specify more than one type."
- << endl;
-
- o << "--output-dir <dir>" << endl
- << " Write generated files to <dir> instead of the\n"
- << " current directory."
- << endl;
-
- o << "--pskel-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_pskel' suffix\n"
- << " to construct the names of generated parser\n"
- << " skeletons."
- << endl;
-
- o << "--sskel-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_sskel' suffix\n"
- << " to construct the names of generated serializer\n"
- << " skeletons."
- << endl;
-
- o << "--pskel-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-pskel' suffix\n"
- << " to construct the names of generated parser\n"
- << " skeleton files."
- << endl;
-
- o << "--sskel-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-sskel' suffix\n"
- << " to construct the names of generated serializer\n"
- << " skeleton files."
- << endl;
-
- o << "--pimpl-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_pimpl' suffix\n"
- << " to construct the names of generated parser\n"
- << " implementations."
- << endl;
-
- o << "--simpl-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_simpl' suffix\n"
- << " to construct the names of generated serializer\n"
- << " implementations."
- << endl;
-
- o << "--pimpl-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-pimpl' suffix\n"
- << " to construct the names of generated parser\n"
- << " implementation files."
- << endl;
-
- o << "--simpl-file-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '-simpl' suffix\n"
- << " to construct the names of generated serializer\n"
- << " implementation files."
- << endl;
-
- o << "--paggr-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_paggs' suffix\n"
- << " to construct the names of generated parser\n"
- << " aggregates."
- << endl;
-
- o << "--saggr-type-suffix <sfx>" << endl
- << " Use <sfx> instead of the default '_saggr' suffix\n"
- << " to construct the names of generated serializer\n"
- << " aggregates."
- << endl;
-
- o << "--namespace-map <xns>=<cns>" << endl
- << " Map XML Schema namespace <xns> to C++ namespace\n"
- << " <cns>. Repeat this option to specify mapping for\n"
- << " more than one XML Schema namespace."
- << endl;
-
- o << "--namespace-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to translate XML Schema namespace names to\n"
- << " C++ namespace names."
- << endl;
-
- o << "--namespace-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --namespace-regex option."
- << endl;
-
- o << "--reserved-name <name>" << endl
- << " Add <name> to the list of names that should not\n"
- << " be used as identifiers. The name can optionally\n"
- << " be followed by '=' and the replacement name that\n"
- << " should be used instead."
- << endl;
-
- o << "--include-with-brackets" << endl
- << " Use angle brackets (<>) instead of quotes (\"\") in\n"
- << " generated #include directives."
- << endl;
-
- o << "--include-prefix <prefix>" << endl
- << " Add <prefix> to generated #include directive\n"
- << " paths."
- << endl;
-
- o << "--include-regex <regex>" << endl
- << " Add <regex> to the list of regular expressions\n"
- << " used to transform #include directive paths."
- << endl;
-
- o << "--include-regex-trace" << endl
- << " Trace the process of applying regular expressions\n"
- << " specified with the --include-regex option."
- << endl;
-
- o << "--guard-prefix <prefix>" << endl
- << " Add <prefix> to generated header inclusion guards."
- << endl;
-
- // File suffix.
- //
- o << "--hxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.hxx' to\n"
- << " construct the name of the header files."
- << endl;
-
- o << "--ixx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.ixx' to\n"
- << " construct the name of the inline files."
- << endl;
-
- o << "--cxx-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '.cxx' to\n"
- << " construct the name of the source files."
- << endl;
-
- o << "--fwd-suffix <suffix>" << endl
- << " Use <suffix> instead of the default '-fwd.hxx'\n"
- << " to construct the name of the forward declaration\n"
- << " file."
- << endl;
-
- // File regex.
- //
- o << "--hxx-regex <regex>" << endl
- << " Use <regex> to construct the names of the header\n"
- << " files."
- << endl;
-
- o << "--ixx-regex <regex>" << endl
- << " Use <regex> to construct the names of the inline\n"
- << " files."
- << endl;
-
- o << "--cxx-regex <regex>" << endl
- << " Use <regex> to construct the names of the source\n"
- << " files."
- << endl;
-
- o << "--fwd-regex <regex>" << endl
- << " Use <regex> to construct the name of the forward\n"
- << " declaration file."
- << endl;
-
-
- // Prologues.
- //
- o << "--hxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the header\n"
- << " files."
- << endl;
-
- o << "--ixx-prologue <text>" << endl
- << " Insert <text> at the beginning of the inline\n"
- << " files."
- << endl;
-
- o << "--cxx-prologue <text>" << endl
- << " Insert <text> at the beginning of the source\n"
- << " files."
- << endl;
-
- o << "--fwd-prologue <text>" << endl
- << " Insert <text> at the beginning of the forward\n"
- << " declaration file."
- << endl;
-
- o << "--prologue <text>" << endl
- << " Insert <text> at the beginning of each generated\n"
- << " file for which there is no file-specific prologue."
- << endl;
-
-
- // Epilogues.
- //
- o << "--hxx-epilogue <text>" << endl
- << " Insert <text> at the end of the header files."
- << endl;
-
- o << "--ixx-epilogue <text>" << endl
- << " Insert <text> at the end of the inline files."
- << endl;
-
- o << "--cxx-epilogue <text>" << endl
- << " Insert <text> at the end of the source files."
- << endl;
-
- o << "--fwd-epilogue <text>" << endl
- << " Insert <text> at the end of the forward\n"
- << " declaration file."
- << endl;
-
- o << "--epilogue <text>" << endl
- << " Insert <text> at the end of each generated file\n"
- << " for which there is no file-specific epilogue."
- << endl;
-
-
- // Prologue files.
- //
- o << "--hxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the header files."
- << endl;
-
- o << "--ixx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the inline files."
- << endl;
-
- o << "--cxx-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the source files."
- << endl;
-
- o << "--fwd-prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of the forward declaration file."
- << endl;
-
- o << "--prologue-file <file>" << endl
- << " Insert the content of the <file> at the beginning\n"
- << " of each generated file for which there is no file-\n"
- << " specific prologue file."
- << endl;
-
-
- // Epilogue files.
- //
- o << "--hxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the header files."
- << endl;
-
- o << "--ixx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the inline files."
- << endl;
-
- o << "--cxx-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the source files."
- << endl;
-
- o << "--fwd-epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " the forward declaration file."
- << endl;
-
- o << "--epilogue-file <file>" << endl
- << " Insert the content of the <file> at the end of\n"
- << " each generated file for which there is no file-\n"
- << " specific epilogue file."
- << endl;
-
-
- // Misc.
- //
- o << "--show-anonymous" << endl
- << " Show elements and attributes that are of anonymous\n"
- << " types."
- << endl;
-
- o << "--show-sloc" << endl
- << " Show the number of generated physical source lines\n"
- << " of code (SLOC)."
- << endl;
-
- o << "--sloc-limit <num>" << endl
- << " Check that the number of generated physical source\n"
- << " lines of code (SLOC) does not exceed <num>."
- << endl;
-
- o << "--options-file <file>" << endl
- << " Read additional options from <file>. Each option\n"
- << " should appear on a separate line optionally\n"
- << " followed by space and an argument."
- << endl;
-
- o << "--proprietary-license" << endl
- << " Indicate that the generated code is licensed under\n"
- << " a proprietary license instead of the GPL."
- << endl;
+ CXX::Hybrid::options::print_usage (wcout);
+ CXX::options::print_usage (wcout);
}
Hybrid::CLI::OptionsSpec Hybrid::Generator::