aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid
diff options
context:
space:
mode:
Diffstat (limited to 'xsde/cxx/hybrid')
-rw-r--r--xsde/cxx/hybrid/cli.hxx216
-rw-r--r--xsde/cxx/hybrid/elements.cxx48
-rw-r--r--xsde/cxx/hybrid/elements.hxx19
-rw-r--r--xsde/cxx/hybrid/extraction-header.cxx14
-rw-r--r--xsde/cxx/hybrid/extraction-source.cxx14
-rw-r--r--xsde/cxx/hybrid/generator.cxx728
-rw-r--r--xsde/cxx/hybrid/generator.hxx36
-rw-r--r--xsde/cxx/hybrid/insertion-header.cxx14
-rw-r--r--xsde/cxx/hybrid/insertion-source.cxx14
-rw-r--r--xsde/cxx/hybrid/options.cli22
-rw-r--r--xsde/cxx/hybrid/parser-header.cxx4
-rw-r--r--xsde/cxx/hybrid/parser-name-processor.cxx69
-rw-r--r--xsde/cxx/hybrid/parser-name-processor.hxx4
-rw-r--r--xsde/cxx/hybrid/parser-source.cxx12
-rw-r--r--xsde/cxx/hybrid/serializer-name-processor.cxx72
-rw-r--r--xsde/cxx/hybrid/serializer-name-processor.hxx4
-rw-r--r--xsde/cxx/hybrid/serializer-source.cxx14
-rw-r--r--xsde/cxx/hybrid/tree-forward.cxx12
-rw-r--r--xsde/cxx/hybrid/tree-header.cxx6
-rw-r--r--xsde/cxx/hybrid/tree-inline.cxx2
-rw-r--r--xsde/cxx/hybrid/tree-name-processor.cxx44
-rw-r--r--xsde/cxx/hybrid/tree-name-processor.hxx4
-rw-r--r--xsde/cxx/hybrid/tree-size-processor.cxx27
-rw-r--r--xsde/cxx/hybrid/tree-size-processor.hxx4
-rw-r--r--xsde/cxx/hybrid/tree-type-map.cxx31
-rw-r--r--xsde/cxx/hybrid/tree-type-map.hxx4
-rw-r--r--xsde/cxx/hybrid/validator.cxx37
-rw-r--r--xsde/cxx/hybrid/validator.hxx4
28 files changed, 436 insertions, 1043 deletions
diff --git a/xsde/cxx/hybrid/cli.hxx b/xsde/cxx/hybrid/cli.hxx
deleted file mode 100644
index f697247..0000000
--- a/xsde/cxx/hybrid/cli.hxx
+++ /dev/null
@@ -1,216 +0,0 @@
-// file : xsde/cxx/hybrid/cli.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#ifndef CXX_HYBRID_CLI_HXX
-#define CXX_HYBRID_CLI_HXX
-
-#include <cult/types.hxx>
-
-#include <cult/containers/vector.hxx>
-
-#include <cult/cli/options.hxx>
-#include <cult/cli/options-spec.hxx>
-
-namespace CXX
-{
- namespace Hybrid
- {
- namespace CLI
- {
- using namespace Cult::Types;
-
- typedef Char const Key[];
-
- extern Key char_encoding;
- extern Key no_stl;
- extern Key no_iostream;
- extern Key no_exceptions;
- extern Key no_long_long;
- extern Key generate_parser;
- extern Key generate_serializer;
- extern Key generate_aggregate;
- extern Key suppress_validation;
- extern Key suppress_parser_val;
- extern Key suppress_serializer_val;
- extern Key omit_default_attributes;
- extern Key suppress_enum;
- extern Key generate_clone;
- extern Key generate_detach;
- extern Key generate_insertion;
- extern Key generate_extraction;
- extern Key generate_inline;
- extern Key generate_forward;
- extern Key generate_xml_schema;
- extern Key extern_xml_schema;
- extern Key suppress_reset;
- extern Key custom_allocator;
- extern Key generate_polymorphic;
- extern Key runtime_polymorphic;
- extern Key polymorphic_type;
- extern Key generate_typeinfo;
- extern Key polymorphic_schema;
- extern Key reuse_style_mixin;
- extern Key custom_data;
- extern Key custom_type;
- extern Key custom_parser;
- extern Key custom_serializer;
- extern Key root_element_first;
- extern Key root_element_last;
- extern Key root_element_all;
- extern Key root_element_none;
- extern Key root_element;
- extern Key root_type;
- extern Key output_dir;
- extern Key pskel_type_suffix;
- extern Key sskel_type_suffix;
- extern Key pskel_file_suffix;
- extern Key sskel_file_suffix;
- extern Key pimpl_type_suffix;
- extern Key simpl_type_suffix;
- extern Key pimpl_file_suffix;
- extern Key simpl_file_suffix;
- extern Key paggr_type_suffix;
- extern Key saggr_type_suffix;
- extern Key namespace_map;
- extern Key namespace_regex;
- extern Key namespace_regex_trace;
- extern Key reserved_name;
- extern Key include_with_brackets;
- extern Key include_prefix;
- extern Key include_regex;
- extern Key include_regex_trace;
- extern Key guard_prefix;
- extern Key hxx_suffix;
- extern Key ixx_suffix;
- extern Key cxx_suffix;
- extern Key fwd_suffix;
- extern Key hxx_regex;
- extern Key ixx_regex;
- extern Key cxx_regex;
- extern Key fwd_regex;
- extern Key hxx_prologue;
- extern Key ixx_prologue;
- extern Key cxx_prologue;
- extern Key fwd_prologue;
- extern Key prologue;
- extern Key hxx_epilogue;
- extern Key ixx_epilogue;
- extern Key cxx_epilogue;
- extern Key fwd_epilogue;
- extern Key epilogue;
- extern Key hxx_prologue_file;
- extern Key ixx_prologue_file;
- extern Key cxx_prologue_file;
- extern Key fwd_prologue_file;
- extern Key prologue_file;
- extern Key hxx_epilogue_file;
- extern Key ixx_epilogue_file;
- extern Key cxx_epilogue_file;
- extern Key fwd_epilogue_file;
- extern Key epilogue_file;
- extern Key show_anonymous;
- extern Key show_sloc;
- extern Key proprietary_license;
-
- typedef Cult::CLI::Options<
- char_encoding, NarrowString,
- no_stl, Boolean,
- no_iostream, Boolean,
- no_exceptions, Boolean,
- no_long_long, Boolean,
- generate_parser, Boolean,
- generate_serializer, Boolean,
- generate_aggregate, Boolean,
- suppress_validation, Boolean,
- suppress_parser_val, Boolean,
- suppress_serializer_val, Boolean,
- omit_default_attributes, Boolean,
- suppress_enum, Boolean,
- generate_clone, Boolean,
- generate_detach, Boolean,
- generate_insertion, Cult::Containers::Vector<NarrowString>,
- generate_extraction, Cult::Containers::Vector<NarrowString>,
- generate_inline, Boolean,
- generate_forward, Boolean,
- generate_xml_schema, Boolean,
- extern_xml_schema, NarrowString,
- suppress_reset, Boolean,
- custom_allocator, Boolean,
- generate_polymorphic, Boolean,
- runtime_polymorphic, Boolean,
- polymorphic_type, Cult::Containers::Vector<NarrowString>,
- generate_typeinfo, Boolean,
- polymorphic_schema, Cult::Containers::Vector<NarrowString>,
- reuse_style_mixin, Boolean,
- custom_data, Cult::Containers::Vector<NarrowString>,
- custom_type, Cult::Containers::Vector<NarrowString>,
- custom_parser, Cult::Containers::Vector<NarrowString>,
- custom_serializer, Cult::Containers::Vector<NarrowString>,
- root_element_first, Boolean,
- root_element_last, Boolean,
- root_element_all, Boolean,
- root_element_none, Boolean,
- root_element, Cult::Containers::Vector<NarrowString>,
- root_type, Cult::Containers::Vector<NarrowString>,
- output_dir, NarrowString,
- pskel_type_suffix, NarrowString,
- sskel_type_suffix, NarrowString,
- pskel_file_suffix, NarrowString,
- sskel_file_suffix, NarrowString,
- pimpl_type_suffix, NarrowString,
- simpl_type_suffix, NarrowString,
- pimpl_file_suffix, NarrowString,
- simpl_file_suffix, NarrowString,
- paggr_type_suffix, NarrowString,
- saggr_type_suffix, NarrowString,
- namespace_map, Cult::Containers::Vector<NarrowString>,
- namespace_regex, Cult::Containers::Vector<NarrowString>,
- namespace_regex_trace, Boolean,
- reserved_name, Cult::Containers::Vector<NarrowString>,
- include_with_brackets, Boolean,
- include_prefix, NarrowString,
- include_regex, Cult::Containers::Vector<NarrowString>,
- include_regex_trace, Boolean,
- guard_prefix, NarrowString,
- hxx_suffix, NarrowString,
- ixx_suffix, NarrowString,
- cxx_suffix, NarrowString,
- fwd_suffix, NarrowString,
- hxx_regex, Cult::Containers::Vector<NarrowString>,
- ixx_regex, Cult::Containers::Vector<NarrowString>,
- cxx_regex, Cult::Containers::Vector<NarrowString>,
- fwd_regex, NarrowString,
- hxx_prologue, Cult::Containers::Vector<NarrowString>,
- ixx_prologue, Cult::Containers::Vector<NarrowString>,
- cxx_prologue, Cult::Containers::Vector<NarrowString>,
- fwd_prologue, Cult::Containers::Vector<NarrowString>,
- prologue, Cult::Containers::Vector<NarrowString>,
- hxx_epilogue, Cult::Containers::Vector<NarrowString>,
- ixx_epilogue, Cult::Containers::Vector<NarrowString>,
- cxx_epilogue, Cult::Containers::Vector<NarrowString>,
- fwd_epilogue, Cult::Containers::Vector<NarrowString>,
- epilogue, Cult::Containers::Vector<NarrowString>,
- hxx_prologue_file, Cult::Containers::Vector<NarrowString>,
- ixx_prologue_file, Cult::Containers::Vector<NarrowString>,
- cxx_prologue_file, Cult::Containers::Vector<NarrowString>,
- fwd_prologue_file, NarrowString,
- prologue_file, Cult::Containers::Vector<NarrowString>,
- hxx_epilogue_file, Cult::Containers::Vector<NarrowString>,
- ixx_epilogue_file, Cult::Containers::Vector<NarrowString>,
- cxx_epilogue_file, Cult::Containers::Vector<NarrowString>,
- fwd_epilogue_file, NarrowString,
- epilogue_file, Cult::Containers::Vector<NarrowString>,
- show_anonymous, Boolean,
- show_sloc, Boolean,
- proprietary_license, Boolean
-
- > Options;
-
- struct OptionsSpec: Cult::CLI::OptionsSpec<Options> {};
- }
- }
-}
-
-#endif // CXX_HYBRID_CLI_HXX
diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx
index 337e15f..9356b66 100644
--- a/xsde/cxx/hybrid/elements.cxx
+++ b/xsde/cxx/hybrid/elements.cxx
@@ -13,39 +13,22 @@ namespace CXX
Context (std::wostream& o,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
- CLI::Options const& ops,
+ options_type const& ops,
Regex const* fe,
Regex const* he,
Regex const* ie)
- : CXX::Context (o,
- root,
- path,
- "name",
- "char",
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- "", // export symbol
- ops.value<CLI::namespace_map> (),
- ops.value<CLI::namespace_regex> (),
- ops.value<CLI::namespace_regex_trace> (),
- ops.value<CLI::include_regex> (),
- ops.value<CLI::include_regex_trace> (),
- ops.value<CLI::generate_inline> (),
- ops.value<CLI::custom_allocator> (),
- !ops.value<CLI::no_long_long> (),
- ops.value<CLI::reserved_name> ()),
+ : CXX::Context (o, root, path, ops, "name", "char"),
options (ops),
- exceptions (!ops.value<CLI::no_exceptions> ()),
- stl (!ops.value<CLI::no_stl> ()),
- poly_code (ops.value<CLI::generate_polymorphic> ()),
- poly_runtime (poly_code || ops.value<CLI::runtime_polymorphic> ()),
- reset (!ops.value<CLI::suppress_reset> ()),
- clone (ops.value<CLI::generate_clone> ()),
- detach (ops.value<CLI::generate_detach> ()),
- mixin (ops.value<CLI::reuse_style_mixin> ()),
+ exceptions (!ops.no_exceptions ()),
+ stl (!ops.no_stl ()),
+ poly_code (ops.generate_polymorphic ()),
+ poly_runtime (poly_code || ops.runtime_polymorphic ()),
+ reset (!ops.suppress_reset ()),
+ clone (ops.generate_clone ()),
+ detach (ops.generate_detach ()),
+ mixin (ops.reuse_style_mixin ()),
tiein (!mixin),
- enum_ (!ops.value<CLI::suppress_enum> ()),
+ enum_ (!ops.suppress_enum ()),
fwd_expr (fe),
hxx_expr (he),
ixx_expr (ie),
@@ -55,16 +38,15 @@ namespace CXX
var_seq (var_seq_),
str_seq (str_seq_),
data_seq (data_seq_),
- istreams (ops.value<CLI::generate_extraction> ()),
- ostreams (ops.value<CLI::generate_insertion> ()),
+ istreams (ops.generate_extraction ()),
+ ostreams (ops.generate_insertion ()),
icdrstream (icdrstream_),
ocdrstream (ocdrstream_),
ixdrstream (ixdrstream_),
oxdrstream (oxdrstream_)
{
- typeinfo = poly_code &&
- (ops.value<CLI::generate_typeinfo> () ||
- ops.value<CLI::generate_serializer> ());
+ typeinfo =
+ poly_code && (ops.generate_typeinfo () || ops.generate_serializer ());
String xs_ns (xs_ns_name ());
diff --git a/xsde/cxx/hybrid/elements.hxx b/xsde/cxx/hybrid/elements.hxx
index 45fe671..f4b00e8 100644
--- a/xsde/cxx/hybrid/elements.hxx
+++ b/xsde/cxx/hybrid/elements.hxx
@@ -14,7 +14,7 @@
#include <cxx/elements.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -29,11 +29,13 @@ namespace CXX
public:
typedef Hybrid::Regex Regex;
+ typedef Hybrid::options options_type;
+
public:
Context (std::wostream&,
SemanticGraph::Schema&,
SemanticGraph::Path const&,
- CLI::Options const&,
+ options_type const&,
Regex const* fwd_expr,
Regex const* hxx_expr,
Regex const* ixx_expr);
@@ -591,7 +593,7 @@ namespace CXX
NamespaceStack;
public:
- CLI::Options const& options;
+ options_type const& options;
Boolean exceptions;
Boolean stl;
@@ -617,9 +619,8 @@ namespace CXX
String const& str_seq;
String const& data_seq;
- typedef Containers::Vector<NarrowString> Streams;
- Streams const& istreams;
- Streams const& ostreams;
+ NarrowStrings const& istreams;
+ NarrowStrings const& ostreams;
String const& icdrstream;
String const& ocdrstream;
@@ -1191,7 +1192,7 @@ namespace CXX
{
if (use_ != base)
{
- if (options.value<CLI::no_long_long> ())
+ if (options.no_long_long ())
fund_type ("long");
else
fund_type ("long long");
@@ -1205,7 +1206,7 @@ namespace CXX
{
if (use_ != base)
{
- if (options.value<CLI::no_long_long> ())
+ if (options.no_long_long ())
fund_type ("unsigned long");
else
fund_type ("unsigned long long");
@@ -2172,7 +2173,7 @@ namespace CXX
Includes (Context& c, Type type, Regex const* r = 0)
: ctx_ (c),
type_ (type),
- forward_ (c.options.value<CLI::generate_forward> ()),
+ forward_ (c.options.generate_forward ()),
regex_ (r),
namespace_ (c),
type_forward_ (c)
diff --git a/xsde/cxx/hybrid/extraction-header.cxx b/xsde/cxx/hybrid/extraction-header.cxx
index 3240f54..25b4b43 100644
--- a/xsde/cxx/hybrid/extraction-header.cxx
+++ b/xsde/cxx/hybrid/extraction-header.cxx
@@ -41,7 +41,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -73,7 +73,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -102,7 +102,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -135,7 +135,7 @@ namespace CXX
String const& type (etype (a));
String const& scope (Context::scope (a));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -165,7 +165,7 @@ namespace CXX
String const& type (etype (c));
String const& scope (Context::scope (c));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -201,7 +201,7 @@ namespace CXX
String const& type (etype (s));
String const& scope (Context::scope (s));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -256,7 +256,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
diff --git a/xsde/cxx/hybrid/extraction-source.cxx b/xsde/cxx/hybrid/extraction-source.cxx
index 8b314f5..413ffdc 100644
--- a/xsde/cxx/hybrid/extraction-source.cxx
+++ b/xsde/cxx/hybrid/extraction-source.cxx
@@ -41,7 +41,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -86,7 +86,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -126,7 +126,7 @@ namespace CXX
String const& value (u.context ().get<String> ("value"));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -980,7 +980,7 @@ namespace CXX
String const& type (etype (a));
String const& scope (Context::scope (a));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -1023,7 +1023,7 @@ namespace CXX
String const& type (etype (c));
String const& scope (Context::scope (c));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -1089,7 +1089,7 @@ namespace CXX
String const& type (etype (s));
String const& scope (Context::scope (s));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -1188,7 +1188,7 @@ namespace CXX
Boolean restriction (restriction_p (c));
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx
index 3a61c95..c2289ae 100644
--- a/xsde/cxx/hybrid/generator.cxx
+++ b/xsde/cxx/hybrid/generator.cxx
@@ -54,10 +54,7 @@
#include "../../../libxsde/xsde/cxx/version.hxx"
-using std::endl;
-using std::wcerr;
-using std::wcout;
-
+using namespace std;
using namespace XSDFrontend::SemanticGraph;
//
@@ -110,103 +107,6 @@ namespace CXX
"//\n\n";
}
- namespace Hybrid
- {
- namespace CLI
- {
- extern Key char_encoding = "char-encoding";
- extern Key no_stl = "no-stl";
- extern Key no_iostream = "no-iostream";
- extern Key no_exceptions = "no-exceptions";
- extern Key no_long_long = "no-long-long";
- extern Key generate_parser = "generate-parser";
- extern Key generate_serializer = "generate-serializer";
- extern Key generate_aggregate = "generate-aggregate";
- extern Key suppress_validation = "suppress-validation";
- extern Key suppress_parser_val = "suppress-parser-val";
- extern Key suppress_serializer_val = "suppress-serializer-val";
- extern Key omit_default_attributes = "omit-default-attributes";
- extern Key suppress_enum = "suppress-enum";
- extern Key generate_clone = "generate-clone";
- extern Key generate_detach = "generate-detach";
- extern Key generate_insertion = "generate-insertion";
- extern Key generate_extraction = "generate-extraction";
- extern Key generate_inline = "generate-inline";
- extern Key generate_forward = "generate-forward";
- extern Key generate_xml_schema = "generate-xml-schema";
- extern Key extern_xml_schema = "extern-xml-schema";
- extern Key suppress_reset = "suppress-reset";
- extern Key custom_allocator = "custom-allocator";
- extern Key generate_polymorphic = "generate-polymorphic";
- extern Key runtime_polymorphic = "runtime-polymorphic";
- extern Key polymorphic_type = "polymorphic-type";
- extern Key generate_typeinfo = "generate-typeinfo";
- extern Key polymorphic_schema = "polymorphic-schema";
- extern Key reuse_style_mixin = "reuse-style-mixin";
- extern Key custom_data = "custom-data";
- extern Key custom_type = "custom-type";
- extern Key custom_parser = "custom-parser";
- extern Key custom_serializer = "custom-serializer";
- extern Key root_element_first = "root-element-first";
- extern Key root_element_last = "root-element-last";
- extern Key root_element_all = "root-element-all";
- extern Key root_element_none = "root-element-none";
- extern Key root_element = "root-element";
- extern Key root_type = "root-type";
- extern Key output_dir = "output-dir";
- extern Key pskel_type_suffix = "pskel-type-suffix";
- extern Key sskel_type_suffix = "sskel-type-suffix";
- extern Key pskel_file_suffix = "pskel-file-suffix";
- extern Key sskel_file_suffix = "sskel-file-suffix";
- extern Key pimpl_type_suffix = "pimpl-type-suffix";
- extern Key simpl_type_suffix = "simpl-type-suffix";
- extern Key pimpl_file_suffix = "pimpl-file-suffix";
- extern Key simpl_file_suffix = "simpl-file-suffix";
- extern Key paggr_type_suffix = "paggr-type-suffix";
- extern Key saggr_type_suffix = "saggr-type-suffix";
- extern Key namespace_map = "namespace-map";
- extern Key namespace_regex = "namespace-regex";
- extern Key namespace_regex_trace = "namespace-regex-trace";
- extern Key reserved_name = "reserved-name";
- extern Key include_with_brackets = "include-with-brackets";
- extern Key include_prefix = "include-prefix";
- extern Key include_regex = "include-regex";
- extern Key include_regex_trace = "include-regex-trace";
- extern Key guard_prefix = "guard-prefix";
- extern Key hxx_suffix = "hxx-suffix";
- extern Key ixx_suffix = "ixx-suffix";
- extern Key cxx_suffix = "cxx-suffix";
- extern Key fwd_suffix = "fwd-suffix";
- extern Key hxx_regex = "hxx-regex";
- extern Key ixx_regex = "ixx-regex";
- extern Key cxx_regex = "cxx-regex";
- extern Key fwd_regex = "fwd-regex";
- extern Key hxx_prologue = "hxx-prologue";
- extern Key ixx_prologue = "ixx-prologue";
- extern Key cxx_prologue = "cxx-prologue";
- extern Key fwd_prologue = "fwd-prologue";
- extern Key prologue = "prologue";
- extern Key hxx_epilogue = "hxx-epilogue";
- extern Key ixx_epilogue = "ixx-epilogue";
- extern Key cxx_epilogue = "cxx-epilogue";
- extern Key fwd_epilogue = "fwd-epilogue";
- extern Key epilogue = "epilogue";
- extern Key hxx_prologue_file = "hxx-prologue-file";
- extern Key ixx_prologue_file = "ixx-prologue-file";
- extern Key cxx_prologue_file = "cxx-prologue-file";
- extern Key fwd_prologue_file = "fwd-prologue-file";
- extern Key prologue_file = "prologue-file";
- extern Key hxx_epilogue_file = "hxx-epilogue-file";
- extern Key ixx_epilogue_file = "ixx-epilogue-file";
- extern Key cxx_epilogue_file = "cxx-epilogue-file";
- extern Key fwd_epilogue_file = "fwd-epilogue-file";
- extern Key epilogue_file = "epilogue-file";
- extern Key show_anonymous = "show-anonymous";
- extern Key show_sloc = "show-sloc";
- extern Key proprietary_license = "proprietary-license";
- }
- }
-
Void Hybrid::Generator::
usage ()
{
@@ -214,34 +114,6 @@ namespace CXX
CXX::options::print_usage (wcout);
}
- Hybrid::CLI::OptionsSpec Hybrid::Generator::
- options_spec ()
- {
- CLI::OptionsSpec spec;
-
- spec.option<CLI::char_encoding> ().default_value ("utf8");
-
- spec.option<CLI::pskel_file_suffix> ().default_value ("-pskel");
- spec.option<CLI::sskel_file_suffix> ().default_value ("-sskel");
- spec.option<CLI::pskel_type_suffix> ().default_value ("_pskel");
- spec.option<CLI::sskel_type_suffix> ().default_value ("_sskel");
-
- spec.option<CLI::pimpl_file_suffix> ().default_value ("-pimpl");
- spec.option<CLI::simpl_file_suffix> ().default_value ("-simpl");
- spec.option<CLI::pimpl_type_suffix> ().default_value ("_pimpl");
- spec.option<CLI::simpl_type_suffix> ().default_value ("_simpl");
-
- spec.option<CLI::paggr_type_suffix> ().default_value ("_paggr");
- spec.option<CLI::saggr_type_suffix> ().default_value ("_saggr");
-
- spec.option<CLI::hxx_suffix> ().default_value (".hxx");
- spec.option<CLI::ixx_suffix> ().default_value (".ixx");
- spec.option<CLI::cxx_suffix> ().default_value (".cxx");
- spec.option<CLI::fwd_suffix> ().default_value ("-fwd.hxx");
-
- return spec;
- }
-
namespace
{
typedef
@@ -253,12 +125,10 @@ namespace CXX
sloc_filter;
NarrowString
- find_value (Cult::Containers::Vector<NarrowString> const& v,
- Char const* key)
+ find_value (NarrowStrings const& v, Char const* key)
{
- typedef Cult::Containers::Vector<NarrowString> Values;
-
- for (Values::ConstIterator i (v.begin ()), e (v.end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
+ i != e; ++i)
{
Size p (i->find ('='));
@@ -292,13 +162,12 @@ namespace CXX
}
Void
- copy_values (Cult::Containers::Vector<NarrowString>& dst,
- Cult::Containers::Vector<NarrowString> const& src,
- Char const* key)
+ copy_values (NarrowStrings& dst, NarrowStrings const& src, Char const* key)
{
- typedef Cult::Containers::Vector<NarrowString> Values;
+ dst.clear ();
- for (Values::ConstIterator i (src.begin ()), e (src.end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (src.begin ()), e (src.end ());
+ i != e; ++i)
{
Size p (i->find ('='));
@@ -340,8 +209,6 @@ namespace CXX
void
traverse (Type& ns)
{
- namespace CLI = Hybrid::CLI;
-
pre (ns);
os << "using ::xsde::cxx::hybrid::any_type;"
@@ -352,16 +219,16 @@ namespace CXX
if (type_ == 'p')
{
- skel = options.value<CLI::pskel_type_suffix> ();
- impl = options.value<CLI::pimpl_type_suffix> ();
+ skel = options.pskel_type_suffix ();
+ impl = options.pimpl_type_suffix ();
us = skel == L"_pskel";
ui = impl == L"_pimpl";
}
else
{
- skel = options.value<CLI::sskel_type_suffix> ();
- impl = options.value<CLI::simpl_type_suffix> ();
+ skel = options.sskel_type_suffix ();
+ impl = options.simpl_type_suffix ();
us = skel == L"_sskel";
ui = impl == L"_simpl";
@@ -387,85 +254,46 @@ namespace CXX
};
}
- Parser::CLI::Options* Hybrid::Generator::
- parser_options (CLI::Options const& h, Schema& schema, Path const& path)
+ auto_ptr<Parser::options> Hybrid::Generator::
+ parser_options (options const& h, Schema& schema, Path const& path)
{
- namespace H = CLI;
- namespace P = Parser::CLI;
-
- Evptr<P::Options> r (new P::Options);
-
- r->value<P::char_encoding> () = h.value<H::char_encoding> ();
- r->value<P::no_stl> () = h.value<H::no_stl> ();
- r->value<P::no_iostream> () = h.value<H::no_iostream> ();
- r->value<P::no_exceptions> () = h.value<H::no_exceptions> ();
- r->value<P::no_long_long> () = h.value<H::no_long_long> ();
- r->value<P::reuse_style_mixin> () = h.value<H::reuse_style_mixin> ();
- r->value<P::reuse_style_none> () = false;
- r->value<P::generate_inline> () = h.value<H::generate_inline> ();
- r->value<P::suppress_validation> () = h.value<H::suppress_validation> ()
- || h.value<H::suppress_parser_val> ();
- r->value<P::generate_xml_schema> () = h.value<H::generate_xml_schema> ();
- r->value<P::extern_xml_schema> () = h.value<H::extern_xml_schema> ();
- r->value<P::suppress_reset> () = h.value<H::suppress_reset> ();
- r->value<P::custom_allocator> () = h.value<H::custom_allocator> ();
- r->value<P::generate_polymorphic> () = h.value<H::generate_polymorphic> ();
- r->value<P::runtime_polymorphic> () = h.value<H::runtime_polymorphic> ();
- r->value<P::output_dir> () = h.value<H::output_dir> ();
- r->value<P::skel_file_suffix> () = h.value<H::pskel_file_suffix> ();
- r->value<P::skel_type_suffix> () = h.value<H::pskel_type_suffix> ();
- r->value<P::impl_type_suffix> () = h.value<H::pimpl_type_suffix> ();
- r->value<P::namespace_map> () = h.value<H::namespace_map> ();
- r->value<P::namespace_regex> () = h.value<H::namespace_regex> ();
- r->value<P::namespace_regex_trace> () = h.value<H::namespace_regex_trace> ();
- r->value<P::reserved_name> () = h.value<H::reserved_name> ();
- r->value<P::include_with_brackets> () = h.value<H::include_with_brackets> ();
- r->value<P::include_prefix> () = h.value<H::include_prefix> ();
- r->value<P::include_regex> () = h.value<H::include_regex> ();
- r->value<P::include_regex_trace> () = h.value<H::include_regex_trace> ();
- r->value<P::guard_prefix> () = h.value<H::guard_prefix> ();
-
- r->value<P::hxx_suffix> () = h.value<H::hxx_suffix> ();
- r->value<P::ixx_suffix> () = h.value<H::ixx_suffix> ();
- r->value<P::cxx_suffix> () = h.value<H::cxx_suffix> ();
+ auto_ptr<Parser::options> r (new Parser::options);
+
+ static_cast<CXX::options&> (*r) = h; // Assign common options.
+
+ r->reuse_style_mixin (h.reuse_style_mixin ());
+ r->suppress_validation (h.suppress_validation () ||
+ h.suppress_parser_val ());
+ r->generate_polymorphic (h.generate_polymorphic ());
+ r->runtime_polymorphic (h.runtime_polymorphic ());
+
+ r->skel_file_suffix (h.pskel_file_suffix ());
+ r->skel_type_suffix (h.pskel_type_suffix ());
+ r->impl_type_suffix (h.pimpl_type_suffix ());
Char const* k = "pskel";
- r->value<P::hxx_regex> () =
- find_value (h.value<H::hxx_regex> (), k);
- r->value<P::ixx_regex> () =
- find_value (h.value<H::ixx_regex> (), k);
- r->value<P::cxx_regex> () =
- find_value (h.value<H::cxx_regex> (), k);
-
- r->value<P::hxx_prologue_file> () = find_value (
- h.value<H::hxx_prologue_file> (), k);
- r->value<P::ixx_prologue_file> () = find_value (
- h.value<H::ixx_prologue_file> (), k);
- r->value<P::cxx_prologue_file> () = find_value (
- h.value<H::cxx_prologue_file> (), k);
- r->value<P::prologue_file> () = find_value (
- h.value<H::prologue_file> (), k);
- r->value<P::hxx_epilogue_file> () = find_value (
- h.value<H::hxx_epilogue_file> (), k);
- r->value<P::ixx_epilogue_file> () = find_value (
- h.value<H::ixx_epilogue_file> (), k);
- r->value<P::cxx_epilogue_file> () = find_value (
- h.value<H::cxx_epilogue_file> (), k);
- r->value<P::epilogue_file> () = find_value (
- h.value<H::epilogue_file> (), k);
-
- copy_values (r->value<P::hxx_prologue> (), h.value<H::hxx_prologue> (), k);
- copy_values (r->value<P::ixx_prologue> (), h.value<H::ixx_prologue> (), k);
- copy_values (r->value<P::cxx_prologue> (), h.value<H::cxx_prologue> (), k);
- copy_values (r->value<P::prologue> (), h.value<H::prologue> (), k);
- copy_values (r->value<P::hxx_epilogue> (), h.value<H::hxx_epilogue> (), k);
- copy_values (r->value<P::ixx_epilogue> (), h.value<H::ixx_epilogue> (), k);
- copy_values (r->value<P::cxx_epilogue> (), h.value<H::cxx_epilogue> (), k);
- copy_values (r->value<P::epilogue> (), h.value<H::epilogue> (), k);
-
- r->value<P::show_sloc> () = h.value<H::show_sloc> ();
- r->value<P::proprietary_license> () = h.value<H::proprietary_license> ();
+ r->hxx_regex (find_value (h.hxx_regex (), k));
+ r->ixx_regex (find_value (h.ixx_regex (), k));
+ r->cxx_regex (find_value (h.cxx_regex (), k));
+
+ r->prologue_file (find_value (h.prologue_file (), k));
+ r->epilogue_file (find_value (h.epilogue_file (), k));
+ r->hxx_prologue_file (find_value (h.hxx_prologue_file (), k));
+ r->ixx_prologue_file (find_value (h.ixx_prologue_file (), k));
+ r->cxx_prologue_file (find_value (h.cxx_prologue_file (), k));
+ r->hxx_epilogue_file (find_value (h.hxx_epilogue_file (), k));
+ r->ixx_epilogue_file (find_value (h.ixx_epilogue_file (), k));
+ r->cxx_epilogue_file (find_value (h.cxx_epilogue_file (), k));
+
+ copy_values (r->prologue (), h.prologue (), k);
+ copy_values (r->epilogue (), h.epilogue (), k);
+ copy_values (r->hxx_prologue (), h.hxx_prologue (), k);
+ copy_values (r->ixx_prologue (), h.ixx_prologue (), k);
+ copy_values (r->cxx_prologue (), h.cxx_prologue (), k);
+ copy_values (r->hxx_epilogue (), h.hxx_epilogue (), k);
+ copy_values (r->ixx_epilogue (), h.ixx_epilogue (), k);
+ copy_values (r->cxx_epilogue (), h.cxx_epilogue (), k);
// Add the anyType parser.
//
@@ -486,91 +314,52 @@ namespace CXX
ns.dispatch (ctx.xs_ns ());
}
- r->value<P::hxx_prologue> ().push_back (String (os.str ()).to_narrow ());
+ r->hxx_prologue ().push_back (String (os.str ()).to_narrow ());
}
- return r.release ();
+ return r;
}
- Serializer::CLI::Options* Hybrid::Generator::
- serializer_options (CLI::Options const& h, Schema& schema, Path const& path)
+ auto_ptr<Serializer::options> Hybrid::Generator::
+ serializer_options (options const& h, Schema& schema, Path const& path)
{
- namespace H = CLI;
- namespace S = Serializer::CLI;
-
- Evptr<S::Options> r (new S::Options);
-
- r->value<S::char_encoding> () = h.value<H::char_encoding> ();
- r->value<S::no_stl> () = h.value<H::no_stl> ();
- r->value<S::no_iostream> () = h.value<H::no_iostream> ();
- r->value<S::no_exceptions> () = h.value<H::no_exceptions> ();
- r->value<S::no_long_long> () = h.value<H::no_long_long> ();
- r->value<S::reuse_style_mixin> () = h.value<H::reuse_style_mixin> ();
- r->value<S::reuse_style_none> () = false;
- r->value<S::generate_inline> () = h.value<H::generate_inline> ();
- r->value<S::suppress_validation> () = h.value<H::suppress_validation> ()
- || h.value<H::suppress_serializer_val> ();
- r->value<S::generate_xml_schema> () = h.value<H::generate_xml_schema> ();
- r->value<S::extern_xml_schema> () = h.value<H::extern_xml_schema> ();
- r->value<S::suppress_reset> () = h.value<H::suppress_reset> ();
- r->value<S::custom_allocator> () = h.value<H::custom_allocator> ();
- r->value<S::generate_polymorphic> () = h.value<H::generate_polymorphic> ();
- r->value<S::runtime_polymorphic> () = h.value<H::runtime_polymorphic> ();
- r->value<S::output_dir> () = h.value<H::output_dir> ();
- r->value<S::skel_file_suffix> () = h.value<H::sskel_file_suffix> ();
- r->value<S::skel_type_suffix> () = h.value<H::sskel_type_suffix> ();
- r->value<S::impl_type_suffix> () = h.value<H::simpl_type_suffix> ();
- r->value<S::namespace_map> () = h.value<H::namespace_map> ();
- r->value<S::namespace_regex> () = h.value<H::namespace_regex> ();
- r->value<S::namespace_regex_trace> () = h.value<H::namespace_regex_trace> ();
- r->value<S::reserved_name> () = h.value<H::reserved_name> ();
- r->value<S::include_with_brackets> () = h.value<H::include_with_brackets> ();
- r->value<S::include_prefix> () = h.value<H::include_prefix> ();
- r->value<S::include_regex> () = h.value<H::include_regex> ();
- r->value<S::include_regex_trace> () = h.value<H::include_regex_trace> ();
- r->value<S::guard_prefix> () = h.value<H::guard_prefix> ();
-
- r->value<S::hxx_suffix> () = h.value<H::hxx_suffix> ();
- r->value<S::ixx_suffix> () = h.value<H::ixx_suffix> ();
- r->value<S::cxx_suffix> () = h.value<H::cxx_suffix> ();
-
- Char const* k = "sskel";
-
- r->value<S::hxx_regex> () =
- find_value (h.value<H::hxx_regex> (), k);
- r->value<S::ixx_regex> () =
- find_value (h.value<H::ixx_regex> (), k);
- r->value<S::cxx_regex> () =
- find_value (h.value<H::cxx_regex> (), k);
-
- r->value<S::hxx_prologue_file> () = find_value (
- h.value<H::hxx_prologue_file> (), k);
- r->value<S::ixx_prologue_file> () = find_value (
- h.value<H::ixx_prologue_file> (), k);
- r->value<S::cxx_prologue_file> () = find_value (
- h.value<H::cxx_prologue_file> (), k);
- r->value<S::prologue_file> () = find_value (
- h.value<H::prologue_file> (), k);
- r->value<S::hxx_epilogue_file> () = find_value (
- h.value<H::hxx_epilogue_file> (), k);
- r->value<S::ixx_epilogue_file> () = find_value (
- h.value<H::ixx_epilogue_file> (), k);
- r->value<S::cxx_epilogue_file> () = find_value (
- h.value<H::cxx_epilogue_file> (), k);
- r->value<S::epilogue_file> () = find_value (
- h.value<H::epilogue_file> (), k);
-
- copy_values (r->value<S::hxx_prologue> (), h.value<H::hxx_prologue> (), k);
- copy_values (r->value<S::ixx_prologue> (), h.value<H::ixx_prologue> (), k);
- copy_values (r->value<S::cxx_prologue> (), h.value<H::cxx_prologue> (), k);
- copy_values (r->value<S::prologue> (), h.value<H::prologue> (), k);
- copy_values (r->value<S::hxx_epilogue> (), h.value<H::hxx_epilogue> (), k);
- copy_values (r->value<S::ixx_epilogue> (), h.value<H::ixx_epilogue> (), k);
- copy_values (r->value<S::cxx_epilogue> (), h.value<H::cxx_epilogue> (), k);
- copy_values (r->value<S::epilogue> (), h.value<H::epilogue> (), k);
-
- r->value<S::show_sloc> () = h.value<H::show_sloc> ();
- r->value<S::proprietary_license> () = h.value<H::proprietary_license> ();
+ auto_ptr<Serializer::options> r (new Serializer::options);
+
+ static_cast<CXX::options&> (*r) = h; // Assign common options.
+
+ r->reuse_style_mixin (h.reuse_style_mixin ());
+ r->suppress_validation (h.suppress_validation () ||
+ h.suppress_serializer_val ());
+ r->generate_polymorphic (h.generate_polymorphic ());
+ r->runtime_polymorphic (h.runtime_polymorphic ());
+
+ r->skel_file_suffix (h.sskel_file_suffix ());
+ r->skel_type_suffix (h.sskel_type_suffix ());
+ r->impl_type_suffix (h.simpl_type_suffix ());
+
+ Char const* k = "pskel";
+
+ r->hxx_regex (find_value (h.hxx_regex (), k));
+ r->ixx_regex (find_value (h.ixx_regex (), k));
+ r->cxx_regex (find_value (h.cxx_regex (), k));
+
+ r->prologue_file (find_value (h.prologue_file (), k));
+ r->epilogue_file (find_value (h.epilogue_file (), k));
+ r->hxx_prologue_file (find_value (h.hxx_prologue_file (), k));
+ r->ixx_prologue_file (find_value (h.ixx_prologue_file (), k));
+ r->cxx_prologue_file (find_value (h.cxx_prologue_file (), k));
+ r->hxx_epilogue_file (find_value (h.hxx_epilogue_file (), k));
+ r->ixx_epilogue_file (find_value (h.ixx_epilogue_file (), k));
+ r->cxx_epilogue_file (find_value (h.cxx_epilogue_file (), k));
+
+ copy_values (r->prologue (), h.prologue (), k);
+ copy_values (r->epilogue (), h.epilogue (), k);
+ copy_values (r->hxx_prologue (), h.hxx_prologue (), k);
+ copy_values (r->ixx_prologue (), h.ixx_prologue (), k);
+ copy_values (r->cxx_prologue (), h.cxx_prologue (), k);
+ copy_values (r->hxx_epilogue (), h.hxx_epilogue (), k);
+ copy_values (r->ixx_epilogue (), h.ixx_epilogue (), k);
+ copy_values (r->cxx_epilogue (), h.cxx_epilogue (), k);
// Add the anyType parser.
//
@@ -591,14 +380,14 @@ namespace CXX
ns.dispatch (ctx.xs_ns ());
}
- r->value<S::hxx_prologue> ().push_back (String (os.str ()).to_narrow ());
+ r->hxx_prologue ().push_back (String (os.str ()).to_narrow ());
}
- return r.release ();
+ return r;
}
Void Hybrid::Generator::
- calculate_size (CLI::Options const& ops,
+ calculate_size (options const& ops,
XSDFrontend::SemanticGraph::Schema& schema,
XSDFrontend::SemanticGraph::Path const& file,
const WarningSet& disabled_warnings)
@@ -612,7 +401,7 @@ namespace CXX
}
Void Hybrid::Generator::
- process_tree_names (CLI::Options const& ops,
+ process_tree_names (options const& ops,
XSDFrontend::SemanticGraph::Schema& schema,
XSDFrontend::SemanticGraph::Path const& file)
{
@@ -621,7 +410,7 @@ namespace CXX
}
Void Hybrid::Generator::
- process_parser_names (CLI::Options const& ops,
+ process_parser_names (options const& ops,
XSDFrontend::SemanticGraph::Schema& schema,
XSDFrontend::SemanticGraph::Path const& file)
{
@@ -631,7 +420,7 @@ namespace CXX
}
Void Hybrid::Generator::
- process_serializer_names (CLI::Options const& ops,
+ process_serializer_names (options const& ops,
XSDFrontend::SemanticGraph::Schema& schema,
XSDFrontend::SemanticGraph::Path const& file)
{
@@ -690,19 +479,20 @@ namespace CXX
Void
append (WideOutputFileStream& os,
- Cult::Containers::Vector<NarrowString> const& primary,
- Cult::Containers::Vector<NarrowString> const& def,
+ NarrowStrings const& primary,
+ NarrowStrings const& def,
Char const* primary_key,
Char const* def_key)
{
- typedef Cult::Containers::Vector<NarrowString> Values;
-
- for (Values const* v = &primary; v != 0; v = (v == &def ? 0 : &def))
+ for (NarrowStrings const* v = &primary;
+ v != 0;
+ v = (v == &def ? 0 : &def))
{
Boolean found (false);
Char const* key (v == &primary ? primary_key : def_key);
- for (Values::ConstIterator i (v->begin ()), e (v->end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (v->begin ()), e (v->end ());
+ i != e; ++i)
{
if (key == 0)
os << i->c_str () << endl;
@@ -747,8 +537,8 @@ namespace CXX
Void
append (WideOutputFileStream& os,
- Cult::Containers::Vector<NarrowString> const& primary,
- Cult::Containers::Vector<NarrowString> const& def,
+ NarrowStrings const& primary,
+ NarrowStrings const& def,
Char const* key)
{
append (os, primary, def, key, key);
@@ -757,7 +547,7 @@ namespace CXX
UnsignedLong Hybrid::Generator::
- generate_tree (Hybrid::CLI::Options const& ops,
+ generate_tree (Hybrid::options const& ops,
Schema& schema,
Path const& file_path,
Boolean fpt,
@@ -772,7 +562,7 @@ namespace CXX
try
{
- Boolean generate_xml_schema (ops.value<CLI::generate_xml_schema> ());
+ Boolean generate_xml_schema (ops.generate_xml_schema ());
// We could be compiling several schemas at once in which case
// handling of the --generate-xml-schema option gets tricky: we
@@ -781,7 +571,7 @@ namespace CXX
//
if (generate_xml_schema)
{
- if (NarrowString name = ops.value<CLI::extern_xml_schema> ())
+ if (NarrowString name = ops.extern_xml_schema ())
{
if (file_path.native_file_string () != name)
generate_xml_schema = false;
@@ -805,24 +595,20 @@ namespace CXX
// Generate code.
//
- Boolean inline_ (ops.value<CLI::generate_inline> () &&
- !generate_xml_schema);
-
- Boolean forward (ops.value<CLI::generate_forward> () &&
- !generate_xml_schema);
-
+ Boolean inline_ (ops.generate_inline () && !generate_xml_schema);
+ Boolean forward (ops.generate_forward () && !generate_xml_schema);
Boolean source (!generate_xml_schema);
NarrowString name (file_path.leaf ());
- NarrowString hxx_suffix (ops.value <CLI::hxx_suffix> ());
- NarrowString ixx_suffix (ops.value <CLI::ixx_suffix> ());
- NarrowString cxx_suffix (ops.value <CLI::cxx_suffix> ());
- NarrowString fwd_suffix (ops.value <CLI::fwd_suffix> ());
+ NarrowString hxx_suffix (ops.hxx_suffix ());
+ NarrowString ixx_suffix (ops.ixx_suffix ());
+ NarrowString cxx_suffix (ops.cxx_suffix ());
+ NarrowString fwd_suffix (ops.fwd_suffix ());
- NarrowString hxx_regex (find_value (ops.value <CLI::hxx_regex> (), ""));
- NarrowString ixx_regex (find_value (ops.value <CLI::ixx_regex> (), ""));
- NarrowString cxx_regex (find_value (ops.value <CLI::cxx_regex> (), ""));
+ NarrowString hxx_regex (find_value (ops.hxx_regex (), ""));
+ NarrowString ixx_regex (find_value (ops.ixx_regex (), ""));
+ NarrowString cxx_regex (find_value (ops.cxx_regex (), ""));
Regex hxx_expr (
hxx_regex.empty ()
@@ -840,9 +626,9 @@ namespace CXX
: cxx_regex);
Regex fwd_expr (
- ops.value <CLI::fwd_regex> ().empty ()
+ ops.fwd_regex ().empty ()
? "#^(.+?)(\\.[^./\\\\]+)?$#$1" + fwd_suffix + "#"
- : ops.value <CLI::fwd_regex> ());
+ : ops.fwd_regex ());
if (!hxx_expr.match (name))
{
@@ -888,7 +674,7 @@ namespace CXX
Path out_dir;
- if (NarrowString dir = ops.value<CLI::output_dir> ())
+ if (NarrowString dir = ops.output_dir ())
{
try
{
@@ -984,9 +770,7 @@ namespace CXX
// Print copyright and license.
//
Char const* copyright (
- ops.value<CLI::proprietary_license> ()
- ? copyright_proprietary
- : copyright_gpl);
+ ops.proprietary_license () ? copyright_proprietary : copyright_gpl);
if (forward)
fwd << copyright;
@@ -1003,8 +787,7 @@ namespace CXX
//
WideInputFileStream prologue;
{
- NarrowString name (
- find_value (ops.value<CLI::prologue_file> (), ""));
+ NarrowString name (find_value (ops.prologue_file (), ""));
if (name)
open (prologue, name);
@@ -1014,8 +797,7 @@ namespace CXX
//
WideInputFileStream epilogue;
{
- NarrowString name (
- find_value (ops.value<CLI::epilogue_file> (), ""));
+ NarrowString name (find_value (ops.epilogue_file (), ""));
if (name)
open (epilogue, name);
@@ -1023,14 +805,14 @@ namespace CXX
// SLOC counter.
//
- UnsignedLong sloc_total (0);
- Boolean show_sloc (ops.value<CLI::show_sloc> ());
+ size_t sloc_total (0);
+ Boolean show_sloc (ops.show_sloc ());
//
//
Regex guard_expr ("/([a-z])([A-Z])/$1_$2/"); // Split words.
- NarrowString guard_prefix (ops.value<CLI::guard_prefix> ());
+ NarrowString guard_prefix (ops.guard_prefix ());
if (!guard_prefix)
guard_prefix = file_path.branch_path ().native_directory_string ();
@@ -1073,12 +855,8 @@ namespace CXX
fwd << "// Begin prologue." << endl
<< "//" << endl;
- append (fwd,
- ops.value<CLI::fwd_prologue> (),
- ops.value<CLI::prologue> (),
- 0,
- "");
- append (fwd, ops.value<CLI::fwd_prologue_file> (), prologue);
+ append (fwd, ops.fwd_prologue (), ops.prologue (), 0, "");
+ append (fwd, ops.fwd_prologue_file (), prologue);
fwd << "//" << endl
<< "// End prologue." << endl
@@ -1096,12 +874,8 @@ namespace CXX
fwd << "// Begin epilogue." << endl
<< "//" << endl;
- append (fwd, ops.value<CLI::fwd_epilogue_file> (), epilogue);
- append (fwd,
- ops.value<CLI::fwd_epilogue> (),
- ops.value<CLI::epilogue> (),
- 0,
- "");
+ append (fwd, ops.fwd_epilogue_file (), epilogue);
+ append (fwd, ops.fwd_epilogue (), ops.epilogue (), 0, "");
fwd << "//" << endl
<< "// End epilogue." << endl
@@ -1155,7 +929,7 @@ namespace CXX
hxx << "#include <xsde/cxx/config.hxx>" << endl
<< endl;
- if (ops.value<CLI::char_encoding> () == "iso8859-1")
+ if (ops.char_encoding () == "iso8859-1")
{
hxx << "#ifndef XSDE_ENCODING_ISO8859_1" << endl
<< "#error the generated code uses the ISO-8859-1 encoding" <<
@@ -1174,7 +948,7 @@ namespace CXX
<< endl;
}
- if (ops.value<CLI::no_stl> ())
+ if (ops.no_stl ())
{
hxx << "#ifdef XSDE_STL" << endl
<< "#error the XSD/e runtime uses STL while the " <<
@@ -1193,7 +967,7 @@ namespace CXX
<< endl;
}
- if (ops.value<CLI::no_exceptions> ())
+ if (ops.no_exceptions ())
{
hxx << "#ifdef XSDE_EXCEPTIONS" << endl
<< "#error the XSD/e runtime uses exceptions while the " <<
@@ -1212,7 +986,7 @@ namespace CXX
<< endl;
}
- if (ops.value<CLI::no_long_long> ())
+ if (ops.no_long_long ())
{
hxx << "#ifdef XSDE_LONGLONG" << endl
<< "#error the XSD/e runtime uses long long while the " <<
@@ -1231,7 +1005,7 @@ namespace CXX
<< endl;
}
- if (ops.value<CLI::custom_allocator> ())
+ if (ops.custom_allocator ())
{
hxx << "#ifndef XSDE_CUSTOM_ALLOCATOR" << endl
<< "#error the generated code uses custom allocator while " <<
@@ -1261,13 +1035,8 @@ namespace CXX
hxx << "// Begin prologue." << endl
<< "//" << endl;
- append (hxx,
- ops.value<CLI::hxx_prologue> (),
- ops.value<CLI::prologue> (),
- "");
- append (hxx,
- find_value (ops.value<CLI::hxx_prologue_file> (), ""),
- prologue);
+ append (hxx, ops.hxx_prologue (), ops.prologue (), "");
+ append (hxx, find_value (ops.hxx_prologue_file (), ""), prologue);
hxx << "//" << endl
<< "// End prologue." << endl
@@ -1288,10 +1057,10 @@ namespace CXX
generate_tree_header (ctx);
- if (!ops.value<CLI::generate_insertion> ().empty ())
+ if (!ops.generate_insertion ().empty ())
generate_insertion_header (ctx);
- if (!ops.value<CLI::generate_extraction> ().empty ())
+ if (!ops.generate_extraction ().empty ())
generate_extraction_header (ctx);
}
else
@@ -1311,13 +1080,8 @@ namespace CXX
hxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (hxx,
- find_value (ops.value<CLI::hxx_epilogue_file> (), ""),
- epilogue);
- append (hxx,
- ops.value<CLI::hxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "");
+ append (hxx, find_value (ops.hxx_epilogue_file (), ""), epilogue);
+ append (hxx, ops.hxx_epilogue (), ops.epilogue (), "");
hxx << "//" << endl
<< "// End epilogue." << endl
@@ -1358,13 +1122,8 @@ namespace CXX
ixx << "// Begin prologue." << endl
<< "//" << endl;
- append (ixx,
- ops.value<CLI::ixx_prologue> (),
- ops.value<CLI::prologue> (),
- "");
- append (ixx,
- find_value (ops.value<CLI::ixx_prologue_file> (), ""),
- prologue);
+ append (ixx, ops.ixx_prologue (), ops.prologue (), "");
+ append (ixx, find_value (ops.ixx_prologue_file (), ""), prologue);
ixx << "//" << endl
<< "// End prologue." << endl
@@ -1382,13 +1141,8 @@ namespace CXX
ixx << "// Begin epilogue." << endl
<< "//" << endl;
- append (ixx,
- find_value (ops.value<CLI::ixx_epilogue_file> (), ""),
- epilogue);
- append (ixx,
- ops.value<CLI::ixx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "");
+ append (ixx, find_value (ops.ixx_epilogue_file (), ""), epilogue);
+ append (ixx, ops.ixx_epilogue (), ops.epilogue (), "");
ixx << "//" << endl
<< "// End epilogue." << endl
@@ -1419,13 +1173,8 @@ namespace CXX
cxx << "// Begin prologue." << endl
<< "//" << endl;
- append (cxx,
- ops.value<CLI::cxx_prologue> (),
- ops.value<CLI::prologue> (),
- "");
- append (cxx,
- find_value (ops.value<CLI::cxx_prologue_file> (), ""),
- prologue);
+ append (cxx, ops.cxx_prologue (), ops.prologue (), "");
+ append (cxx, find_value (ops.cxx_prologue_file (), ""), prologue);
cxx << "//" << endl
<< "// End prologue." << endl
@@ -1444,10 +1193,10 @@ namespace CXX
generate_tree_source (ctx);
- if (!ops.value<CLI::generate_insertion> ().empty ())
+ if (!ops.generate_insertion ().empty ())
generate_insertion_source (ctx);
- if (!ops.value<CLI::generate_extraction> ().empty ())
+ if (!ops.generate_extraction ().empty ())
generate_extraction_source (ctx);
}
@@ -1456,13 +1205,8 @@ namespace CXX
cxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (cxx,
- find_value (ops.value<CLI::cxx_epilogue_file> (), ""),
- epilogue);
- append (cxx,
- ops.value<CLI::cxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "");
+ append (cxx, find_value (ops.cxx_epilogue_file (), ""), epilogue);
+ append (cxx, ops.cxx_epilogue (), ops.epilogue (), "");
cxx << "//" << endl
<< "// End epilogue." << endl
@@ -1480,15 +1224,14 @@ namespace CXX
// Populate the type maps if we are generating parsing or
// serialization code.
//
- if (ops.value<CLI::generate_parser> () ||
- ops.value<CLI::generate_serializer> ())
+ if (ops.generate_parser () || ops.generate_serializer ())
{
generate_tree_type_map (ops, schema, file_path, hxx_name,
parser_type_map, serializer_type_map);
// Re-map anyType.
//
- if (ops.value<CLI::generate_parser> ())
+ if (ops.generate_parser ())
{
parser_type_map.push_back (
TypeMap::Namespace ("http://www.w3.org/2001/XMLSchema"));
@@ -1497,7 +1240,7 @@ namespace CXX
xs.types_push_back ("anyType", xs_ns + L"::any_type*");
}
- if (ops.value<CLI::generate_serializer> ())
+ if (ops.generate_serializer ())
{
serializer_type_map.push_back (
TypeMap::Namespace ("http://www.w3.org/2001/XMLSchema"));
@@ -1546,7 +1289,7 @@ namespace CXX
}
UnsignedLong Hybrid::Generator::
- generate_parser (Hybrid::CLI::Options const& ops,
+ generate_parser (Hybrid::options const& ops,
Schema& schema,
Path const& file_path,
Boolean fpt,
@@ -1560,7 +1303,7 @@ namespace CXX
try
{
{
- Boolean gen_xml_schema (ops.value<CLI::generate_xml_schema> ());
+ Boolean gen_xml_schema (ops.generate_xml_schema ());
// We could be compiling several schemas at once in which case
// handling of the --generate-xml-schema option gets tricky: we
@@ -1569,7 +1312,7 @@ namespace CXX
//
if (gen_xml_schema)
{
- if (NarrowString name = ops.value<CLI::extern_xml_schema> ())
+ if (NarrowString name = ops.extern_xml_schema ())
{
if (file_path.native_file_string () != name)
gen_xml_schema = false;
@@ -1590,22 +1333,17 @@ namespace CXX
}
NarrowString name (file_path.leaf ());
- NarrowString skel_suffix (ops.value <CLI::pskel_file_suffix> ());
- NarrowString impl_suffix (ops.value <CLI::pimpl_file_suffix> ());
-
- NarrowString hxx_suffix (ops.value <CLI::hxx_suffix> ());
- NarrowString cxx_suffix (ops.value <CLI::cxx_suffix> ());
+ NarrowString skel_suffix (ops.pskel_file_suffix ());
+ NarrowString impl_suffix (ops.pimpl_file_suffix ());
- NarrowString hxx_obj_regex (
- find_value (ops.value <CLI::hxx_regex> (), ""));
+ NarrowString hxx_suffix (ops.hxx_suffix ());
+ NarrowString cxx_suffix (ops.cxx_suffix ());
- NarrowString hxx_skel_regex (
- find_value (ops.value <CLI::hxx_regex> (), "pskel"));
+ NarrowString hxx_obj_regex (find_value (ops.hxx_regex (), ""));
+ NarrowString hxx_skel_regex (find_value (ops.hxx_regex (), "pskel"));
- NarrowString hxx_regex (
- find_value (ops.value <CLI::hxx_regex> (), "pimpl"));
- NarrowString cxx_regex (
- find_value (ops.value <CLI::cxx_regex> (), "pimpl"));
+ NarrowString hxx_regex (find_value (ops.hxx_regex (), "pimpl"));
+ NarrowString cxx_regex (find_value (ops.cxx_regex (), "pimpl"));
// Here we need to make sure that hxx_obj_expr is the same
// as in generate().
@@ -1658,7 +1396,7 @@ namespace CXX
Path out_dir;
- if (NarrowString dir = ops.value<CLI::output_dir> ())
+ if (NarrowString dir = ops.output_dir ())
{
try
{
@@ -1713,9 +1451,7 @@ namespace CXX
// Print copyright and license.
//
Char const* copyright (
- ops.value<CLI::proprietary_license> ()
- ? copyright_proprietary
- : copyright_gpl);
+ ops.proprietary_license () ? copyright_proprietary : copyright_gpl);
hxx << copyright;
cxx << copyright;
@@ -1724,8 +1460,7 @@ namespace CXX
//
WideInputFileStream prologue;
{
- NarrowString name (
- find_value (ops.value<CLI::prologue_file> (), "pimpl"));
+ NarrowString name (find_value (ops.prologue_file (), "pimpl"));
if (name)
open (prologue, name);
@@ -1735,8 +1470,7 @@ namespace CXX
//
WideInputFileStream epilogue;
{
- NarrowString name (
- find_value (ops.value<CLI::epilogue_file> (), "pimpl"));
+ NarrowString name (find_value (ops.epilogue_file (), "pimpl"));
if (name)
open (epilogue, name);
@@ -1744,14 +1478,14 @@ namespace CXX
// SLOC counter.
//
- UnsignedLong sloc_total (0);
- Boolean show_sloc (ops.value<CLI::show_sloc> ());
+ size_t sloc_total (0);
+ Boolean show_sloc (ops.show_sloc ());
//
//
Regex guard_expr ("/([a-z])([A-Z])/$1_$2/"); // Split words.
- NarrowString guard_prefix (ops.value<CLI::guard_prefix> ());
+ NarrowString guard_prefix (ops.guard_prefix ());
if (!guard_prefix)
guard_prefix = file_path.branch_path ().native_directory_string ();
@@ -1759,7 +1493,7 @@ namespace CXX
if (guard_prefix)
guard_prefix += '_';
- Boolean aggr (ops.value<CLI::generate_aggregate> ());
+ Boolean aggr (ops.generate_aggregate ());
// HXX
//
@@ -1784,13 +1518,8 @@ namespace CXX
hxx << "// Begin prologue." << endl
<< "//" << endl;
- append (hxx,
- ops.value<CLI::hxx_prologue> (),
- ops.value<CLI::prologue> (),
- "pimpl");
- append (hxx,
- find_value (ops.value<CLI::hxx_prologue_file> (), "pimpl"),
- prologue);
+ append (hxx, ops.hxx_prologue (), ops.prologue (), "pimpl");
+ append (hxx, find_value (ops.hxx_prologue_file (), "pimpl"), prologue);
hxx << "//" << endl
<< "// End prologue." << endl
@@ -1838,13 +1567,8 @@ namespace CXX
hxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (hxx,
- find_value (ops.value<CLI::hxx_epilogue_file> (), "pimpl"),
- epilogue);
- append (hxx,
- ops.value<CLI::hxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "pimpl");
+ append (hxx, find_value (ops.hxx_epilogue_file (), "pimpl"), epilogue);
+ append (hxx, ops.hxx_epilogue (), ops.epilogue (), "pimpl");
hxx << "//" << endl
<< "// End epilogue." << endl
@@ -1873,13 +1597,8 @@ namespace CXX
cxx << "// Begin prologue." << endl
<< "//" << endl;
- append (cxx,
- ops.value<CLI::cxx_prologue> (),
- ops.value<CLI::prologue> (),
- "pimpl");
- append (cxx,
- find_value (ops.value<CLI::cxx_prologue_file> (), "pimpl"),
- prologue);
+ append (cxx, ops.cxx_prologue (), ops.prologue (), "pimpl");
+ append (cxx, find_value (ops.cxx_prologue_file (), "pimpl"), prologue);
cxx << "//" << endl
<< "// End prologue." << endl
@@ -1904,13 +1623,8 @@ namespace CXX
cxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (cxx,
- find_value (ops.value<CLI::cxx_epilogue_file> (), "pimpl"),
- epilogue);
- append (cxx,
- ops.value<CLI::cxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "pimpl");
+ append (cxx, find_value (ops.cxx_epilogue_file (), "pimpl"), epilogue);
+ append (cxx, ops.cxx_epilogue (), ops.epilogue (), "pimpl");
cxx << "//" << endl
<< "// End epilogue." << endl
@@ -1961,7 +1675,7 @@ namespace CXX
}
UnsignedLong Hybrid::Generator::
- generate_serializer (Hybrid::CLI::Options const& ops,
+ generate_serializer (Hybrid::options const& ops,
Schema& schema,
Path const& file_path,
Boolean fpt,
@@ -1975,7 +1689,7 @@ namespace CXX
try
{
{
- Boolean gen_xml_schema (ops.value<CLI::generate_xml_schema> ());
+ Boolean gen_xml_schema (ops.generate_xml_schema ());
// We could be compiling several schemas at once in which case
// handling of the --generate-xml-schema option gets tricky: we
@@ -1984,7 +1698,7 @@ namespace CXX
//
if (gen_xml_schema)
{
- if (NarrowString name = ops.value<CLI::extern_xml_schema> ())
+ if (NarrowString name = ops.extern_xml_schema ())
{
if (file_path.native_file_string () != name)
gen_xml_schema = false;
@@ -2005,21 +1719,17 @@ namespace CXX
}
NarrowString name (file_path.leaf ());
- NarrowString skel_suffix (ops.value <CLI::sskel_file_suffix> ());
- NarrowString impl_suffix (ops.value <CLI::simpl_file_suffix> ());
+ NarrowString skel_suffix (ops.sskel_file_suffix ());
+ NarrowString impl_suffix (ops.simpl_file_suffix ());
- NarrowString hxx_suffix (ops.value <CLI::hxx_suffix> ());
- NarrowString cxx_suffix (ops.value <CLI::cxx_suffix> ());
+ NarrowString hxx_suffix (ops.hxx_suffix ());
+ NarrowString cxx_suffix (ops.cxx_suffix ());
- NarrowString hxx_obj_regex (
- find_value (ops.value <CLI::hxx_regex> (), ""));
+ NarrowString hxx_obj_regex (find_value (ops.hxx_regex (), ""));
- NarrowString hxx_skel_regex (
- find_value (ops.value <CLI::hxx_regex> (), "sskel"));
- NarrowString hxx_regex (
- find_value (ops.value <CLI::hxx_regex> (), "simpl"));
- NarrowString cxx_regex (
- find_value (ops.value <CLI::cxx_regex> (), "simpl"));
+ NarrowString hxx_skel_regex (find_value (ops.hxx_regex (), "sskel"));
+ NarrowString hxx_regex (find_value (ops.hxx_regex (), "simpl"));
+ NarrowString cxx_regex (find_value (ops.cxx_regex (), "simpl"));
// Here we need to make sure that hxx_obj_expr is the same
// as in generate().
@@ -2072,7 +1782,7 @@ namespace CXX
Path out_dir;
- if (NarrowString dir = ops.value<CLI::output_dir> ())
+ if (NarrowString dir = ops.output_dir ())
{
try
{
@@ -2127,9 +1837,7 @@ namespace CXX
// Print copyright and license.
//
Char const* copyright (
- ops.value<CLI::proprietary_license> ()
- ? copyright_proprietary
- : copyright_gpl);
+ ops.proprietary_license () ? copyright_proprietary : copyright_gpl);
hxx << copyright;
cxx << copyright;
@@ -2138,8 +1846,7 @@ namespace CXX
//
WideInputFileStream prologue;
{
- NarrowString name (
- find_value (ops.value<CLI::prologue_file> (), "simpl"));
+ NarrowString name (find_value (ops.prologue_file (), "simpl"));
if (name)
open (prologue, name);
@@ -2149,8 +1856,7 @@ namespace CXX
//
WideInputFileStream epilogue;
{
- NarrowString name (
- find_value (ops.value<CLI::epilogue_file> (), "simpl"));
+ NarrowString name (find_value (ops.epilogue_file (), "simpl"));
if (name)
open (epilogue, name);
@@ -2158,14 +1864,14 @@ namespace CXX
// SLOC counter.
//
- UnsignedLong sloc_total (0);
- Boolean show_sloc (ops.value<CLI::show_sloc> ());
+ size_t sloc_total (0);
+ Boolean show_sloc (ops.show_sloc ());
//
//
Regex guard_expr ("/([a-z])([A-Z])/$1_$2/"); // Split words.
- NarrowString guard_prefix (ops.value<CLI::guard_prefix> ());
+ NarrowString guard_prefix (ops.guard_prefix ());
if (!guard_prefix)
guard_prefix = file_path.branch_path ().native_directory_string ();
@@ -2173,7 +1879,7 @@ namespace CXX
if (guard_prefix)
guard_prefix += '_';
- Boolean aggr (ops.value<CLI::generate_aggregate> ());
+ Boolean aggr (ops.generate_aggregate ());
// HXX
//
@@ -2198,13 +1904,8 @@ namespace CXX
hxx << "// Begin prologue." << endl
<< "//" << endl;
- append (hxx,
- ops.value<CLI::hxx_prologue> (),
- ops.value<CLI::prologue> (),
- "simpl");
- append (hxx,
- find_value (ops.value<CLI::hxx_prologue_file> (), "simpl"),
- prologue);
+ append (hxx, ops.hxx_prologue (), ops.prologue (), "simpl");
+ append (hxx, find_value (ops.hxx_prologue_file (), "simpl"), prologue);
hxx << "//" << endl
<< "// End prologue." << endl
@@ -2252,13 +1953,8 @@ namespace CXX
hxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (hxx,
- find_value (ops.value<CLI::hxx_epilogue_file> (), "simpl"),
- epilogue);
- append (hxx,
- ops.value<CLI::hxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "simpl");
+ append (hxx, find_value (ops.hxx_epilogue_file (), "simpl"), epilogue);
+ append (hxx, ops.hxx_epilogue (), ops.epilogue (), "simpl");
hxx << "//" << endl
<< "// End epilogue." << endl
@@ -2287,13 +1983,8 @@ namespace CXX
cxx << "// Begin prologue." << endl
<< "//" << endl;
- append (cxx,
- ops.value<CLI::cxx_prologue> (),
- ops.value<CLI::prologue> (),
- "simpl");
- append (cxx,
- find_value (ops.value<CLI::cxx_prologue_file> (), "simpl"),
- prologue);
+ append (cxx, ops.cxx_prologue (), ops.prologue (), "simpl");
+ append (cxx, find_value (ops.cxx_prologue_file (), "simpl"), prologue);
cxx << "//" << endl
<< "// End prologue." << endl
@@ -2318,13 +2009,8 @@ namespace CXX
cxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (cxx,
- find_value (ops.value<CLI::cxx_epilogue_file> (), "simpl"),
- epilogue);
- append (cxx,
- ops.value<CLI::cxx_epilogue> (),
- ops.value<CLI::epilogue> (),
- "simpl");
+ append (cxx, find_value (ops.cxx_epilogue_file (), "simpl"), epilogue);
+ append (cxx, ops.cxx_epilogue (), ops.epilogue (), "simpl");
cxx << "//" << endl
<< "// End epilogue." << endl
diff --git a/xsde/cxx/hybrid/generator.hxx b/xsde/cxx/hybrid/generator.hxx
index 0b87007..cbef109 100644
--- a/xsde/cxx/hybrid/generator.hxx
+++ b/xsde/cxx/hybrid/generator.hxx
@@ -6,22 +6,21 @@
#ifndef CXX_HYBRID_GENERATOR_HXX
#define CXX_HYBRID_GENERATOR_HXX
+#include <memory> // std::auto_ptr
+
#include <cult/types.hxx>
#include <cult/containers/vector.hxx>
-#include <cult/cli/options.hxx>
-#include <cult/cli/options-spec.hxx>
-
#include <xsd-frontend/semantic-graph/elements.hxx> // Path
#include <xsd-frontend/semantic-graph/schema.hxx>
#include <xsde.hxx>
#include <type-map/type-map.hxx>
-#include <cxx/hybrid/cli.hxx>
-#include <cxx/parser/cli.hxx>
-#include <cxx/serializer/cli.hxx>
+#include <cxx/parser/options.hxx>
+#include <cxx/serializer/options.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -37,16 +36,13 @@ namespace CXX
static Void
usage ();
- static CLI::OptionsSpec
- options_spec ();
-
- static Parser::CLI::Options*
- parser_options (CLI::Options const&,
+ static std::auto_ptr<Parser::options>
+ parser_options (options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&);
- static Serializer::CLI::Options*
- serializer_options (CLI::Options const&,
+ static std::auto_ptr<Serializer::options>
+ serializer_options (options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&);
@@ -54,7 +50,7 @@ namespace CXX
//
static Void
calculate_size (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&,
WarningSet const& disabled_warnings);
@@ -63,19 +59,19 @@ namespace CXX
//
static Void
process_tree_names (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&);
static Void
process_parser_names (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&);
static Void
process_serializer_names (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&);
@@ -83,7 +79,7 @@ namespace CXX
//
static UnsignedLong
generate_tree (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&,
Boolean file_per_type,
@@ -95,7 +91,7 @@ namespace CXX
static UnsignedLong
generate_parser (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&,
Boolean file_per_type,
@@ -105,7 +101,7 @@ namespace CXX
static UnsignedLong
generate_serializer (
- CLI::Options const&,
+ options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&,
Boolean file_per_type,
diff --git a/xsde/cxx/hybrid/insertion-header.cxx b/xsde/cxx/hybrid/insertion-header.cxx
index 887b948..a054d9e 100644
--- a/xsde/cxx/hybrid/insertion-header.cxx
+++ b/xsde/cxx/hybrid/insertion-header.cxx
@@ -41,7 +41,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -73,7 +73,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -102,7 +102,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -135,7 +135,7 @@ namespace CXX
String const& type (etype (a));
String const& scope (Context::scope (a));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -165,7 +165,7 @@ namespace CXX
String const& type (etype (c));
String const& scope (Context::scope (c));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -201,7 +201,7 @@ namespace CXX
String const& type (etype (s));
String const& scope (Context::scope (s));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -256,7 +256,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
diff --git a/xsde/cxx/hybrid/insertion-source.cxx b/xsde/cxx/hybrid/insertion-source.cxx
index 0c034dc..d579964 100644
--- a/xsde/cxx/hybrid/insertion-source.cxx
+++ b/xsde/cxx/hybrid/insertion-source.cxx
@@ -41,7 +41,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -77,7 +77,7 @@ namespace CXX
if (!name)
return;
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -118,7 +118,7 @@ namespace CXX
String const& value (u.context ().get<String> ("value"));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -475,7 +475,7 @@ namespace CXX
String const& type (etype (a));
String const& scope (Context::scope (a));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -518,7 +518,7 @@ namespace CXX
String const& type (etype (c));
String const& scope (Context::scope (c));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -581,7 +581,7 @@ namespace CXX
String const& type (etype (s));
String const& scope (Context::scope (s));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
@@ -680,7 +680,7 @@ namespace CXX
Boolean restriction (restriction_p (c));
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
os << (exceptions ? "void" : "bool") << endl
diff --git a/xsde/cxx/hybrid/options.cli b/xsde/cxx/hybrid/options.cli
index 40df945..33b05b0 100644
--- a/xsde/cxx/hybrid/options.cli
+++ b/xsde/cxx/hybrid/options.cli
@@ -335,10 +335,10 @@ namespace CXX
names of generated serializer implementation files."
};
- Cult::Types::NarrowString --paggr-type-suffix = "_paggs"
+ Cult::Types::NarrowString --paggr-type-suffix = "_paggr"
{
"<suffix>",
- "Use <suffix> instead of the default \cb{_paggs} to construct the
+ "Use <suffix> instead of the default \cb{_paggr} to construct the
names of generated parser aggregates."
};
@@ -348,6 +348,24 @@ namespace CXX
"Use <suffix> instead of the default \cb{_saggr} to construct the
names of generated serializer aggregates."
};
+
+ // In C++/Hybrid these common options can be specified multiple
+ // times with keys that identify which files they apply to. So
+ // "override" them here. Note that the documentation is still
+ // specified in the common version.
+ //
+ std::vector<Cult::Types::NarrowString> --hxx-regex;
+ std::vector<Cult::Types::NarrowString> --ixx-regex;
+ std::vector<Cult::Types::NarrowString> --cxx-regex;
+
+ std::vector<Cult::Types::NarrowString> --hxx-prologue-file;
+ std::vector<Cult::Types::NarrowString> --ixx-prologue-file;
+ std::vector<Cult::Types::NarrowString> --cxx-prologue-file;
+ std::vector<Cult::Types::NarrowString> --prologue-file;
+ std::vector<Cult::Types::NarrowString> --hxx-epilogue-file;
+ std::vector<Cult::Types::NarrowString> --ixx-epilogue-file;
+ std::vector<Cult::Types::NarrowString> --cxx-epilogue-file;
+ std::vector<Cult::Types::NarrowString> --epilogue-file;
};
}
}
diff --git a/xsde/cxx/hybrid/parser-header.cxx b/xsde/cxx/hybrid/parser-header.cxx
index 1e96dac..64a7f55 100644
--- a/xsde/cxx/hybrid/parser-header.cxx
+++ b/xsde/cxx/hybrid/parser-header.cxx
@@ -74,8 +74,8 @@ namespace CXX
if (name)
{
Boolean fl (fixed_length (e));
- Boolean val (!options.value<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_parser_val> ());
+ Boolean val (!options.suppress_validation () &&
+ !options.suppress_parser_val ());
SemanticGraph::Type& b (e.inherits ().base ());
diff --git a/xsde/cxx/hybrid/parser-name-processor.cxx b/xsde/cxx/hybrid/parser-name-processor.cxx
index 99d11fa..d5f7edd 100644
--- a/xsde/cxx/hybrid/parser-name-processor.cxx
+++ b/xsde/cxx/hybrid/parser-name-processor.cxx
@@ -31,31 +31,17 @@ namespace CXX
class Context: public CXX::Context
{
public:
- Context (CLI::Options const& ops,
+ typedef Hybrid::options options_type;
+
+ public:
+ Context (options_type const& ops,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path)
- : CXX::Context (std::wcerr,
- root,
- path,
- "name",
- "char",
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- "", // export symbol
- ops.value<CLI::namespace_map> (),
- ops.value<CLI::namespace_regex> (),
- ops.value<CLI::namespace_regex_trace> (),
- ops.value<CLI::include_regex> (),
- ops.value<CLI::include_regex_trace> (),
- ops.value<CLI::generate_inline> (),
- ops.value<CLI::custom_allocator> (),
- !ops.value<CLI::no_long_long> (),
- ops.value<CLI::reserved_name> ()),
- impl_suffix_ (ops.value<CLI::pimpl_type_suffix> ()),
- aggr_suffix_ (ops.value<CLI::paggr_type_suffix> ()),
+ : CXX::Context (std::wcerr, root, path, ops, "name", "char"),
+ impl_suffix_ (ops.pimpl_type_suffix ()),
+ aggr_suffix_ (ops.paggr_type_suffix ()),
options (ops),
- aggregate (ops.value<CLI::generate_aggregate> ()),
+ aggregate (ops.generate_aggregate ()),
impl_suffix (impl_suffix_),
aggr_suffix (aggr_suffix_),
custom_parser_map (custom_parser_map_),
@@ -63,10 +49,9 @@ namespace CXX
{
// Custom parser mapping.
//
- typedef Containers::Vector<NarrowString> Vector;
- Vector const& v (ops.value<CLI::custom_parser> ());
+ NarrowStrings const& v (ops.custom_parser ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ());
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
i != e; ++i)
{
String s (*i);
@@ -239,7 +224,7 @@ namespace CXX
Cult::Containers::Map<String, NameSet*> global_type_names_;
public:
- CLI::Options const& options;
+ options_type const& options;
Boolean aggregate;
String const& impl_suffix;
String const& aggr_suffix;
@@ -265,7 +250,7 @@ namespace CXX
//
Type* base_enum (0);
- if (options.value<CLI::suppress_enum> () ||
+ if (options.suppress_enum () ||
!Hybrid::Context::enum_mapping (e, &base_enum))
{
complex_.traverse (e);
@@ -530,12 +515,11 @@ namespace CXX
if (aggregate)
{
- typedef Cult::Containers::Vector<NarrowString> Names;
- Names const& names (options.value<CLI::root_type> ());
+ NarrowStrings const& names (options.root_type ());
// Hopefully nobody will specify more than a handful of names.
//
- for (Names::ConstIterator i (names.begin ());
+ for (NarrowStrings::const_iterator i (names.begin ());
i != names.end (); ++i)
{
if (name == String (*i))
@@ -562,7 +546,7 @@ namespace CXX
~GlobalElement ()
{
- if (last_ != 0 && options.value<CLI::root_element_last> ())
+ if (last_ != 0 && options.root_element_last ())
process (*last_);
}
@@ -571,34 +555,33 @@ namespace CXX
{
Boolean p (false);
- if (last_ == 0 && options.value<CLI::root_element_first> ())
+ if (last_ == 0 && options.root_element_first ())
p = true;
last_ = &e;
if (!p &&
- !options.value<CLI::root_element_first> () &&
- !options.value<CLI::root_element_last> () &&
- !options.value<CLI::root_element_all> () &&
- !options.value<CLI::root_element_none> () &&
- options.value<CLI::root_element> ().empty ())
+ !options.root_element_first () &&
+ !options.root_element_last () &&
+ !options.root_element_all () &&
+ !options.root_element_none () &&
+ options.root_element ().empty ())
{
// By default process them all.
//
p = true;
}
- if (!p && options.value<CLI::root_element_all> ())
+ if (!p && options.root_element_all ())
p = true;
if (!p)
{
- typedef Cult::Containers::Vector<NarrowString> Names;
- Names const& names (options.value<CLI::root_element> ());
+ NarrowStrings const& names (options.root_element ());
// Hopefully nobody will specify more than a handful of names.
//
- for (Names::ConstIterator i (names.begin ());
+ for (NarrowStrings::const_iterator i (names.begin ());
!p && i != names.end ();
++i)
{
@@ -728,7 +711,7 @@ namespace CXX
Char const* Uses::seen_key = "cxx-hybrid-parser-name-processor-seen";
Void
- process_impl (CLI::Options const& ops,
+ process_impl (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
@@ -794,7 +777,7 @@ namespace CXX
}
Boolean ParserNameProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
diff --git a/xsde/cxx/hybrid/parser-name-processor.hxx b/xsde/cxx/hybrid/parser-name-processor.hxx
index 1a1ab58..20721ee 100644
--- a/xsde/cxx/hybrid/parser-name-processor.hxx
+++ b/xsde/cxx/hybrid/parser-name-processor.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -22,7 +22,7 @@ namespace CXX
{
public:
Boolean
- process (CLI::Options const& options,
+ process (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
Boolean deep);
diff --git a/xsde/cxx/hybrid/parser-source.cxx b/xsde/cxx/hybrid/parser-source.cxx
index 63afd43..3b6ed31 100644
--- a/xsde/cxx/hybrid/parser-source.cxx
+++ b/xsde/cxx/hybrid/parser-source.cxx
@@ -121,8 +121,8 @@ namespace CXX
Boolean fl (fixed_length (e));
- Boolean val (!options.value<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_parser_val> ());
+ Boolean val (!options.suppress_validation () &&
+ !options.suppress_parser_val ());
SemanticGraph::Context& ec (e.context ());
SemanticGraph::Type& b (e.inherits ().base ());
@@ -1611,8 +1611,8 @@ namespace CXX
Boolean fixed (fixed_length (c));
Boolean rec (recursive (c));
- Boolean validation (!options.value<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_parser_val> ());
+ Boolean validation (!options.suppress_validation () &&
+ !options.suppress_parser_val ());
Boolean c_string_base (false);
if (!stl && hb)
@@ -2093,8 +2093,8 @@ namespace CXX
{
// We need this functionality for enum mapping.
//
- if (!ctx.options.value<CLI::suppress_validation> () &&
- !ctx.options.value<CLI::suppress_parser_val> ())
+ if (!ctx.options.suppress_validation () &&
+ !ctx.options.suppress_parser_val ())
ctx.os << "#include <xsde/cxx/parser/validating/string-common.hxx>" << endl
<< endl;
else
diff --git a/xsde/cxx/hybrid/serializer-name-processor.cxx b/xsde/cxx/hybrid/serializer-name-processor.cxx
index b8cec72..4071ecb 100644
--- a/xsde/cxx/hybrid/serializer-name-processor.cxx
+++ b/xsde/cxx/hybrid/serializer-name-processor.cxx
@@ -30,31 +30,17 @@ namespace CXX
class Context: public CXX::Context
{
public:
- Context (CLI::Options const& ops,
+ typedef Hybrid::options options_type;
+
+ public:
+ Context (options_type const& ops,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path)
- : CXX::Context (std::wcerr,
- root,
- path,
- "name",
- "char",
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- "", // export symbol
- ops.value<CLI::namespace_map> (),
- ops.value<CLI::namespace_regex> (),
- ops.value<CLI::namespace_regex_trace> (),
- ops.value<CLI::include_regex> (),
- ops.value<CLI::include_regex_trace> (),
- ops.value<CLI::generate_inline> (),
- ops.value<CLI::custom_allocator> (),
- !ops.value<CLI::no_long_long> (),
- ops.value<CLI::reserved_name> ()),
- impl_suffix_ (ops.value<CLI::simpl_type_suffix> ()),
- aggr_suffix_ (ops.value<CLI::saggr_type_suffix> ()),
+ : CXX::Context (std::wcerr, root, path, ops, "name", "char"),
+ impl_suffix_ (ops.simpl_type_suffix ()),
+ aggr_suffix_ (ops.saggr_type_suffix ()),
options (ops),
- aggregate (ops.value<CLI::generate_aggregate> ()),
+ aggregate (ops.generate_aggregate ()),
impl_suffix (impl_suffix_),
aggr_suffix (aggr_suffix_),
custom_serializer_map (custom_serializer_map_),
@@ -62,10 +48,9 @@ namespace CXX
{
// Custom serializer mapping.
//
- typedef Containers::Vector<NarrowString> Vector;
- Vector const& v (ops.value<CLI::custom_serializer> ());
+ NarrowStrings const& v (ops.custom_serializer ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ());
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
i != e; ++i)
{
String s (*i);
@@ -232,7 +217,7 @@ namespace CXX
Cult::Containers::Map<String, NameSet*> global_type_names_;
public:
- CLI::Options const& options;
+ options_type const& options;
Boolean aggregate;
String const& impl_suffix;
String const& aggr_suffix;
@@ -258,7 +243,7 @@ namespace CXX
//
Type* base_enum (0);
- if (options.value<CLI::suppress_enum> () ||
+ if (options.suppress_enum () ||
!Hybrid::Context::enum_mapping (e, &base_enum))
{
complex_.traverse (e);
@@ -538,12 +523,11 @@ namespace CXX
if (aggregate)
{
- typedef Cult::Containers::Vector<NarrowString> Names;
- Names const& names (options.value<CLI::root_type> ());
+ NarrowStrings const& names (options.root_type ());
// Hopefully nobody will specify more than a handful of names.
//
- for (Names::ConstIterator i (names.begin ());
+ for (NarrowStrings::const_iterator i (names.begin ());
i != names.end (); ++i)
{
if (name == String (*i))
@@ -570,7 +554,7 @@ namespace CXX
~GlobalElement ()
{
- if (last_ != 0 && options.value<CLI::root_element_last> ())
+ if (last_ != 0 && options.root_element_last ())
process (*last_);
}
@@ -579,36 +563,34 @@ namespace CXX
{
Boolean p (false);
- if (last_ == 0 && options.value<CLI::root_element_first> ())
+ if (last_ == 0 && options.root_element_first ())
p = true;
last_ = &e;
if (!p &&
- !options.value<CLI::root_element_first> () &&
- !options.value<CLI::root_element_last> () &&
- !options.value<CLI::root_element_all> () &&
- !options.value<CLI::root_element_none> () &&
- options.value<CLI::root_element> ().empty ())
+ !options.root_element_first () &&
+ !options.root_element_last () &&
+ !options.root_element_all () &&
+ !options.root_element_none () &&
+ options.root_element ().empty ())
{
// By default process them all.
//
p = true;
}
- if (!p && options.value<CLI::root_element_all> ())
+ if (!p && options.root_element_all ())
p = true;
if (!p)
{
- typedef Cult::Containers::Vector<NarrowString> Names;
- Names const& names (options.value<CLI::root_element> ());
+ NarrowStrings const& names (options.root_element ());
// Hopefully nobody will specify more than a handful of names.
//
- for (Names::ConstIterator i (names.begin ());
- !p && i != names.end ();
- ++i)
+ for (NarrowStrings::const_iterator i (names.begin ());
+ !p && i != names.end (); ++i)
{
if (e.name () == String (*i))
p = true;
@@ -736,7 +718,7 @@ namespace CXX
Char const* Uses::seen_key = "cxx-hybrid-serializer-name-processor-seen";
Void
- process_impl (CLI::Options const& ops,
+ process_impl (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
@@ -802,7 +784,7 @@ namespace CXX
}
Boolean SerializerNameProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
diff --git a/xsde/cxx/hybrid/serializer-name-processor.hxx b/xsde/cxx/hybrid/serializer-name-processor.hxx
index 83f1ea9..0840f52 100644
--- a/xsde/cxx/hybrid/serializer-name-processor.hxx
+++ b/xsde/cxx/hybrid/serializer-name-processor.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -22,7 +22,7 @@ namespace CXX
{
public:
Boolean
- process (CLI::Options const& options,
+ process (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
Boolean deep);
diff --git a/xsde/cxx/hybrid/serializer-source.cxx b/xsde/cxx/hybrid/serializer-source.cxx
index e267407..d99d167 100644
--- a/xsde/cxx/hybrid/serializer-source.cxx
+++ b/xsde/cxx/hybrid/serializer-source.cxx
@@ -206,8 +206,8 @@ namespace CXX
<< "_serialize_content ()"
<< "{";
- if (!options.value<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_serializer_val> ())
+ if (!options.suppress_validation () &&
+ !options.suppress_serializer_val ())
{
// Do facet validation.
//
@@ -1056,7 +1056,7 @@ namespace CXX
if (a.default_p ())
{
- Boolean omit (options.value<CLI::omit_default_attributes> ());
+ Boolean omit (options.omit_default_attributes ());
if (a.fixed_p ())
os << "return " << (omit ? "false" : "true") << ";";
@@ -1144,8 +1144,8 @@ namespace CXX
Boolean rec (recursive (c));
Boolean restriction (restriction_p (c));
- Boolean validation (!options.value<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_serializer_val> ());
+ Boolean validation (!options.suppress_validation () &&
+ !options.suppress_serializer_val ());
String state;
String member;
@@ -1400,8 +1400,8 @@ namespace CXX
<< endl;
if (ctx.enum_ &&
- !ctx.options.value<CLI::suppress_validation> () &&
- !ctx.options.value<CLI::suppress_serializer_val> ())
+ !ctx.options.suppress_validation () &&
+ !ctx.options.suppress_serializer_val ())
{
// We need this functionality for enum mapping.
//
diff --git a/xsde/cxx/hybrid/tree-forward.cxx b/xsde/cxx/hybrid/tree-forward.cxx
index b220847..6fbd424 100644
--- a/xsde/cxx/hybrid/tree-forward.cxx
+++ b/xsde/cxx/hybrid/tree-forward.cxx
@@ -220,7 +220,7 @@ namespace CXX
else
string_type_ = L"char*";
- if (options.value<CLI::no_long_long> ())
+ if (options.no_long_long ())
{
long_type_ = L"long";
unsigned_long_type_ = L"unsigned long";
@@ -670,7 +670,7 @@ namespace CXX
Boolean icdr (false), ocdr (false);
Boolean ixdr (false), oxdr (false);
- for (Streams::ConstIterator i (istreams.begin ());
+ for (NarrowStrings::const_iterator i (istreams.begin ());
i != istreams.end (); ++i)
{
if (*i == "CDR")
@@ -679,7 +679,7 @@ namespace CXX
ixdr = true;
}
- for (Streams::ConstIterator i (ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ostreams.begin ());
i != ostreams.end (); ++i)
{
if (*i == "CDR")
@@ -724,7 +724,7 @@ namespace CXX
Void
generate_tree_forward (Context& ctx, Boolean generate_xml_schema)
{
- NarrowString xml_schema (ctx.options.value<CLI::extern_xml_schema> ());
+ NarrowString xml_schema (ctx.options.extern_xml_schema ());
// Inlcude or Emit fundamental types.
//
@@ -752,7 +752,7 @@ namespace CXX
// Data representation stream includes.
//
- for (Context::Streams::ConstIterator i (ctx.istreams.begin ());
+ for (NarrowStrings::const_iterator i (ctx.istreams.begin ());
i != ctx.istreams.end (); ++i)
{
if (*i == "CDR")
@@ -763,7 +763,7 @@ namespace CXX
<< endl;
}
- for (Context::Streams::ConstIterator i (ctx.ostreams.begin ());
+ for (NarrowStrings::const_iterator i (ctx.ostreams.begin ());
i != ctx.ostreams.end (); ++i)
{
if (*i == "CDR")
diff --git a/xsde/cxx/hybrid/tree-header.cxx b/xsde/cxx/hybrid/tree-header.cxx
index 123b235..ae24feb 100644
--- a/xsde/cxx/hybrid/tree-header.cxx
+++ b/xsde/cxx/hybrid/tree-header.cxx
@@ -787,7 +787,7 @@ namespace CXX
virtual Void
traverse (SemanticGraph::Fundamental::Long&)
{
- if (options.value<CLI::no_long_long> ())
+ if (options.no_long_long ())
align_type ("long", 5);
else
align_type ("long long", 8);
@@ -796,7 +796,7 @@ namespace CXX
virtual Void
traverse (SemanticGraph::Fundamental::UnsignedLong&)
{
- if (options.value<CLI::no_long_long> ())
+ if (options.no_long_long ())
align_type ("unsigned long", 5);
else
align_type ("unsigned long long", 8);
@@ -2946,7 +2946,7 @@ namespace CXX
Void
generate_tree_header (Context& ctx)
{
- Boolean inline_ (ctx.options.value<CLI::generate_inline> ());
+ Boolean inline_ (ctx.options.generate_inline ());
// Emit header includes.
//
diff --git a/xsde/cxx/hybrid/tree-inline.cxx b/xsde/cxx/hybrid/tree-inline.cxx
index 748184c..2f6815e 100644
--- a/xsde/cxx/hybrid/tree-inline.cxx
+++ b/xsde/cxx/hybrid/tree-inline.cxx
@@ -2067,7 +2067,7 @@ namespace CXX
{
// Generate includes.
//
- if (ctx.options.value<CLI::generate_inline> ())
+ if (ctx.options.generate_inline ())
{
Traversal::Schema schema;
Includes includes (ctx, Includes::inline_);
diff --git a/xsde/cxx/hybrid/tree-name-processor.cxx b/xsde/cxx/hybrid/tree-name-processor.cxx
index a2d630d..0558907 100644
--- a/xsde/cxx/hybrid/tree-name-processor.cxx
+++ b/xsde/cxx/hybrid/tree-name-processor.cxx
@@ -31,30 +31,16 @@ namespace CXX
class Context: public CXX::Context
{
public:
- Context (CLI::Options const& ops,
+ typedef Hybrid::options options_type;
+
+ public:
+ Context (options_type const& ops,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path)
- : CXX::Context (std::wcerr,
- root,
- path,
- "name",
- "char",
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- "", // export symbol
- ops.value<CLI::namespace_map> (),
- ops.value<CLI::namespace_regex> (),
- ops.value<CLI::namespace_regex_trace> (),
- ops.value<CLI::include_regex> (),
- ops.value<CLI::include_regex_trace> (),
- ops.value<CLI::generate_inline> (),
- ops.value<CLI::custom_allocator> (),
- !ops.value<CLI::no_long_long> (),
- ops.value<CLI::reserved_name> ()),
- stl (!ops.value<CLI::no_stl> ()),
- detach (ops.value<CLI::generate_detach> ()),
- enum_ (!ops.value<CLI::suppress_enum> ()),
+ : CXX::Context (std::wcerr, root, path, ops, "name", "char"),
+ stl (!ops.no_stl ()),
+ detach (ops.generate_detach ()),
+ enum_ (!ops.suppress_enum ()),
custom_data_map (custom_data_map_),
custom_type_map (custom_type_map_),
global_type_names (global_type_names_)
@@ -62,10 +48,9 @@ namespace CXX
// Translate the type names with custom data.
//
{
- typedef Cult::Containers::Vector<NarrowString> CustomData;
- CustomData const& cd (ops.value<CLI::custom_data> ());
+ NarrowStrings const& cd (ops.custom_data ());
- for (CustomData::ConstIterator i (cd.begin ());
+ for (NarrowStrings::const_iterator i (cd.begin ());
i != cd.end (); ++i)
{
String name (*i);
@@ -102,10 +87,9 @@ namespace CXX
// Custom type mapping.
//
{
- typedef Containers::Vector<NarrowString> Vector;
- Vector const& v (ops.value<CLI::custom_type> ());
+ NarrowStrings const& v (ops.custom_type ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ());
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
i != e; ++i)
{
String s (*i);
@@ -2197,7 +2181,7 @@ namespace CXX
};
Void
- process_impl (CLI::Options const& ops,
+ process_impl (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
@@ -2311,7 +2295,7 @@ namespace CXX
}
Void TreeNameProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
Boolean deep)
diff --git a/xsde/cxx/hybrid/tree-name-processor.hxx b/xsde/cxx/hybrid/tree-name-processor.hxx
index d1c6dba..fff1fb8 100644
--- a/xsde/cxx/hybrid/tree-name-processor.hxx
+++ b/xsde/cxx/hybrid/tree-name-processor.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -22,7 +22,7 @@ namespace CXX
{
public:
Void
- process (CLI::Options const& options,
+ process (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
Boolean deep);
diff --git a/xsde/cxx/hybrid/tree-size-processor.cxx b/xsde/cxx/hybrid/tree-size-processor.cxx
index 6b3b978..0d734ca 100644
--- a/xsde/cxx/hybrid/tree-size-processor.cxx
+++ b/xsde/cxx/hybrid/tree-size-processor.cxx
@@ -1026,25 +1026,22 @@ namespace CXX
Char const* pass_two_key = "cxx-hybrid-size-processor-seen-two";
Boolean
- process_impl (CLI::Options const& ops,
+ process_impl (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const&,
const WarningSet& disabled_warnings)
{
Boolean valid (true);
- Boolean stl (!ops.value<CLI::no_stl> ());
- Boolean poly (ops.value<CLI::generate_polymorphic> ());
+ Boolean stl (!ops.no_stl ());
+ Boolean poly (ops.generate_polymorphic ());
// Prepare a set of polymorphic types.
//
TypeSet poly_types;
if (poly)
- {
- poly_types.insert (
- ops.value<CLI::polymorphic_type> ().begin (),
- ops.value<CLI::polymorphic_type> ().end ());
- }
+ poly_types.insert (ops.polymorphic_type ().begin (),
+ ops.polymorphic_type ().end ());
// Root schema in the file-per-type mode is just a bunch
// of includes without a namespace.
@@ -1103,10 +1100,9 @@ namespace CXX
TypeSet custom_data_types;
{
- typedef Cult::Containers::Vector<NarrowString> CustomData;
- CustomData const& cd (ops.value<CLI::custom_data> ());
+ NarrowStrings const& cd (ops.custom_data ());
- for (CustomData::ConstIterator i (cd.begin ());
+ for (NarrowStrings::const_iterator i (cd.begin ());
i != cd.end (); ++i)
{
String n (*i);
@@ -1119,10 +1115,9 @@ namespace CXX
CustomTypeMap custom_type_map;
{
- typedef Containers::Vector<NarrowString> Vector;
- Vector const& v (ops.value<CLI::custom_type> ());
+ NarrowStrings const& v (ops.custom_type ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ());
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
i != e; ++i)
{
String s (*i);
@@ -1226,7 +1221,7 @@ namespace CXX
poly_types,
stl,
poly,
- !ops.value<CLI::suppress_enum> ());
+ !ops.suppress_enum ());
schema >> schema_names >> ns >> ns_names >> type;
@@ -1244,7 +1239,7 @@ namespace CXX
}
Boolean TreeSizeProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
const WarningSet& disabled_warnings)
diff --git a/xsde/cxx/hybrid/tree-size-processor.hxx b/xsde/cxx/hybrid/tree-size-processor.hxx
index 05bdb65..6f13401 100644
--- a/xsde/cxx/hybrid/tree-size-processor.hxx
+++ b/xsde/cxx/hybrid/tree-size-processor.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
#include <xsde.hxx>
@@ -24,7 +24,7 @@ namespace CXX
{
public:
Boolean
- process (CLI::Options const& options,
+ process (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
const WarningSet& disabled_warnings);
diff --git a/xsde/cxx/hybrid/tree-type-map.cxx b/xsde/cxx/hybrid/tree-type-map.cxx
index f2806c3..7825725 100644
--- a/xsde/cxx/hybrid/tree-type-map.cxx
+++ b/xsde/cxx/hybrid/tree-type-map.cxx
@@ -22,27 +22,10 @@ namespace CXX
class Context: public CXX::Context
{
public:
- Context (CLI::Options const& ops,
+ Context (Hybrid::options const& ops,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path)
- : CXX::Context (std::wcerr,
- root,
- path,
- "name",
- "char",
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- "", // export symbol
- ops.value<CLI::namespace_map> (),
- ops.value<CLI::namespace_regex> (),
- ops.value<CLI::namespace_regex_trace> (),
- ops.value<CLI::include_regex> (),
- ops.value<CLI::include_regex_trace> (),
- ops.value<CLI::generate_inline> (),
- ops.value<CLI::custom_allocator> (),
- !ops.value<CLI::no_long_long> (),
- ops.value<CLI::reserved_name> ())
+ : CXX::Context (std::wcerr, root, path, ops, "name", "char")
{
}
@@ -205,7 +188,7 @@ namespace CXX
}
Void
- generate_tree_type_map (CLI::Options const& ops,
+ generate_tree_type_map (options const& ops,
XSDFrontend::SemanticGraph::Schema& tu,
XSDFrontend::SemanticGraph::Path const& path,
String const& hxx_name,
@@ -229,16 +212,16 @@ namespace CXX
Traversal::Names schema_names;
Namespace ns (
ctx, &hxx_name,
- (ops.value<CLI::generate_parser> () ? &parser_map : 0),
- (ops.value<CLI::generate_serializer> () ? &serializer_map : 0));
+ (ops.generate_parser () ? &parser_map : 0),
+ (ops.generate_serializer () ? &serializer_map : 0));
schema >> schema_names >> ns;
Traversal::Names used_schema_names;
Namespace used_ns (
ctx, 0,
- (ops.value<CLI::generate_parser> () ? &parser_map : 0),
- (ops.value<CLI::generate_serializer> () ? &serializer_map : 0));
+ (ops.generate_parser () ? &parser_map : 0),
+ (ops.generate_serializer () ? &serializer_map : 0));
used_schema >> used_schema_names >> used_ns;
diff --git a/xsde/cxx/hybrid/tree-type-map.hxx b/xsde/cxx/hybrid/tree-type-map.hxx
index 2b75564..0f677cd 100644
--- a/xsde/cxx/hybrid/tree-type-map.hxx
+++ b/xsde/cxx/hybrid/tree-type-map.hxx
@@ -12,7 +12,7 @@
#include <type-map/type-map.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
namespace CXX
{
@@ -21,7 +21,7 @@ namespace CXX
using namespace Cult::Types;
Void
- generate_tree_type_map (CLI::Options const& options,
+ generate_tree_type_map (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const&,
String const& hxx_name,
diff --git a/xsde/cxx/hybrid/validator.cxx b/xsde/cxx/hybrid/validator.cxx
index 70d8b1c..2b13097 100644
--- a/xsde/cxx/hybrid/validator.cxx
+++ b/xsde/cxx/hybrid/validator.cxx
@@ -28,10 +28,10 @@ namespace CXX
public:
ValidationContext (SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
- CLI::Options const& options,
+ Hybrid::options const& ops,
const WarningSet& disabled_warnings,
Boolean& valid_)
- : Context (std::wcerr, root, path, options, 0, 0, 0),
+ : Context (std::wcerr, root, path, ops, 0, 0, 0),
disabled_warnings_ (disabled_warnings),
disabled_warnings_all_ (false),
valid (valid_),
@@ -160,7 +160,7 @@ namespace CXX
return;
if (e.substitutes_p () &&
- !options.value<CLI::generate_polymorphic> () &&
+ !options.generate_polymorphic () &&
!subst_group_warning_issued)
{
subst_group_warning_issued = true;
@@ -245,7 +245,7 @@ namespace CXX
<< "automatically name them"
<< endl;
- if (!options.value<CLI::show_anonymous> ())
+ if (!options.show_anonymous ())
wcerr << t.file ()
<< ": info: use --show-anonymous option to see these "
<< "types" << endl;
@@ -274,7 +274,7 @@ namespace CXX
{
if (traverse_common (e))
{
- if (options.value<CLI::show_anonymous> ())
+ if (options.show_anonymous ())
{
wcerr << e.file () << ":" << e.line () << ":" << e.column ()
<< ": error: element '" << xpath (e) << "' "
@@ -299,7 +299,7 @@ namespace CXX
{
if (traverse_common (a))
{
- if (options.value<CLI::show_anonymous> ())
+ if (options.show_anonymous ())
{
wcerr << a.file () << ":" << a.line () << ":" << a.column ()
<< ": error: attribute '" << xpath (a) << "' "
@@ -482,17 +482,17 @@ namespace CXX
}
Boolean Validator::
- validate (CLI::Options const& options,
+ validate (options const& ops,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
const WarningSet& disabled_warnings)
{
Boolean valid (true);
- ValidationContext ctx (root, path, options, disabled_warnings, valid);
+ ValidationContext ctx (root, path, ops, disabled_warnings, valid);
//
//
- NarrowString enc (options.value<CLI::char_encoding> ());
+ NarrowString enc (ops.char_encoding ());
if (enc != "utf8" && enc != "iso8859-1")
{
@@ -502,9 +502,9 @@ namespace CXX
//
//
- Boolean par (options.value<CLI::generate_parser> ());
- Boolean ser (options.value<CLI::generate_serializer> ());
- Boolean agg (options.value<CLI::generate_aggregate> ());
+ Boolean par (ops.generate_parser ());
+ Boolean ser (ops.generate_serializer ());
+ Boolean agg (ops.generate_aggregate ());
if (agg && !par && !ser && !ctx.is_disabled ("H002"))
{
@@ -517,11 +517,11 @@ namespace CXX
// are generating aggregate types.
//
if (agg &&
- !options.value<CLI::root_element_first> () &&
- !options.value<CLI::root_element_last> () &&
- !options.value<CLI::root_element_all> () &&
- !options.value<CLI::root_element_none> () &&
- options.value<CLI::root_element> ().empty () &&
+ !ops.root_element_first () &&
+ !ops.root_element_last () &&
+ !ops.root_element_all () &&
+ !ops.root_element_none () &&
+ ops.root_element ().empty () &&
!ctx.is_disabled ("H003"))
{
UnsignedLong count (0);
@@ -565,8 +565,7 @@ namespace CXX
// Test for constructs that require validation in parser.
//
if (valid && par &&
- (options.value<CLI::suppress_validation> () ||
- options.value<CLI::suppress_parser_val> ()))
+ (ops.suppress_validation () || ops.suppress_parser_val ()))
{
Traversal::Schema schema;
Sources sources;
diff --git a/xsde/cxx/hybrid/validator.hxx b/xsde/cxx/hybrid/validator.hxx
index cbc80ac..ba4cc80 100644
--- a/xsde/cxx/hybrid/validator.hxx
+++ b/xsde/cxx/hybrid/validator.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph/schema.hxx>
-#include <cxx/hybrid/cli.hxx>
+#include <cxx/hybrid/options.hxx>
#include <xsde.hxx>
@@ -24,7 +24,7 @@ namespace CXX
{
public:
Boolean
- validate (CLI::Options const& options,
+ validate (options const& options,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& tu,
const WarningSet& disabled_warnings);