summaryrefslogtreecommitdiff
path: root/xsd/cxx/tree
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-20 11:54:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-20 11:55:22 +0200
commitc04f7d6ed04d62efafa79a87bcde6c5f62e95327 (patch)
tree500cc93aed55b0809fe04e5a0b7020d9045c65c5 /xsd/cxx/tree
parente14a3f91e6e51430bf9c6978f44c7f46114793fb (diff)
Completion of the CLI port
Diffstat (limited to 'xsd/cxx/tree')
-rw-r--r--xsd/cxx/tree/cli.hxx230
-rw-r--r--xsd/cxx/tree/counter.cxx16
-rw-r--r--xsd/cxx/tree/counter.hxx4
-rw-r--r--xsd/cxx/tree/elements.cxx91
-rw-r--r--xsd/cxx/tree/elements.hxx13
-rw-r--r--xsd/cxx/tree/fundamental-header.hxx16
-rw-r--r--xsd/cxx/tree/generator.cxx289
-rw-r--r--xsd/cxx/tree/generator.hxx7
-rw-r--r--xsd/cxx/tree/name-processor.cxx86
-rw-r--r--xsd/cxx/tree/name-processor.hxx3
-rw-r--r--xsd/cxx/tree/options.cli7
-rw-r--r--xsd/cxx/tree/parser-source.cxx12
-rw-r--r--xsd/cxx/tree/polymorphism-processor.cxx8
-rw-r--r--xsd/cxx/tree/polymorphism-processor.hxx4
-rw-r--r--xsd/cxx/tree/serialization-header.cxx2
-rw-r--r--xsd/cxx/tree/serialization-source.cxx15
-rw-r--r--xsd/cxx/tree/stream-extraction-source.cxx36
-rw-r--r--xsd/cxx/tree/stream-insertion-header.cxx22
-rw-r--r--xsd/cxx/tree/stream-insertion-source.cxx34
-rw-r--r--xsd/cxx/tree/stream-source.cxx4
-rw-r--r--xsd/cxx/tree/tree-forward.cxx32
-rw-r--r--xsd/cxx/tree/tree-header.cxx99
-rw-r--r--xsd/cxx/tree/tree-inline.cxx10
-rw-r--r--xsd/cxx/tree/tree-source.cxx68
-rw-r--r--xsd/cxx/tree/validator.cxx46
-rw-r--r--xsd/cxx/tree/validator.hxx4
26 files changed, 382 insertions, 776 deletions
diff --git a/xsd/cxx/tree/cli.hxx b/xsd/cxx/tree/cli.hxx
deleted file mode 100644
index c3356e8..0000000
--- a/xsd/cxx/tree/cli.hxx
+++ /dev/null
@@ -1,230 +0,0 @@
-// file : xsd/cxx/tree/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_TREE_CLI_HXX
-#define CXX_TREE_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 Tree
- {
- namespace CLI
- {
- using namespace Cult::Types;
-
- typedef Char const Key[];
-
- extern Key char_type;
- extern Key char_encoding;
- extern Key output_dir;
- extern Key generate_polymorphic;
- extern Key polymorphic_type;
- extern Key polymorphic_type_all;
- extern Key generate_serialization;
- extern Key generate_inline;
- extern Key generate_ostream;
- extern Key generate_doxygen;
- extern Key generate_comparison;
- extern Key generate_default_ctor;
- extern Key generate_from_base_ctor;
- extern Key suppress_assignment;
- extern Key generate_detach;
- extern Key generate_wildcard;
- extern Key generate_insertion;
- extern Key generate_extraction;
- extern Key generate_forward;
- extern Key generate_xml_schema;
- extern Key extern_xml_schema;
- extern Key suppress_parsing;
- extern Key generate_element_type;
- extern Key generate_element_map;
- extern Key generate_intellisense;
- extern Key omit_default_attributes;
- extern Key namespace_map;
- extern Key namespace_regex;
- extern Key namespace_regex_trace;
- extern Key reserved_name;
- extern Key type_naming;
- extern Key function_naming;
- extern Key type_regex;
- extern Key accessor_regex;
- extern Key one_accessor_regex;
- extern Key opt_accessor_regex;
- extern Key seq_accessor_regex;
- extern Key modifier_regex;
- extern Key one_modifier_regex;
- extern Key opt_modifier_regex;
- extern Key seq_modifier_regex;
- extern Key parser_regex;
- extern Key serializer_regex;
- extern Key enumerator_regex;
- extern Key element_type_regex;
- extern Key name_regex_trace;
- extern Key include_with_brackets;
- extern Key include_prefix;
- extern Key include_regex;
- extern Key include_regex_trace;
- extern Key guard_prefix;
- 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 custom_type;
- extern Key custom_type_regex;
- 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 parts;
- extern Key parts_suffix;
- extern Key export_symbol;
- extern Key export_xml_schema;
- extern Key export_maps;
- extern Key import_maps;
- extern Key show_anonymous;
- extern Key show_sloc;
- extern Key proprietary_license;
- extern Key disable_multi_import; // Undocumented.
-
-
- typedef Cult::CLI::Options<
-
- char_type, NarrowString,
- char_encoding, NarrowString,
- output_dir, NarrowString,
- generate_polymorphic, Boolean,
- polymorphic_type, Cult::Containers::Vector<NarrowString>,
- polymorphic_type_all, Boolean,
- generate_serialization, Boolean,
- generate_inline, Boolean,
- generate_ostream, Boolean,
- generate_doxygen, Boolean,
- generate_comparison, Boolean,
- generate_default_ctor, Boolean,
- generate_from_base_ctor, Boolean,
- suppress_assignment, Boolean,
- generate_detach, Boolean,
- generate_wildcard, Boolean,
- generate_insertion, Cult::Containers::Vector<NarrowString>,
- generate_extraction, Cult::Containers::Vector<NarrowString>,
- generate_forward, Boolean,
- generate_xml_schema, Boolean,
- extern_xml_schema, NarrowString,
- suppress_parsing, Boolean,
- generate_element_type, Boolean,
- generate_element_map, Boolean,
- generate_intellisense, Boolean,
- omit_default_attributes, Boolean,
- namespace_map, Cult::Containers::Vector<NarrowString>,
- namespace_regex, Cult::Containers::Vector<NarrowString>,
- namespace_regex_trace, Boolean,
- reserved_name, Cult::Containers::Vector<NarrowString>,
- type_naming, NarrowString,
- function_naming, NarrowString,
- type_regex, Cult::Containers::Vector<NarrowString>,
- accessor_regex, Cult::Containers::Vector<NarrowString>,
- one_accessor_regex, Cult::Containers::Vector<NarrowString>,
- opt_accessor_regex, Cult::Containers::Vector<NarrowString>,
- seq_accessor_regex, Cult::Containers::Vector<NarrowString>,
- modifier_regex, Cult::Containers::Vector<NarrowString>,
- one_modifier_regex, Cult::Containers::Vector<NarrowString>,
- opt_modifier_regex, Cult::Containers::Vector<NarrowString>,
- seq_modifier_regex, Cult::Containers::Vector<NarrowString>,
- parser_regex, Cult::Containers::Vector<NarrowString>,
- serializer_regex, Cult::Containers::Vector<NarrowString>,
- enumerator_regex, Cult::Containers::Vector<NarrowString>,
- element_type_regex, Cult::Containers::Vector<NarrowString>,
- name_regex_trace, Boolean,
- include_with_brackets, Boolean,
- include_prefix, NarrowString,
- include_regex, Cult::Containers::Vector<NarrowString>,
- include_regex_trace, Boolean,
- guard_prefix, NarrowString,
- root_element_first, Boolean,
- root_element_last, Boolean,
- root_element_all, Boolean,
- root_element_none, Boolean,
- root_element, Cult::Containers::Vector<NarrowString>,
- custom_type, Cult::Containers::Vector<NarrowString>,
- custom_type_regex, Cult::Containers::Vector<NarrowString>,
- hxx_suffix, NarrowString,
- ixx_suffix, NarrowString,
- cxx_suffix, NarrowString,
- fwd_suffix, NarrowString,
- hxx_regex, NarrowString,
- ixx_regex, NarrowString,
- cxx_regex, 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, NarrowString,
- ixx_prologue_file, NarrowString,
- cxx_prologue_file, NarrowString,
- fwd_prologue_file, NarrowString,
- prologue_file, NarrowString,
- hxx_epilogue_file, NarrowString,
- ixx_epilogue_file, NarrowString,
- cxx_epilogue_file, NarrowString,
- fwd_epilogue_file, NarrowString,
- epilogue_file, NarrowString,
- parts, UnsignedLong,
- parts_suffix, NarrowString,
- export_symbol, NarrowString,
- export_xml_schema, Boolean,
- export_maps, Boolean,
- import_maps, Boolean,
- show_anonymous, Boolean,
- show_sloc, Boolean,
- proprietary_license, Boolean,
- disable_multi_import, Boolean
-
- > Options;
-
- struct OptionsSpec: Cult::CLI::OptionsSpec<Options> {};
- }
- }
-}
-
-#endif // CXX_TREE_CLI_HXX
diff --git a/xsd/cxx/tree/counter.cxx b/xsd/cxx/tree/counter.cxx
index 6888b2a..548fc77 100644
--- a/xsd/cxx/tree/counter.cxx
+++ b/xsd/cxx/tree/counter.cxx
@@ -99,7 +99,7 @@ namespace CXX
names >> member;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names >> any;
Complex::names (c, names);
@@ -188,22 +188,22 @@ namespace CXX
if (doc_root_p (*last_))
{
- if (options.value<CLI::generate_element_type> ())
+ if (options.generate_element_type ())
{
complexity += 1; // For c-tors and d-tor.
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
complexity += 1;
- if (options.value<CLI::generate_serialization> ())
+ if (options.generate_serialization ())
complexity += 1;
}
else
{
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
complexity += 6; // 13 parsing functions.
- if (options.value<CLI::generate_serialization> ())
+ if (options.generate_serialization ())
complexity += 4; // 8 serialization functions.
}
}
@@ -236,12 +236,12 @@ namespace CXX
}
Counts Counter::
- count (CLI::Options const& options,
+ count (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& path)
{
Counts counts;
- Context ctx (std::wcerr, tu, path, options, counts, false, 0, 0, 0, 0);
+ Context ctx (std::wcerr, tu, path, ops, counts, false, 0, 0, 0, 0);
Traversal::Schema schema;
Sources sources;
diff --git a/xsd/cxx/tree/counter.hxx b/xsd/cxx/tree/counter.hxx
index b5c7c8f..7c91068 100644
--- a/xsd/cxx/tree/counter.hxx
+++ b/xsd/cxx/tree/counter.hxx
@@ -7,7 +7,7 @@
#define CXX_TREE_COUNTER_HXX
#include <cxx/tree/elements.hxx>
-#include <cxx/tree/cli.hxx>
+#include <cxx/tree/options.hxx>
namespace CXX
{
@@ -19,7 +19,7 @@ namespace CXX
Counter (); // Dummy ctor, helps with long symbols on HP-UX.
Counts
- count (CLI::Options const&,
+ count (options const&,
SemanticGraph::Schema&,
SemanticGraph::Path const&);
};
diff --git a/xsd/cxx/tree/elements.cxx b/xsd/cxx/tree/elements.cxx
index 63f31a7..a608672 100644
--- a/xsd/cxx/tree/elements.cxx
+++ b/xsd/cxx/tree/elements.cxx
@@ -37,29 +37,14 @@ namespace CXX
Context (std::wostream& o,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
- CLI::Options const& ops,
+ options_type const& ops,
Counts const& counts_,
Boolean generate_xml_schema__,
StringLiteralMap const* map,
Regex const* fe,
Regex const* he,
Regex const* ie)
- : CXX::Context (o,
- root,
- path,
- map,
- ops.value<CLI::char_type> (),
- ops.value<CLI::char_encoding> (),
- ops.value<CLI::include_with_brackets> (),
- ops.value<CLI::include_prefix> (),
- ops.value<CLI::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::reserved_name> ()),
+ : CXX::Context (o, root, path, ops, map),
options (ops),
counts (counts_),
any_type (any_type_),
@@ -84,9 +69,9 @@ namespace CXX
as_decimal_type (as_decimal_type_),
generate_xml_schema (generate_xml_schema_),
doxygen (doxygen_),
- polymorphic (ops.value<CLI::generate_polymorphic> ()),
- polymorphic_all (ops.value<CLI::polymorphic_type_all> ()),
- detach (ops.value<CLI::generate_detach> ()),
+ polymorphic (ops.generate_polymorphic ()),
+ polymorphic_all (ops.polymorphic_type_all ()),
+ detach (ops.generate_detach ()),
fwd_expr (fe),
hxx_expr (he),
ixx_expr (ie),
@@ -96,7 +81,7 @@ namespace CXX
qname_type_ (L"::xsd::cxx::xml::qualified_name< " + char_type + L" >"),
parser_type_ (L"::xsd::cxx::xml::dom::parser< " + char_type + L" >"),
generate_xml_schema_ (generate_xml_schema__),
- doxygen_ (ops.value<CLI::generate_doxygen> ()),
+ doxygen_ (ops.generate_doxygen ()),
ns_scope_stack (ns_scope_stack_),
cxx_uq_id_expr_ (L"^[a-zA-Z_]\\w*$"),
cxx_uq_id_expr (cxx_uq_id_expr_)
@@ -118,13 +103,12 @@ namespace CXX
container = xs_name + L"::" + xsc.get<String> ("container");
flags_type = xs_name + L"::" + xsc.get<String> ("flags");
- if (ops.value<CLI::generate_element_type> ())
+ if (ops.generate_element_type ())
element_type = xs_name + L"::" + xsc.get<String> ("element-type");
properties_type = xs_name + L"::" + xsc.get<String> ("properties");
- if (!ops.value<CLI::suppress_parsing> () ||
- ops.value<CLI::generate_serialization> ())
+ if (!ops.suppress_parsing () || ops.generate_serialization ())
{
error_handler_type = xs_name + L"::" +
xsc.get<String> ("error-handler");
@@ -134,7 +118,7 @@ namespace CXX
dom_node_key_ = xs_name + L"::dom::" +
xsc.get<String> ("tree-node-key");
- if (ops.value<CLI::generate_serialization> ())
+ if (ops.generate_serialization ())
{
as_double_type_ = xs_name + L"::" +
xsc.get<String> ("as-double");
@@ -152,17 +136,17 @@ namespace CXX
// istream and ostream are templates and for now use the same
// names regardless of the naming convention.
//
- if (!ops.value<CLI::generate_extraction> ().empty ())
+ if (!ops.generate_extraction ().empty ())
istream_type = xs_name + L"::istream";
- if (!ops.value<CLI::generate_insertion> ().empty ())
+ if (!ops.generate_insertion ().empty ())
ostream_type = xs_name + L"::ostream";
}
// Xerces-C++ namespace. IntelliSense for some reason does not like
// it fully-qualified (maybe because it's a namespace alias).
//
- if (ops.value<CLI::generate_intellisense> ())
+ if (ops.generate_intellisense ())
xerces_ns = "xercesc";
else
xerces_ns = "::xercesc";
@@ -178,14 +162,14 @@ namespace CXX
// Custom type mapping.
//
- typedef Containers::Vector<NarrowString> Vector;
// Direct custom type mapping.
//
{
- Vector const& v (ops.value<CLI::custom_type> ());
+ NarrowStrings const& v (ops.custom_type ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (v.begin ()),
+ e (v.end ()); i != e; ++i)
{
String s (*i);
@@ -237,9 +221,10 @@ namespace CXX
// Regex custom type mapping.
//
{
- Vector const& v (ops.value<CLI::custom_type_regex> ());
+ NarrowStrings const& v (ops.custom_type_regex ());
- for (Vector::ConstIterator i (v.begin ()), e (v.end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (v.begin ()),
+ e (v.end ()); i != e; ++i)
{
String s (*i);
@@ -701,7 +686,7 @@ namespace CXX
Void GenerateDefaultCtor::
traverse (SemanticGraph::Any& a)
{
- if (options.value<CLI::generate_wildcard> () &&
+ if (options.generate_wildcard () &&
min (a) == 1 && max (a) == 1)
generate_ = true;
}
@@ -782,7 +767,7 @@ namespace CXX
Void GenerateFromBaseCtor::Traverser::
traverse (SemanticGraph::Any& a)
{
- if (options.value<CLI::generate_wildcard> () &&
+ if (options.generate_wildcard () &&
min (a) == 1 && max (a) == 1)
generate_ = true;
}
@@ -848,7 +833,7 @@ namespace CXX
Void FromBaseCtorArg::
traverse (SemanticGraph::Any& a)
{
- if (!options.value<CLI::generate_wildcard> ())
+ if (!options.generate_wildcard ())
return;
if (min (a) == 1 && max (a) == 1)
@@ -992,7 +977,7 @@ namespace CXX
Void CtorArgs::
traverse (SemanticGraph::Any& a)
{
- if (!options.value<CLI::generate_wildcard> ())
+ if (!options.generate_wildcard ())
return;
if (min (a) == 1 && max (a) == 1)
@@ -1081,7 +1066,7 @@ namespace CXX
Void CtorArgsWithoutBase::
traverse (SemanticGraph::Any& a)
{
- if (!options.value<CLI::generate_wildcard> ())
+ if (!options.generate_wildcard ())
return;
if (min (a) == 1 && max (a) == 1)
@@ -1170,9 +1155,9 @@ namespace CXX
// If we are not generating element types nor parsing/serialization
// code then we won't generate anything from it.
//
- if (!ctx_.options.value<CLI::generate_element_type> () &&
- ctx_.options.value<CLI::suppress_parsing> () &&
- !ctx_.options.value<CLI::generate_serialization> ())
+ if (!ctx_.options.generate_element_type () &&
+ ctx_.options.suppress_parsing () &&
+ !ctx_.options.generate_serialization ())
return false;
return true;
@@ -1181,33 +1166,33 @@ namespace CXX
Boolean GlobalElementBase::
doc_root_p (SemanticGraph::Element& e)
{
- if (!ctx_.options.value<CLI::root_element_first> () &&
- !ctx_.options.value<CLI::root_element_last> () &&
- !ctx_.options.value<CLI::root_element_all> () &&
- !ctx_.options.value<CLI::root_element_none> () &&
- ctx_.options.value<CLI::root_element> ().empty ())
+ if (!ctx_.options.root_element_first () &&
+ !ctx_.options.root_element_last () &&
+ !ctx_.options.root_element_all () &&
+ !ctx_.options.root_element_none () &&
+ ctx_.options.root_element ().empty ())
return true; // By default treat them all.
- if (ctx_.options.value<CLI::root_element_none> ())
+ if (ctx_.options.root_element_none ())
return false;
- if (ctx_.options.value<CLI::root_element_all> ())
+ if (ctx_.options.root_element_all ())
return true;
- if (ctx_.options.value<CLI::root_element_first> () &&
+ if (ctx_.options.root_element_first () &&
e.context ().count ("first") != 0)
return true;
- if (ctx_.options.value<CLI::root_element_last> () &&
+ if (ctx_.options.root_element_last () &&
e.context ().count ("last") != 0)
return true;
- typedef Cult::Containers::Vector<NarrowString> Names;
- Names const& names (ctx_.options.value<CLI::root_element> ());
+ NarrowStrings const& names (ctx_.options.root_element ());
// Hopefully nobody will specify more than a handful of names ;-).
//
- for (Names::ConstIterator i (names.begin ()); i != names.end (); ++i)
+ for (NarrowStrings::const_iterator i (names.begin ());
+ i != names.end (); ++i)
{
String name (*i);
diff --git a/xsd/cxx/tree/elements.hxx b/xsd/cxx/tree/elements.hxx
index edcb0d2..da9a182 100644
--- a/xsd/cxx/tree/elements.hxx
+++ b/xsd/cxx/tree/elements.hxx
@@ -14,10 +14,11 @@
#include <cult/containers/deque.hxx>
#include <cult/containers/vector.hxx>
-#include <cxx/elements.hxx>
+#include <types.hxx>
-#include <cxx/tree/cli.hxx>
+#include <cxx/elements.hxx>
+#include <cxx/tree/options.hxx>
namespace CXX
{
@@ -77,6 +78,8 @@ namespace CXX
typedef cutl::re::regexsub Regex;
typedef cutl::re::wregex WideRegexPat;
+ typedef Tree::options options_type;
+
struct DirectCustomTypeMapInfo
{
DirectCustomTypeMapInfo (String const& t = L"",
@@ -115,7 +118,7 @@ namespace CXX
Context (std::wostream& o,
SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
- CLI::Options const& ops,
+ options_type const& ops,
Counts const& counts_,
Boolean generate_xml_schema,
StringLiteralMap const*,
@@ -400,7 +403,7 @@ namespace CXX
write_rogue_text (WideChar const* s, Size size, Boolean rogue);
public:
- CLI::Options const& options;
+ options_type const& options;
Counts const& counts;
String& any_type;
String& any_simple_type;
@@ -1847,7 +1850,7 @@ namespace CXX
Includes (Context& c, Type type)
: ctx_ (c),
type_ (type),
- forward_ (c.options.value<CLI::generate_forward> ()),
+ forward_ (c.options.generate_forward ()),
namespace_ (c),
type_forward_ (c)
{
diff --git a/xsd/cxx/tree/fundamental-header.hxx b/xsd/cxx/tree/fundamental-header.hxx
index 327aa63..424034d 100644
--- a/xsd/cxx/tree/fundamental-header.hxx
+++ b/xsd/cxx/tree/fundamental-header.hxx
@@ -80,7 +80,7 @@ namespace CXX
FundamentalNamespace (Context& c)
: DocumentedNamespace (c),
Context (c),
- export_ (c.options.value<CLI::export_xml_schema> () && type_exp)
+ export_ (c.options.export_xml_schema () && type_exp)
{
*this >> names_ >> *this;
@@ -720,11 +720,11 @@ namespace CXX
{
SemanticGraph::Context& c (xs_ns ().context());
- Boolean parsing (!options.value<CLI::suppress_parsing> ());
- Boolean serialization (options.value<CLI::generate_serialization> ());
- Boolean element_map (options.value<CLI::generate_element_map> ());
+ Boolean parsing (!options.suppress_parsing ());
+ Boolean serialization (options.generate_serialization ());
+ Boolean element_map (options.generate_element_map ());
- if (options.value<CLI::generate_element_type> ())
+ if (options.generate_element_type ())
{
if (doxygen)
os << "/**" << endl
@@ -838,7 +838,7 @@ namespace CXX
//@@ Can't change names of ostream/istream since they are
// templates.
//
- if (!options.value<CLI::generate_insertion> ().empty ())
+ if (!options.generate_insertion ().empty ())
{
if (doxygen)
os << "/**" << endl
@@ -852,7 +852,7 @@ namespace CXX
<< endl;
}
- if (!options.value<CLI::generate_extraction> ().empty ())
+ if (!options.generate_extraction ().empty ())
{
if (doxygen)
os << "/**" << endl
@@ -1050,7 +1050,7 @@ namespace CXX
L"::xsd::cxx::tree::no_prefix_mapping< " + char_type + L" >");
}
- if (options.value<CLI::generate_polymorphic> ())
+ if (options.generate_polymorphic ())
{
if (parsing || serialization)
{
diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx
index 7a6759b..4c368b8 100644
--- a/xsd/cxx/tree/generator.cxx
+++ b/xsd/cxx/tree/generator.cxx
@@ -115,109 +115,6 @@ namespace CXX
"//\n\n";
}
- namespace Tree
- {
- namespace CLI
- {
- extern Key char_type = "char-type";
- extern Key char_encoding = "char-encoding";
- extern Key output_dir = "output-dir";
- extern Key generate_polymorphic = "generate-polymorphic";
- extern Key polymorphic_type = "polymorphic-type";
- extern Key polymorphic_type_all = "polymorphic-type-all";
- extern Key generate_serialization = "generate-serialization";
- extern Key generate_inline = "generate-inline";
- extern Key generate_ostream = "generate-ostream";
- extern Key generate_doxygen = "generate-doxygen";
- extern Key generate_comparison = "generate-comparison";
- extern Key generate_default_ctor = "generate-default-ctor";
- extern Key generate_from_base_ctor = "generate-from-base-ctor";
- extern Key suppress_assignment = "suppress-assignment";
- extern Key generate_detach = "generate-detach";
- extern Key generate_wildcard = "generate-wildcard";
- extern Key generate_insertion = "generate-insertion";
- extern Key generate_extraction = "generate-extraction";
- 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_parsing = "suppress-parsing";
- extern Key generate_element_type = "generate-element-type";
- extern Key generate_element_map = "generate-element-map";
- extern Key generate_intellisense = "generate-intellisense";
- extern Key omit_default_attributes = "omit-default-attributes";
- 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 type_naming = "type-naming";
- extern Key function_naming = "function-naming";
- extern Key type_regex = "type-regex";
- extern Key accessor_regex = "accessor-regex";
- extern Key one_accessor_regex = "one-accessor-regex";
- extern Key opt_accessor_regex = "opt-accessor-regex";
- extern Key seq_accessor_regex = "seq-accessor-regex";
- extern Key modifier_regex = "modifier-regex";
- extern Key one_modifier_regex = "one-modifier-regex";
- extern Key opt_modifier_regex = "opt-modifier-regex";
- extern Key seq_modifier_regex = "seq-modifier-regex";
- extern Key parser_regex = "parser-regex";
- extern Key serializer_regex = "serializer-regex";
- extern Key enumerator_regex = "enumerator-regex";
- extern Key element_type_regex = "element-type-regex";
- extern Key name_regex_trace = "name-regex-trace";
- 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 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 custom_type = "custom-type";
- extern Key custom_type_regex = "custom-type-regex";
- 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 parts = "parts";
- extern Key parts_suffix = "parts-suffix";
- extern Key export_symbol = "export-symbol";
- extern Key export_xml_schema = "export-xml-schema";
- extern Key export_maps = "export-maps";
- extern Key import_maps = "import-maps";
- extern Key show_anonymous = "show-anonymous";
- extern Key show_sloc = "show-sloc";
- extern Key proprietary_license = "proprietary-license";
- extern Key disable_multi_import = "disable-multi-import";
- }
- }
-
Void Tree::Generator::
usage ()
{
@@ -225,28 +122,6 @@ namespace CXX
CXX::options::print_usage (wcout);
}
- Tree::CLI::OptionsSpec Tree::Generator::
- options_spec ()
- {
- CLI::OptionsSpec spec;
-
- spec.option<CLI::char_type> ().default_value ("char");
-
- 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");
-
- spec.option<CLI::type_naming> ().default_value ("knr");
- spec.option<CLI::function_naming> ().default_value ("knr");
-
- spec.option<CLI::parts> ().default_value (1);
- spec.option<CLI::parts_suffix> ().default_value ("-");
-
- return spec;
- }
-
-
namespace
{
Void
@@ -296,14 +171,13 @@ namespace CXX
Void
append (WideOutputFileStream& os,
- Cult::Containers::Vector<NarrowString> const& primary,
- Cult::Containers::Vector<NarrowString> const& def)
+ NarrowStrings const& primary,
+ NarrowStrings const& def)
{
- Cult::Containers::Vector<NarrowString> const& v (
- primary.empty () ? def : primary);
+ NarrowStrings const& v (primary.empty () ? def : primary);
- for (Containers::Vector<NarrowString>::ConstIterator
- i (v.begin ()), e (v.end ()); i != e; ++i)
+ for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ());
+ i != e; ++i)
{
os << i->c_str () << endl;
}
@@ -312,7 +186,7 @@ namespace CXX
UnsignedLong Tree::Generator::
- generate (Tree::CLI::Options const& ops,
+ generate (Tree::options const& ops,
Schema& schema,
Path const& file_path,
Boolean fpt,
@@ -334,10 +208,10 @@ namespace CXX
{
// Do option validation.
//
- if (ops.value<CLI::parts> () < 1)
+ if (ops.parts () < 1)
{
wcerr << "error: invalid value for option --parts: " <<
- ops.value<CLI::parts> () << endl;
+ ops.parts () << endl;
throw Failed ();
}
@@ -379,8 +253,7 @@ namespace CXX
// Process polymorphic types.
//
- if (ops.value<CLI::generate_polymorphic> () &&
- !ops.value<CLI::polymorphic_type_all> ())
+ if (ops.generate_polymorphic () && !ops.polymorphic_type_all ())
{
PolymorphismProcessor proc;
if (!proc.process (ops, schema, file_path, disabled_warnings))
@@ -389,11 +262,9 @@ namespace CXX
// Parts.
//
- UnsignedLong parts (ops.value<CLI::parts> ());
- UnsignedLong units (
- counts.global_types + counts.generated_global_elements);
-
- UnsignedLong units_per_part (units / parts);
+ size_t parts (ops.parts ());
+ size_t units (counts.global_types + counts.generated_global_elements);
+ size_t units_per_part (units / parts);
if (parts != 1 && units_per_part < 1)
{
@@ -401,14 +272,14 @@ namespace CXX
throw Failed ();
}
- UnsignedLong complexity_per_part (counts.complexity_total / parts);
+ size_t complexity_per_part (counts.complexity_total / parts);
- NarrowString parts_suffix (ops.value<CLI::parts_suffix> ());
+ NarrowString parts_suffix (ops.parts_suffix ());
//
//
- 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
@@ -417,45 +288,41 @@ 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;
}
}
- 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);
// Generate code.
//
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 ());
- Regex hxx_expr (ops.value <CLI::hxx_regex> ().empty ()
+ Regex hxx_expr (ops.hxx_regex ().empty ()
? "#^(.+?)(\\.[^./\\\\]+)?$#$1" + hxx_suffix + "#"
- : ops.value <CLI::hxx_regex> ());
+ : ops.hxx_regex ());
- Regex ixx_expr (ops.value <CLI::ixx_regex> ().empty ()
+ Regex ixx_expr (ops.ixx_regex ().empty ()
? "#^(.+?)(\\.[^./\\\\]+)?$#$1" + ixx_suffix + "#"
- : ops.value <CLI::ixx_regex> ());
+ : ops.ixx_regex ());
- Regex cxx_expr (ops.value <CLI::cxx_regex> ().empty ()
+ Regex cxx_expr (ops.cxx_regex ().empty ()
? "#^(.+?)(\\.[^./\\\\]+)?$#$1" + cxx_suffix + "#"
- : ops.value <CLI::cxx_regex> ());
+ : ops.cxx_regex ());
- Regex fwd_expr (ops.value <CLI::fwd_regex> ().empty ()
+ Regex fwd_expr (ops.fwd_regex ().empty ()
? "#^(.+?)(\\.[^./\\\\]+)?$#$1" + fwd_suffix + "#"
- : ops.value <CLI::fwd_regex> ());
+ : ops.fwd_regex ());
if (!hxx_expr.match (name))
{
@@ -531,7 +398,7 @@ namespace CXX
Path out_dir;
- if (NarrowString dir = ops.value<CLI::output_dir> ())
+ if (NarrowString dir = ops.output_dir ())
{
try
{
@@ -647,16 +514,14 @@ 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;
hxx << copyright;
- if (ops.value<CLI::generate_doxygen> ())
+ if (ops.generate_doxygen ())
{
// Use native path format.
//
@@ -683,7 +548,7 @@ namespace CXX
//
WideInputFileStream prologue;
{
- NarrowString name (ops.value<CLI::prologue_file> ());
+ NarrowString name (ops.prologue_file ());
if (name)
open (prologue, name);
@@ -693,7 +558,7 @@ namespace CXX
//
WideInputFileStream epilogue;
{
- NarrowString name (ops.value<CLI::epilogue_file> ());
+ NarrowString name (ops.epilogue_file ());
if (name)
open (epilogue, name);
@@ -701,8 +566,8 @@ 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 ());
typedef
compiler::ostream_filter<compiler::cxx_indenter, wchar_t>
@@ -715,7 +580,7 @@ namespace CXX
//
//
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 ();
@@ -767,10 +632,8 @@ namespace CXX
fwd << "// Begin prologue." << endl
<< "//" << endl;
- append (fwd,
- ops.value<CLI::fwd_prologue> (),
- ops.value<CLI::prologue> ());
- append (fwd, ops.value<CLI::fwd_prologue_file> (), prologue);
+ append (fwd, ops.fwd_prologue (), ops.prologue ());
+ append (fwd, ops.fwd_prologue_file (), prologue);
fwd << "//" << endl
<< "// End prologue." << endl
@@ -813,10 +676,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> ());
+ append (fwd, ops.fwd_epilogue_file (), epilogue);
+ append (fwd, ops.fwd_epilogue (), ops.epilogue ());
fwd << "//" << endl
<< "// End epilogue." << endl
@@ -876,9 +737,8 @@ namespace CXX
hxx << "// Begin prologue." << endl
<< "//" << endl;
- append (
- hxx, ops.value<CLI::hxx_prologue> (), ops.value<CLI::prologue> ());
- append (hxx, ops.value<CLI::hxx_prologue_file> (), prologue);
+ append (hxx, ops.hxx_prologue (), ops.prologue ());
+ append (hxx, ops.hxx_prologue_file (), prologue);
hxx << "//" << endl
<< "// End prologue." << endl
@@ -932,17 +792,16 @@ namespace CXX
if (!generate_xml_schema)
{
- if (ops.value<CLI::generate_ostream> ())
+ if (ops.generate_ostream ())
generate_stream_header (ctx);
- if (!ops.value<CLI::generate_element_type> () &&
- !ops.value<CLI::suppress_parsing> ())
+ if (!ops.generate_element_type () && !ops.suppress_parsing ())
generate_parser_header (ctx);
- if (ops.value<CLI::generate_serialization> ())
+ if (ops.generate_serialization ())
generate_serialization_header (ctx);
- if (!ops.value<CLI::generate_insertion> ().empty ())
+ if (!ops.generate_insertion ().empty ())
generate_stream_insertion_header (ctx);
}
}
@@ -960,9 +819,8 @@ namespace CXX
hxx << "// Begin epilogue." << endl
<< "//" << endl;
- append (hxx, ops.value<CLI::hxx_epilogue_file> (), epilogue);
- append (
- hxx, ops.value<CLI::hxx_epilogue> (), ops.value<CLI::epilogue> ());
+ append (hxx, ops.hxx_epilogue_file (), epilogue);
+ append (hxx, ops.hxx_epilogue (), ops.epilogue ());
hxx << "//" << endl
<< "// End epilogue." << endl
@@ -1012,9 +870,8 @@ namespace CXX
ixx << "// Begin prologue." << endl
<< "//" << endl;
- append (
- ixx, ops.value<CLI::ixx_prologue> (), ops.value<CLI::prologue> ());
- append (ixx, ops.value<CLI::ixx_prologue_file> (), prologue);
+ append (ixx, ops.ixx_prologue (), ops.prologue ());
+ append (ixx, ops.ixx_prologue_file (), prologue);
ixx << "//" << endl
<< "// End prologue." << endl
@@ -1032,9 +889,8 @@ namespace CXX
ixx << "// Begin epilogue." << endl
<< "//" << endl;
- append (ixx, ops.value<CLI::ixx_epilogue_file> (), epilogue);
- append (
- ixx, ops.value<CLI::ixx_epilogue> (), ops.value<CLI::epilogue> ());
+ append (ixx, ops.ixx_epilogue_file (), epilogue);
+ append (ixx, ops.ixx_epilogue (), ops.epilogue ());
ixx << "//" << endl
<< "// End epilogue." << endl
@@ -1052,17 +908,17 @@ namespace CXX
//
if (source)
{
- UnsignedLong first_unit (0); // First unit in the current part.
+ size_t first_unit (0); // First unit in the current part.
- for (UnsignedLong part (0); part < parts; ++part)
+ for (size_t part (0); part < parts; ++part)
{
// Figure out the range of units for this part.
//
- UnsignedLong last_unit (first_unit);
+ size_t last_unit (first_unit);
if (units != 0)
{
- UnsignedLong complexity (counts.complexity[last_unit]);
+ size_t complexity (counts.complexity[last_unit]);
while (complexity < complexity_per_part)
{
@@ -1075,7 +931,7 @@ namespace CXX
// Check if the increase in complexity should be kept in this
// part or moved to the next.
//
- UnsignedLong new_complexity (
+ size_t new_complexity (
complexity + counts.complexity[last_unit + 1]);
if (new_complexity > complexity_per_part)
@@ -1099,8 +955,8 @@ namespace CXX
//
//
- UnsignedLong first (first_unit);
- UnsignedLong last (last_unit);
+ size_t first (first_unit);
+ size_t last (last_unit);
first_unit = last_unit + 1;
@@ -1130,10 +986,8 @@ namespace CXX
os << "// Begin prologue." << endl
<< "//" << endl;
- append (os,
- ops.value<CLI::cxx_prologue> (),
- ops.value<CLI::prologue> ());
- append (os, ops.value<CLI::cxx_prologue_file> (), prologue);
+ append (os, ops.cxx_prologue (), ops.prologue ());
+ append (os, ops.cxx_prologue_file (), prologue);
os << "//" << endl
<< "// End prologue." << endl
@@ -1154,20 +1008,19 @@ namespace CXX
generate_tree_source (ctx, first, last);
- if (ops.value<CLI::generate_ostream> ())
+ if (ops.generate_ostream ())
generate_stream_source (ctx, first, last);
- if (!ops.value<CLI::generate_element_type> () &&
- !ops.value<CLI::suppress_parsing> ())
+ if (!ops.generate_element_type () && !ops.suppress_parsing ())
generate_parser_source (ctx, first, last);
- if (ops.value<CLI::generate_serialization> ())
+ if (ops.generate_serialization ())
generate_serialization_source (ctx, first, last);
- if (!ops.value<CLI::generate_extraction> ().empty ())
+ if (!ops.generate_extraction ().empty ())
generate_stream_extraction_source (ctx);
- if (!ops.value<CLI::generate_insertion> ().empty ())
+ if (!ops.generate_insertion ().empty ())
generate_stream_insertion_source (ctx);
}
@@ -1176,10 +1029,8 @@ namespace CXX
os << "// Begin epilogue." << endl
<< "//" << endl;
- append (os, ops.value<CLI::cxx_epilogue_file> (), epilogue);
- append (os,
- ops.value<CLI::cxx_epilogue> (),
- ops.value<CLI::epilogue> ());
+ append (os, ops.cxx_epilogue_file (), epilogue);
+ append (os, ops.cxx_epilogue (), ops.epilogue ());
os << "//" << endl
<< "// End epilogue." << endl
diff --git a/xsd/cxx/tree/generator.hxx b/xsd/cxx/tree/generator.hxx
index ab88929..0e05585 100644
--- a/xsd/cxx/tree/generator.hxx
+++ b/xsd/cxx/tree/generator.hxx
@@ -14,7 +14,7 @@
#include <xsd.hxx>
#include <cxx/literal-map.hxx>
-#include <cxx/tree/cli.hxx>
+#include <cxx/tree/options.hxx>
namespace CXX
{
@@ -28,13 +28,10 @@ namespace CXX
static Void
usage ();
- static CLI::OptionsSpec
- options_spec ();
-
struct Failed {};
static UnsignedLong
- generate (CLI::Options const& options,
+ generate (options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
Boolean file_per_type,
diff --git a/xsd/cxx/tree/name-processor.cxx b/xsd/cxx/tree/name-processor.cxx
index ad1720f..5fc7876 100644
--- a/xsd/cxx/tree/name-processor.cxx
+++ b/xsd/cxx/tree/name-processor.cxx
@@ -36,7 +36,7 @@ namespace CXX
public:
struct Failed {};
- Context (CLI::Options const& options,
+ Context (Tree::options const& ops,
Counts const& counts,
Boolean generate_xml_schema,
SemanticGraph::Schema& root,
@@ -45,7 +45,7 @@ namespace CXX
: Tree::Context (std::wcerr,
root,
path,
- options,
+ ops,
counts,
generate_xml_schema,
&map,
@@ -54,7 +54,7 @@ namespace CXX
0),
global_type_names (global_type_names_),
global_element_names (global_element_names_),
- detach (options.value<CLI::generate_detach> ()),
+ detach (ops.generate_detach ()),
type_regex (type_regex_),
accessor_regex (accessor_regex_),
one_accessor_regex (one_accessor_regex_),
@@ -71,8 +71,8 @@ namespace CXX
{
typedef Containers::Vector<NarrowString> Vector;
- NarrowString tn (options.value<CLI::type_naming> ());
- NarrowString fn (options.value<CLI::function_naming> ());
+ NarrowString tn (options.type_naming ());
+ NarrowString fn (options.function_naming ());
// Type name regex.
@@ -116,9 +116,7 @@ namespace CXX
}
- compile_regex (options.value<CLI::type_regex> (),
- type_regex,
- "type");
+ compile_regex (options.type_regex (), type_regex, "type");
}
// Accessor name regex.
@@ -149,24 +147,23 @@ namespace CXX
accessor_regex.push_back ("/([^,]+)/get\\u$1/");
}
- compile_regex (options.value<CLI::accessor_regex> (),
+ compile_regex (options.accessor_regex (),
accessor_regex,
"accessor");
- compile_regex (options.value<CLI::one_accessor_regex> (),
+ compile_regex (options.one_accessor_regex (),
one_accessor_regex,
"one accessor");
- compile_regex (options.value<CLI::opt_accessor_regex> (),
+ compile_regex (options.opt_accessor_regex (),
opt_accessor_regex,
"optional accessor");
- compile_regex (options.value<CLI::seq_accessor_regex> (),
+ compile_regex (options.seq_accessor_regex (),
seq_accessor_regex,
"sequence accessor");
}
-
// Modifier name regex.
//
{
@@ -190,24 +187,23 @@ namespace CXX
modifier_regex.push_back ("/detach,([^,]+)/detach\\u$1/");
}
- compile_regex (options.value<CLI::modifier_regex> (),
+ compile_regex (options.modifier_regex (),
modifier_regex,
"modifier");
- compile_regex (options.value<CLI::one_modifier_regex> (),
+ compile_regex (options.one_modifier_regex (),
one_modifier_regex,
"one modifier");
- compile_regex (options.value<CLI::opt_modifier_regex> (),
+ compile_regex (options.opt_modifier_regex (),
opt_modifier_regex,
"optional modifier");
- compile_regex (options.value<CLI::seq_modifier_regex> (),
+ compile_regex (options.seq_modifier_regex (),
seq_modifier_regex,
"sequence modifier");
}
-
// Parser name regex.
//
{
@@ -222,9 +218,7 @@ namespace CXX
parser_regex.push_back ("/(.+)/parse\\u$1/");
}
- compile_regex (options.value<CLI::parser_regex> (),
- parser_regex,
- "parser");
+ compile_regex (options.parser_regex (), parser_regex, "parser");
}
// Serializer name regex.
@@ -241,7 +235,7 @@ namespace CXX
serializer_regex.push_back ("/(.+)/serialize\\u$1/");
}
- compile_regex (options.value<CLI::serializer_regex> (),
+ compile_regex (options.serializer_regex (),
serializer_regex,
"serializer");
}
@@ -253,14 +247,14 @@ namespace CXX
//
enumerator_regex.push_back ("/^$/empty/");
- compile_regex (options.value<CLI::enumerator_regex> (),
+ compile_regex (options.enumerator_regex (),
enumerator_regex,
"enumerator");
}
// Element type regex.
//
- compile_regex (options.value<CLI::element_type_regex> (),
+ compile_regex (options.element_type_regex (),
element_type_regex,
"element_type");
}
@@ -305,7 +299,7 @@ namespace CXX
RegexVector const& rv,
String const& id)
{
- Boolean trace (options.value<CLI::name_regex_trace> ());
+ Boolean trace (options.name_regex_trace ());
if (trace)
os << id << " name: '" << name << "'" << endl;
@@ -339,7 +333,7 @@ namespace CXX
RegexVector const& backup,
String const& id)
{
- Boolean trace (options.value<CLI::name_regex_trace> ());
+ Boolean trace (options.name_regex_trace ());
if (trace)
os << id << " name: '" << name << "'" << endl;
@@ -394,7 +388,7 @@ namespace CXX
String const& id)
{
String s (ns + L' ' + name);
- Boolean trace (options.value<CLI::name_regex_trace> ());
+ Boolean trace (options.name_regex_trace ());
if (trace)
os << id << " name: '" << s << "'" << endl;
@@ -430,7 +424,7 @@ namespace CXX
String const& id)
{
String s (ns + L' ' + name);
- Boolean trace (options.value<CLI::name_regex_trace> ());
+ Boolean trace (options.name_regex_trace ());
if (trace)
os << id << " name: '" << s << "'" << endl;
@@ -501,13 +495,12 @@ namespace CXX
private:
Void
- compile_regex (Containers::Vector<NarrowString> const& sv,
+ compile_regex (NarrowStrings const& sv,
RegexVector& rv,
String const& id)
{
- typedef Containers::Vector<NarrowString> Vector;
-
- for (Vector::ConstIterator i (sv.begin ()); i != sv.end (); ++i)
+ for (NarrowStrings::const_iterator i (sv.begin ()); i != sv.end ();
+ ++i)
{
try
{
@@ -1154,7 +1147,7 @@ namespace CXX
// Names for wildcards.
//
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
{
Boolean has_wildcard (false);
Any any (*this, member_set, stem_set, has_wildcard);
@@ -1271,7 +1264,7 @@ namespace CXX
if (!generate_p (e))
return;
- if (options.value<CLI::generate_element_type> ())
+ if (options.generate_element_type ())
{
SemanticGraph::Context& ec (e.context ());
@@ -1387,7 +1380,7 @@ namespace CXX
//
String p;
- if (!options.value<CLI::suppress_parsing> () && doc_root_p (e))
+ if (!options.suppress_parsing () && doc_root_p (e))
{
p = find_name (
escape (
@@ -1400,8 +1393,7 @@ namespace CXX
//
String s;
- if (options.value<CLI::generate_serialization> () &&
- doc_root_p (e))
+ if (options.generate_serialization () && doc_root_p (e))
{
s = find_name (
escape (
@@ -1887,13 +1879,13 @@ namespace CXX
process_name (n, "buffer", "buffer");
process_name (n, "time,zone", "time-zone");
- if (options.value<CLI::generate_element_type> ())
+ if (options.generate_element_type ())
process_name (n, "element,type", "element-type");
- if (options.value<CLI::generate_element_map> ())
+ if (options.generate_element_map ())
process_name (n, "element,map", "element-map");
- if (options.value<CLI::generate_serialization> ())
+ if (options.generate_serialization ())
{
process_name (n, "namespace,info", "namespace-info");
process_name (n, "namespace,infomap", "namespace-infomap");
@@ -1903,12 +1895,12 @@ namespace CXX
process_name (n, "facet", "facet");
}
- if (!options.value<CLI::generate_insertion> ().empty ())
+ if (!options.generate_insertion ().empty ())
{
process_name (n, "ostream", "ostream");
}
- if (!options.value<CLI::generate_extraction> ().empty ())
+ if (!options.generate_extraction ().empty ())
{
process_name (n, "istream", "istream");
}
@@ -1916,7 +1908,7 @@ namespace CXX
process_name (n, "flags", "flags");
process_name (n, "properties", "properties");
- NarrowString fn (options.value<CLI::function_naming> ());
+ NarrowString fn (options.function_naming ());
if (fn == "knr")
n.context ().set ("tree-node-key", String ("tree_node_key"));
@@ -1944,8 +1936,8 @@ namespace CXX
process_name (n, "error", "error");
process_name (n, "diagnostics", "diagnostics");
- if (!options.value<CLI::suppress_parsing> () ||
- options.value<CLI::generate_serialization> ())
+ if (!options.suppress_parsing () ||
+ options.generate_serialization ())
{
process_name (n, "error,handler", "error-handler");
}
@@ -2010,7 +2002,7 @@ namespace CXX
};
Boolean
- process_impl (CLI::Options const& ops,
+ process_impl (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
StringLiteralMap const& map)
@@ -2137,7 +2129,7 @@ namespace CXX
}
Boolean NameProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
StringLiteralMap const& map)
diff --git a/xsd/cxx/tree/name-processor.hxx b/xsd/cxx/tree/name-processor.hxx
index 09fc017..2d87388 100644
--- a/xsd/cxx/tree/name-processor.hxx
+++ b/xsd/cxx/tree/name-processor.hxx
@@ -7,6 +7,7 @@
#define CXX_TREE_NAME_PROCESSOR_HXX
#include <cxx/tree/elements.hxx>
+#include <cxx/tree/options.hxx>
namespace CXX
{
@@ -20,7 +21,7 @@ namespace CXX
NameProcessor (); // Dummy ctor, helps with long symbols on HP-UX.
Boolean
- process (CLI::Options const&,
+ process (options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
StringLiteralMap const&);
diff --git a/xsd/cxx/tree/options.cli b/xsd/cxx/tree/options.cli
index 58407fa..9d67653 100644
--- a/xsd/cxx/tree/options.cli
+++ b/xsd/cxx/tree/options.cli
@@ -46,7 +46,6 @@ namespace CXX
"Indicate that all types should be treated as polymorphic."
};
-
// Features.
//
bool --generate-serialization
@@ -55,12 +54,6 @@ namespace CXX
the object model back to XML."
};
- bool --generate-inline
- {
- "Generate simple functions inline. This option triggers creation of
- the inline file."
- };
-
bool --generate-ostream
{
"Generate ostream insertion operators (\cb{operator<<}) for generated
diff --git a/xsd/cxx/tree/parser-source.cxx b/xsd/cxx/tree/parser-source.cxx
index c4fcf57..ee83fd2 100644
--- a/xsd/cxx/tree/parser-source.cxx
+++ b/xsd/cxx/tree/parser-source.cxx
@@ -56,7 +56,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "u, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
@@ -86,7 +86,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "u, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
@@ -112,7 +112,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "u, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
@@ -222,7 +222,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "i, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
@@ -248,7 +248,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "i, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
@@ -275,7 +275,7 @@ namespace CXX
<< "::xsd::cxx::xml::dom::parse< " << char_type << " > (" << endl
<< "i, h, p, f";
- if (options.value<CLI::disable_multi_import> ())
+ if (options.disable_multi_import ())
os << " | ::xsd::cxx::xml::dom::no_muliple_imports";
os << "));"
diff --git a/xsd/cxx/tree/polymorphism-processor.cxx b/xsd/cxx/tree/polymorphism-processor.cxx
index b722e6b..66e7c63 100644
--- a/xsd/cxx/tree/polymorphism-processor.cxx
+++ b/xsd/cxx/tree/polymorphism-processor.cxx
@@ -666,7 +666,7 @@ namespace CXX
Char const* pass_two_key = "cxx-tree-polymorphism-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)
@@ -676,8 +676,8 @@ namespace CXX
// Prepare a set of polymorphic types.
//
- TypeSet poly_types (ops.value<CLI::polymorphic_type> ().begin (),
- ops.value<CLI::polymorphic_type> ().end ());
+ TypeSet poly_types (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.
@@ -780,7 +780,7 @@ namespace CXX
}
Boolean PolymorphismProcessor::
- process (CLI::Options const& ops,
+ process (options const& ops,
SemanticGraph::Schema& tu,
SemanticGraph::Path const& file,
const WarningSet& disabled_warnings)
diff --git a/xsd/cxx/tree/polymorphism-processor.hxx b/xsd/cxx/tree/polymorphism-processor.hxx
index 7752eb8..aebf8d4 100644
--- a/xsd/cxx/tree/polymorphism-processor.hxx
+++ b/xsd/cxx/tree/polymorphism-processor.hxx
@@ -10,7 +10,7 @@
#include <xsd-frontend/semantic-graph.hxx>
-#include <cxx/tree/cli.hxx>
+#include <cxx/tree/options.hxx>
#include <xsd.hxx>
@@ -24,7 +24,7 @@ namespace CXX
{
public:
Boolean
- process (CLI::Options const& options,
+ process (options const&,
XSDFrontend::SemanticGraph::Schema&,
XSDFrontend::SemanticGraph::Path const& file,
const WarningSet& disabled_warnings);
diff --git a/xsd/cxx/tree/serialization-header.cxx b/xsd/cxx/tree/serialization-header.cxx
index c7b9c1f..1070847 100644
--- a/xsd/cxx/tree/serialization-header.cxx
+++ b/xsd/cxx/tree/serialization-header.cxx
@@ -536,7 +536,7 @@ namespace CXX
Void
generate_serialization_header (Context& ctx)
{
- Boolean elemen_type (ctx.options.value<CLI::generate_element_type> ());
+ Boolean elemen_type (ctx.options.generate_element_type ());
if (!elemen_type)
ctx.os << "#include <iosfwd>" << endl
diff --git a/xsd/cxx/tree/serialization-source.cxx b/xsd/cxx/tree/serialization-source.cxx
index 05588bd..411a5ef 100644
--- a/xsd/cxx/tree/serialization-source.cxx
+++ b/xsd/cxx/tree/serialization-source.cxx
@@ -617,8 +617,7 @@ namespace CXX
{
// Make sure we serialize required fixed attributes.
//
- if (a.optional_p () &&
- options.value<CLI::omit_default_attributes> ())
+ if (a.optional_p () && options.omit_default_attributes ())
{
os << "if (i." << aname << " () != " << scope <<
"::" << edefault_value (a) << " ())";
@@ -735,7 +734,7 @@ namespace CXX
// Serialize anyAttribute content first so that is gets
// overriden by schema-defined attributes.
//
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
{
AnyAttribute any_attribute (*this, name);
Traversal::Names names (any_attribute);
@@ -752,7 +751,7 @@ namespace CXX
names >> element;
names >> attribute;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names >> any;
Complex::names (c, names);
@@ -889,7 +888,7 @@ namespace CXX
ElementType (Context& c)
: GlobalElementBase (c),
Context (c),
- element_map_ (c.options.value<CLI::generate_element_map> ())
+ element_map_ (c.options.generate_element_map ())
{
}
@@ -1246,7 +1245,7 @@ namespace CXX
UnsignedLong first,
UnsignedLong last)
{
- Boolean elemen_type (ctx.options.value<CLI::generate_element_type> ());
+ Boolean elemen_type (ctx.options.generate_element_type ());
if (!elemen_type)
ctx.os << "#include <ostream>" << endl
@@ -1260,8 +1259,8 @@ namespace CXX
ctx.os << "#include <xsd/cxx/tree/type-serializer-map.hxx>" << endl
<< endl;
- Boolean import_maps (ctx.options.value<CLI::import_maps> ());
- Boolean export_maps (ctx.options.value<CLI::export_maps> ());
+ Boolean import_maps (ctx.options.import_maps ());
+ Boolean export_maps (ctx.options.export_maps ());
if (import_maps || export_maps)
{
diff --git a/xsd/cxx/tree/stream-extraction-source.cxx b/xsd/cxx/tree/stream-extraction-source.cxx
index 293dba5..53eaa09 100644
--- a/xsd/cxx/tree/stream-extraction-source.cxx
+++ b/xsd/cxx/tree/stream-extraction-source.cxx
@@ -14,8 +14,6 @@ namespace CXX
{
namespace
{
- typedef Containers::Vector<NarrowString> Streams;
-
struct List: Traversal::List, Context
{
List (Context& c)
@@ -46,8 +44,9 @@ namespace CXX
base += L" >";
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ());
+ i != st.end (); ++i)
{
os << name << "::" << endl
<< name << " (" << istream_type << "< " <<
@@ -117,8 +116,9 @@ namespace CXX
String const& base (xs_string_type);
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
os << name << "::" << endl
<< name << " (" << istream_type << "< " <<
@@ -194,8 +194,9 @@ namespace CXX
value = evalue (e);
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
os << name << "::" << endl
<< name << " (" << istream_type << "< " <<
@@ -560,7 +561,7 @@ namespace CXX
inherits_ >> base_;
names_ctor_member_ >> ctor_member_;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names_ctor_member_ >> ctor_any_;
}
@@ -596,8 +597,9 @@ namespace CXX
}
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
os << name << "::" << endl
@@ -699,13 +701,13 @@ namespace CXX
{
if (ctx.polymorphic)
{
- Streams const& st (ctx.options.value<CLI::generate_extraction> ());
+ NarrowStrings const& st (ctx.options.generate_extraction ());
ctx.os << "#include <xsd/cxx/tree/stream-extraction-map.hxx>" << endl
<< endl;
- Boolean import_maps (ctx.options.value<CLI::import_maps> ());
- Boolean export_maps (ctx.options.value<CLI::export_maps> ());
+ Boolean import_maps (ctx.options.import_maps ());
+ Boolean export_maps (ctx.options.export_maps ());
if (import_maps || export_maps)
{
@@ -718,7 +720,8 @@ namespace CXX
<< "namespace tree"
<< "{";
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream (*i);
@@ -757,7 +760,8 @@ namespace CXX
<< "{";
UnsignedLong n (0);
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream (*i);
diff --git a/xsd/cxx/tree/stream-insertion-header.cxx b/xsd/cxx/tree/stream-insertion-header.cxx
index 8d00eb0..139bf8b 100644
--- a/xsd/cxx/tree/stream-insertion-header.cxx
+++ b/xsd/cxx/tree/stream-insertion-header.cxx
@@ -14,8 +14,6 @@ namespace CXX
{
namespace
{
- typedef Containers::Vector<NarrowString> Streams;
-
struct List: Traversal::List, Context
{
List (Context& c)
@@ -34,8 +32,9 @@ namespace CXX
if (renamed_type (l, name) && !name)
return;
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type (ostream_type + L"< " + String (*i) + L" >");
@@ -67,8 +66,9 @@ namespace CXX
if (renamed_type (u, name) && !name)
return;
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type (ostream_type + L"< " + String (*i) + L" >");
@@ -100,8 +100,9 @@ namespace CXX
if (renamed_type (e, name) && !name)
return;
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type (ostream_type + L"< " + String (*i) + L" >");
@@ -132,8 +133,9 @@ namespace CXX
if (renamed_type (c, name) && !name)
return;
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type (ostream_type + L"< " + String (*i) + L" >");
diff --git a/xsd/cxx/tree/stream-insertion-source.cxx b/xsd/cxx/tree/stream-insertion-source.cxx
index 00d9ae2..2dbbc79 100644
--- a/xsd/cxx/tree/stream-insertion-source.cxx
+++ b/xsd/cxx/tree/stream-insertion-source.cxx
@@ -14,8 +14,6 @@ namespace CXX
{
namespace
{
- typedef Containers::Vector<NarrowString> Streams;
-
struct List: Traversal::List, Context
{
List (Context& c)
@@ -46,8 +44,9 @@ namespace CXX
base += L" >";
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type ("::xsd::cxx::tree::ostream< " + *i + " >");
@@ -116,8 +115,9 @@ namespace CXX
String const& base (xs_string_type);
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type ("::xsd::cxx::tree::ostream< " + *i + " >");
@@ -193,8 +193,9 @@ namespace CXX
value = evalue (e);
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type ("::xsd::cxx::tree::ostream< " + *i + " >");
@@ -406,8 +407,9 @@ namespace CXX
Boolean has_body (has<Traversal::Member> (c) || c.inherits_p ());
UnsignedLong n (0);
- Streams const& st (options.value<CLI::generate_insertion> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_insertion ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream_type ("::xsd::cxx::tree::ostream< " + *i + " >");
@@ -474,13 +476,13 @@ namespace CXX
{
if (ctx.polymorphic)
{
- Streams const& st (ctx.options.value<CLI::generate_insertion> ());
+ NarrowStrings const& st (ctx.options.generate_insertion ());
ctx.os << "#include <xsd/cxx/tree/stream-insertion-map.hxx>" << endl
<< endl;
- Boolean import_maps (ctx.options.value<CLI::import_maps> ());
- Boolean export_maps (ctx.options.value<CLI::export_maps> ());
+ Boolean import_maps (ctx.options.import_maps ());
+ Boolean export_maps (ctx.options.export_maps ());
if (import_maps || export_maps)
{
@@ -493,7 +495,8 @@ namespace CXX
<< "namespace tree"
<< "{";
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream (*i);
@@ -531,7 +534,8 @@ namespace CXX
<< "{";
UnsignedLong n (0);
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
String stream (*i);
diff --git a/xsd/cxx/tree/stream-source.cxx b/xsd/cxx/tree/stream-source.cxx
index 1d4b5d9..e2c0ca5 100644
--- a/xsd/cxx/tree/stream-source.cxx
+++ b/xsd/cxx/tree/stream-source.cxx
@@ -423,8 +423,8 @@ namespace CXX
ctx.os << "#include <xsd/cxx/tree/std-ostream-map.hxx>" << endl
<< endl;
- Boolean import_maps (ctx.options.value<CLI::import_maps> ());
- Boolean export_maps (ctx.options.value<CLI::export_maps> ());
+ Boolean import_maps (ctx.options.import_maps ());
+ Boolean export_maps (ctx.options.export_maps ());
if (import_maps || export_maps)
{
diff --git a/xsd/cxx/tree/tree-forward.cxx b/xsd/cxx/tree/tree-forward.cxx
index 7ec6155..7f8f5ea 100644
--- a/xsd/cxx/tree/tree-forward.cxx
+++ b/xsd/cxx/tree/tree-forward.cxx
@@ -139,7 +139,7 @@ namespace CXX
Void
generate_forward (Context& ctx)
{
- NarrowString xml_schema (ctx.options.value<CLI::extern_xml_schema> ());
+ NarrowString xml_schema (ctx.options.extern_xml_schema ());
// Inlcude or Emit fundamental types.
//
@@ -164,21 +164,21 @@ namespace CXX
<< "#include <xsd/cxx/tree/types.hxx>" << endl
<< endl;
- if (!ctx.options.value<CLI::suppress_parsing> () ||
- ctx.options.value<CLI::generate_serialization> ())
+ if (!ctx.options.suppress_parsing () ||
+ ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/error-handler.hxx>" << endl
<< endl;
}
- if (!ctx.options.value<CLI::suppress_parsing> () ||
- ctx.options.value<CLI::generate_serialization> ())
+ if (!ctx.options.suppress_parsing () ||
+ ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/dom/auto-ptr.hxx>" << endl
<< endl;
}
- Boolean element_map (ctx.options.value<CLI::generate_element_map> ());
+ Boolean element_map (ctx.options.generate_element_map ());
if (element_map)
ctx.os << "#include <xsd/cxx/tree/element-map.hxx>" << endl
@@ -188,7 +188,7 @@ namespace CXX
// later in the individual generators for each feature because
// those headers provide implementation for the fundamental types.
//
- if (!ctx.options.value<CLI::suppress_parsing> ())
+ if (!ctx.options.suppress_parsing ())
{
ctx.os << "#include <xsd/cxx/tree/parsing.hxx>" << endl;
@@ -210,7 +210,7 @@ namespace CXX
ctx.os << endl;
}
- if (ctx.options.value<CLI::generate_serialization> ())
+ if (ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/dom/serialization-header.hxx>" << endl
<< "#include <xsd/cxx/tree/serialization.hxx>" << endl;
@@ -233,18 +233,17 @@ namespace CXX
ctx.os << endl;
}
- if (ctx.options.value<CLI::generate_ostream> ())
+ if (ctx.options.generate_ostream ())
{
ctx.os << "#include <xsd/cxx/tree/std-ostream-operators.hxx>" << endl
<< endl;
}
- typedef Containers::Vector<NarrowString> Streams;
-
- Streams const& ist (ctx.options.value<CLI::generate_insertion> ());
+ NarrowStrings const& ist (ctx.options.generate_insertion ());
if (!ist.empty ())
{
- for (Streams::ConstIterator i (ist.begin ()); i != ist.end (); ++i)
+ for (NarrowStrings::const_iterator i (ist.begin ()); i != ist.end ();
+ ++i)
{
if (*i == "ACE_OutputCDR")
ctx.os << "#include <xsd/cxx/tree/ace-cdr-stream-insertion.hxx>"
@@ -258,10 +257,11 @@ namespace CXX
<< endl;
}
- Streams const& est (ctx.options.value<CLI::generate_extraction> ());
+ NarrowStrings const& est (ctx.options.generate_extraction ());
if (!est.empty ())
{
- for (Streams::ConstIterator i (est.begin ()); i != est.end (); ++i)
+ for (NarrowStrings::const_iterator i (est.begin ()); i != est.end ();
+ ++i)
{
if (*i == "ACE_InputCDR")
ctx.os << "#include <xsd/cxx/tree/ace-cdr-stream-extraction.hxx>"
@@ -288,7 +288,7 @@ namespace CXX
// First emit header includes.
//
- if (ctx.options.value<CLI::generate_forward> ())
+ if (ctx.options.generate_forward ())
{
Traversal::Schema schema;
Includes includes (ctx, Includes::forward);
diff --git a/xsd/cxx/tree/tree-header.cxx b/xsd/cxx/tree/tree-header.cxx
index e02e768..9d7aea5 100644
--- a/xsd/cxx/tree/tree-header.cxx
+++ b/xsd/cxx/tree/tree-header.cxx
@@ -16,8 +16,6 @@ namespace CXX
{
namespace
{
- typedef Containers::Vector<NarrowString> Streams;
-
// List mapping.
//
struct List: Traversal::List, Context
@@ -142,8 +140,9 @@ namespace CXX
// c-tor (istream&)
//
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
if (doxygen)
{
@@ -167,7 +166,7 @@ namespace CXX
<< endl;
}
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -353,7 +352,7 @@ namespace CXX
<< "public:" << endl
<< endl;
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
// c-tor ()
//
@@ -400,8 +399,9 @@ namespace CXX
// c-tor (istream&)
//
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
if (doxygen)
{
@@ -425,7 +425,7 @@ namespace CXX
<< endl;
}
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -688,7 +688,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
if (doxygen)
{
@@ -808,8 +808,9 @@ namespace CXX
// c-tor (istream&)
//
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
if (doxygen)
{
@@ -833,7 +834,7 @@ namespace CXX
<< endl;
}
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -1849,7 +1850,7 @@ namespace CXX
if (max (m) != 1)
{
String const& container (econtainer (m));
- Boolean isense (options.value<CLI::generate_intellisense> ());
+ Boolean isense (options.generate_intellisense ());
// sequence
//
@@ -2269,11 +2270,11 @@ namespace CXX
inherits_member_ >> member_name_;
names_ >> member_;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names_ >> any_;
names_data_ >> data_member_;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names_data_ >> data_any_;
}
@@ -2293,7 +2294,7 @@ namespace CXX
Boolean hae (has<Traversal::Any> (c));
Boolean haa (has<Traversal::AnyAttribute> (c));
- Boolean gen_wildcard (options.value<CLI::generate_wildcard> ());
+ Boolean gen_wildcard (options.generate_wildcard ());
Boolean simple (true);
{
@@ -2426,7 +2427,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
// c-tor (ultimate-base, all-non-optional-members) will become
// default c-tor if our inheritance hierarchy has no required
@@ -2460,7 +2461,7 @@ namespace CXX
// c-tor (base, all-non-optional-members)
//
- if (options.value<CLI::generate_from_base_ctor> ())
+ if (options.generate_from_base_ctor ())
{
// c-tor (base, all-non-optional-members) will be equivalent to
// c-tor (ultimate-base, all-non-optional-members) unless our
@@ -2826,8 +2827,9 @@ namespace CXX
// c-tor (istream&)
//
- Streams const& st (options.value<CLI::generate_extraction> ());
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ NarrowStrings const& st (options.generate_extraction ());
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
if (doxygen)
{
@@ -2852,7 +2854,7 @@ namespace CXX
}
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -2975,7 +2977,7 @@ namespace CXX
if (!simple)
{
- if (options.value<CLI::suppress_assignment> ())
+ if (options.suppress_assignment ())
{
priv = true;
os << "private:" << endl;
@@ -3049,7 +3051,7 @@ namespace CXX
<< "//@cond" << endl
<< endl;
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// parse (xercesc::DOMElement)
//
@@ -3068,7 +3070,8 @@ namespace CXX
//
if (has_members)
{
- for (Streams::ConstIterator i (st.begin ()); i != st.end (); ++i)
+ for (NarrowStrings::const_iterator i (st.begin ()); i != st.end ();
+ ++i)
{
os << "void" << endl
<< unclash (name, "parse") << " (" <<
@@ -3100,7 +3103,7 @@ namespace CXX
// Comparison operators.
//
- if (options.value<CLI::generate_comparison> () &&
+ if (options.generate_comparison () &&
(has_members || !c.inherits_p () ||
((hae || haa) && gen_wildcard)))
{
@@ -3406,7 +3409,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
if (doxygen)
{
@@ -3466,7 +3469,7 @@ namespace CXX
<< endl;
}
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -3674,21 +3677,21 @@ namespace CXX
<< "#include <xsd/cxx/tree/types.hxx>" << endl
<< endl;
- if (!ctx.options.value<CLI::suppress_parsing> () ||
- ctx.options.value<CLI::generate_serialization> ())
+ if (!ctx.options.suppress_parsing () ||
+ ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/error-handler.hxx>" << endl
<< endl;
}
- if (!ctx.options.value<CLI::suppress_parsing> () ||
- ctx.options.value<CLI::generate_serialization> ())
+ if (!ctx.options.suppress_parsing () ||
+ ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/dom/auto-ptr.hxx>" << endl
<< endl;
}
- Boolean element_map (ctx.options.value<CLI::generate_element_map> ());
+ Boolean element_map (ctx.options.generate_element_map ());
if (element_map)
ctx.os << "#include <xsd/cxx/tree/element-map.hxx>" << endl
@@ -3698,7 +3701,7 @@ namespace CXX
// later in the individual generators for each feature because
// those headers provide implementation for the fundamental types.
//
- if (!ctx.options.value<CLI::suppress_parsing> ())
+ if (!ctx.options.suppress_parsing ())
{
ctx.os << "#include <xsd/cxx/tree/parsing.hxx>" << endl;
@@ -3719,7 +3722,7 @@ namespace CXX
ctx.os << endl;
}
- if (ctx.options.value<CLI::generate_serialization> ())
+ if (ctx.options.generate_serialization ())
{
ctx.os << "#include <xsd/cxx/xml/dom/serialization-header.hxx>" << endl
<< "#include <xsd/cxx/tree/serialization.hxx>" << endl;
@@ -3741,16 +3744,17 @@ namespace CXX
ctx.os << endl;
}
- if (ctx.options.value<CLI::generate_ostream> ())
+ if (ctx.options.generate_ostream ())
{
ctx.os << "#include <xsd/cxx/tree/std-ostream-operators.hxx>" << endl
<< endl;
}
- Streams const& ist (ctx.options.value<CLI::generate_insertion> ());
+ NarrowStrings const& ist (ctx.options.generate_insertion ());
if (!ist.empty ())
{
- for (Streams::ConstIterator i (ist.begin ()); i != ist.end (); ++i)
+ for (NarrowStrings::const_iterator i (ist.begin ()); i != ist.end ();
+ ++i)
{
if (*i == "ACE_OutputCDR")
ctx.os << "#include <xsd/cxx/tree/ace-cdr-stream-insertion.hxx>"
@@ -3764,10 +3768,11 @@ namespace CXX
<< endl;
}
- Streams const& est (ctx.options.value<CLI::generate_extraction> ());
+ NarrowStrings const& est (ctx.options.generate_extraction ());
if (!est.empty ())
{
- for (Streams::ConstIterator i (est.begin ()); i != est.end (); ++i)
+ for (NarrowStrings::const_iterator i (est.begin ()); i != est.end ();
+ ++i)
{
if (*i == "ACE_InputCDR")
ctx.os << "#include <xsd/cxx/tree/ace-cdr-stream-extraction.hxx>"
@@ -3795,7 +3800,7 @@ namespace CXX
}
else
{
- Boolean inline_ (ctx.options.value<CLI::generate_inline> ());
+ Boolean inline_ (ctx.options.generate_inline ());
ctx.os << "#include <memory> // std::auto_ptr" << endl
<< "#include <limits> // std::numeric_limits" << endl
@@ -3815,23 +3820,23 @@ namespace CXX
<< "#include <xsd/cxx/tree/list.hxx>" << endl
<< endl;
- if (!ctx.options.value<CLI::suppress_parsing> ())
+ if (!ctx.options.suppress_parsing ())
{
ctx.os << "#include <xsd/cxx/xml/dom/parsing-header.hxx>" << endl
<< endl;
}
- if (ctx.options.value<CLI::generate_wildcard> ())
+ if (ctx.options.generate_wildcard ())
{
- if (ctx.options.value<CLI::suppress_parsing> () ||
- !ctx.options.value<CLI::generate_serialization> ())
+ if (ctx.options.suppress_parsing () ||
+ !ctx.options.generate_serialization ())
ctx.os << "#include <xsd/cxx/xml/dom/auto-ptr.hxx>" << endl;
ctx.os << "#include <xsd/cxx/tree/containers-wildcard.hxx>" << endl
<< endl;
}
- if (!ctx.options.value<CLI::generate_extraction> ().empty ())
+ if (!ctx.options.generate_extraction ().empty ())
ctx.os << "#include <xsd/cxx/tree/istream-fwd.hxx>" << endl
<< endl;
@@ -3888,7 +3893,7 @@ namespace CXX
names >> complex;
names >> enumeration;
- if (ctx.options.value<CLI::generate_element_type> ())
+ if (ctx.options.generate_element_type ())
names >> element;
schema.dispatch (ctx.schema_root);
diff --git a/xsd/cxx/tree/tree-inline.cxx b/xsd/cxx/tree/tree-inline.cxx
index 45a62e1..9656a2d 100644
--- a/xsd/cxx/tree/tree-inline.cxx
+++ b/xsd/cxx/tree/tree-inline.cxx
@@ -123,7 +123,7 @@ namespace CXX
<< "//" << endl
<< endl;
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
// c-tor ()
//
@@ -276,7 +276,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
os << inl
<< name << "::" << endl
@@ -883,7 +883,7 @@ namespace CXX
Member member (*this, name);
Traversal::Names names;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names >> any;
names >> member;
@@ -1012,7 +1012,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_);
@@ -1053,7 +1053,7 @@ namespace CXX
names >> complex;
names >> enumeration;
- if (ctx.options.value<CLI::generate_element_type> ())
+ if (ctx.options.generate_element_type ())
names >> element;
schema.dispatch (ctx.schema_root);
diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx
index c20876b..45628cf 100644
--- a/xsd/cxx/tree/tree-source.cxx
+++ b/xsd/cxx/tree/tree-source.cxx
@@ -39,7 +39,7 @@ namespace CXX
<< "//" << endl
<< endl;
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
SemanticGraph::Type& item_type (l.argumented ().type ());
String base (L"::xsd::cxx::tree::list< " +
@@ -114,7 +114,7 @@ namespace CXX
// If this type is anonymous but substitutes, then it will
// be registered as part of the substitution registration.
//
- if (!anonymous_p (l) && !options.value<CLI::suppress_parsing> ())
+ if (!anonymous_p (l) && !options.suppress_parsing ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::type_factory_initializer< 0, " <<
@@ -126,7 +126,7 @@ namespace CXX
}
if ((!anonymous_p (l) || anonymous_substitutes_p (l)) &&
- options.value<CLI::generate_comparison> ())
+ options.generate_comparison ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::comparison_initializer< 0, " <<
@@ -175,7 +175,7 @@ namespace CXX
<< "//" << endl
<< endl;
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -229,7 +229,7 @@ namespace CXX
// If this type is anonymous but substitutes, then it will
// be registered as part of the substitution registration.
//
- if (!anonymous_p (u) && !options.value<CLI::suppress_parsing> ())
+ if (!anonymous_p (u) && !options.suppress_parsing ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::type_factory_initializer< 0, " <<
@@ -241,7 +241,7 @@ namespace CXX
}
if ((!anonymous_p (u) || anonymous_substitutes_p (u)) &&
- options.value<CLI::generate_comparison> ())
+ options.generate_comparison ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::comparison_initializer< 0, " <<
@@ -375,7 +375,7 @@ namespace CXX
<< "//" << endl
<< endl;
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -529,7 +529,7 @@ namespace CXX
// If this type is anonymous but substitutes, then it will
// be registered as part of the substitution registration.
//
- if (!anonymous_p (e) && !options.value<CLI::suppress_parsing> ())
+ if (!anonymous_p (e) && !options.suppress_parsing ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::type_factory_initializer< 0, " <<
@@ -541,7 +541,7 @@ namespace CXX
}
if ((!anonymous_p (e) || anonymous_substitutes_p (e)) &&
- options.value<CLI::generate_comparison> ())
+ options.generate_comparison ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::comparison_initializer< 0, " <<
@@ -1327,7 +1327,7 @@ namespace CXX
virtual Void
traverse (SemanticGraph::Any& a)
{
- if (!options.value<CLI::generate_wildcard> ())
+ if (!options.generate_wildcard ())
return;
if (min (a) == 1 && max (a) == 1)
@@ -1822,14 +1822,14 @@ namespace CXX
virtual Void
traverse (SemanticGraph::Any&)
{
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
generate_ = true;
}
virtual Void
traverse (SemanticGraph::AnyAttribute&)
{
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
generate_ = true;
}
@@ -2036,7 +2036,7 @@ namespace CXX
virtual Void
traverse (SemanticGraph::AnyAttribute&)
{
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
has_at_ = true;
}
@@ -2148,7 +2148,7 @@ namespace CXX
comparison_member_ (c),
facet_array_ (c)
{
- Boolean gen_wildcard (options.value<CLI::generate_wildcard> ());
+ Boolean gen_wildcard (options.generate_wildcard ());
inherits_member_ >> member_name_;
@@ -2291,7 +2291,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
Boolean generate (false);
{
@@ -2324,7 +2324,7 @@ namespace CXX
// c-tor (base, all-non-optional-members)
//
- if (options.value<CLI::generate_from_base_ctor> ())
+ if (options.generate_from_base_ctor ())
{
Boolean generate (false);
{
@@ -2843,7 +2843,7 @@ namespace CXX
names >> copy_member;
- if (options.value<CLI::generate_wildcard> ())
+ if (options.generate_wildcard ())
names >> copy_any;
Complex::names (c, names);
@@ -2862,11 +2862,11 @@ namespace CXX
Boolean ha (has<Traversal::Attribute> (c));
Boolean haa (has<Traversal::AnyAttribute> (c));
- Boolean gen_wildcard (options.value<CLI::generate_wildcard> ());
+ Boolean gen_wildcard (options.generate_wildcard ());
//
//
- if (!options.value<CLI::suppress_parsing> ())
+ if (!options.suppress_parsing ())
{
// c-tor (xercesc::DOMElement)
//
@@ -3051,7 +3051,7 @@ namespace CXX
// operator=
//
- if (!options.value<CLI::suppress_assignment> () &&
+ if (!options.suppress_assignment () &&
(he || ha || (gen_wildcard && (hae || haa))))
{
os << name << "& " << name << "::" << endl
@@ -3090,7 +3090,7 @@ namespace CXX
// If this type is anonymous but substitutes, then it will
// be registered as part of the substitution registration.
//
- if (!anonymous_p (c) && !options.value<CLI::suppress_parsing> ())
+ if (!anonymous_p (c) && !options.suppress_parsing ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::type_factory_initializer< 0, " <<
@@ -3102,7 +3102,7 @@ namespace CXX
}
if ((!anonymous_p (c) || anonymous_substitutes_p (c)) &&
- options.value<CLI::generate_comparison> ())
+ options.generate_comparison ())
{
os << "static" << endl
<< "const ::xsd::cxx::tree::comparison_initializer< 0, " <<
@@ -3114,7 +3114,7 @@ namespace CXX
// Comparison operators.
//
- if (options.value<CLI::generate_comparison> () &&
+ if (options.generate_comparison () &&
(he || ha || !c.inherits_p () ||
((hae || haa) && gen_wildcard)))
{
@@ -3212,8 +3212,8 @@ namespace CXX
GlobalElement (Context& c)
: GlobalElementBase (c),
Context (c),
- element_type_ (c.options.value<CLI::generate_element_type> ()),
- element_map_ (c.options.value<CLI::generate_element_map> ()),
+ element_type_ (c.options.generate_element_type ()),
+ element_map_ (c.options.generate_element_map ()),
type_name_ (c)
{
belongs_ >> type_name_;
@@ -3273,7 +3273,7 @@ namespace CXX
// default c-tor
//
- if (options.value<CLI::generate_default_ctor> ())
+ if (options.generate_default_ctor ())
{
os << name << "::" << endl
<< name << " ()" << endl
@@ -3308,7 +3308,7 @@ namespace CXX
String const& name_member (ec.get<String> ("element-name-member"));
String const& ns_member (ec.get<String> ("element-ns-member"));
- Boolean parsing (!options.value<CLI::suppress_parsing> ());
+ Boolean parsing (!options.suppress_parsing ());
if (parsing)
{
String const& tr (etraits (e));
@@ -3409,7 +3409,7 @@ namespace CXX
}
if (polymorphic && e.substitutes_p () &&
- !options.value<CLI::suppress_parsing> ())
+ !options.suppress_parsing ())
{
String const& name (ename (e));
Type& r (e.substitutes ().root ());
@@ -3444,20 +3444,20 @@ namespace CXX
UnsignedLong first,
UnsignedLong last)
{
- if (ctx.options.value<CLI::generate_wildcard> ())
+ if (ctx.options.generate_wildcard ())
{
ctx.os << "#include <xsd/cxx/xml/dom/wildcard-source.hxx>" << endl
<< endl;
}
- if (!ctx.options.value<CLI::suppress_parsing> ())
+ if (!ctx.options.suppress_parsing ())
ctx.os << "#include <xsd/cxx/xml/dom/parsing-source.hxx>" << endl
<< endl;
if (ctx.polymorphic)
{
- Boolean parsing (!ctx.options.value<CLI::suppress_parsing> ());
- Boolean comparison (ctx.options.value<CLI::generate_comparison> ());
+ Boolean parsing (!ctx.options.suppress_parsing ());
+ Boolean comparison (ctx.options.generate_comparison ());
if (parsing)
ctx.os << "#include <xsd/cxx/tree/type-factory-map.hxx>" << endl
@@ -3469,8 +3469,8 @@ namespace CXX
if (parsing || comparison)
{
- Boolean import_maps (ctx.options.value<CLI::import_maps> ());
- Boolean export_maps (ctx.options.value<CLI::export_maps> ());
+ Boolean import_maps (ctx.options.import_maps ());
+ Boolean export_maps (ctx.options.export_maps ());
if (import_maps || export_maps)
{
diff --git a/xsd/cxx/tree/validator.cxx b/xsd/cxx/tree/validator.cxx
index 1fc29ca..00dfe29 100644
--- a/xsd/cxx/tree/validator.cxx
+++ b/xsd/cxx/tree/validator.cxx
@@ -27,7 +27,7 @@ namespace CXX
public:
ValidationContext (SemanticGraph::Schema& root,
SemanticGraph::Path const& path,
- CLI::Options const& options,
+ Tree::options const& ops,
const WarningSet& disabled_warnings,
Counts const& counts,
Boolean generate_xml_schema,
@@ -35,7 +35,7 @@ namespace CXX
: Context (std::wcerr,
root,
path,
- options,
+ ops,
counts,
generate_xml_schema,
0,
@@ -461,7 +461,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;
@@ -480,7 +480,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) << "' "
@@ -496,7 +496,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) << "' "
@@ -528,7 +528,7 @@ namespace CXX
}
Boolean Validator::
- validate (CLI::Options const& options,
+ validate (options const& ops,
SemanticGraph::Schema& schema,
SemanticGraph::Path const& path,
const WarningSet& disabled_warnings,
@@ -536,12 +536,12 @@ namespace CXX
{
Boolean valid (true);
ValidationContext ctx (
- schema, path, options, disabled_warnings, counts, false, valid);
+ schema, path, ops, disabled_warnings, counts, false, valid);
//
//
- Boolean import_maps (options.value<CLI::import_maps> ());
- Boolean export_maps (options.value<CLI::export_maps> ());
+ Boolean import_maps (ops.import_maps ());
+ Boolean export_maps (ops.export_maps ());
if (import_maps && export_maps)
{
@@ -569,17 +569,17 @@ namespace CXX
//
//
- if (options.value<CLI::char_type> () != "char" &&
- options.value<CLI::char_type> () != "wchar_t" &&
+ if (ops.char_type () != "char" &&
+ ops.char_type () != "wchar_t" &&
!ctx.is_disabled ("T003"))
{
wcerr << "warning T003: unknown base character type '" <<
- options.value<CLI::char_type> ().c_str () << "'" << endl;
+ ops.char_type ().c_str () << "'" << endl;
}
//
//
- NarrowString tn (options.value<CLI::type_naming> ());
+ NarrowString tn (ops.type_naming ());
if (tn != "knr" && tn != "ucc" && tn != "java")
{
@@ -589,7 +589,7 @@ namespace CXX
return false;
}
- NarrowString fn (options.value<CLI::function_naming> ());
+ NarrowString fn (ops.function_naming ());
if (fn != "knr" && fn != "lcc" && fn != "java")
{
@@ -601,11 +601,11 @@ namespace CXX
//
//
- Boolean element_type (options.value<CLI::generate_element_type> ());
- Boolean par (!options.value<CLI::suppress_parsing> ());
- Boolean ser (options.value<CLI::generate_serialization> ());
+ Boolean element_type (ops.generate_element_type ());
+ Boolean par (!ops.suppress_parsing ());
+ Boolean ser (ops.generate_serialization ());
- if (options.value<CLI::generate_element_map> ())
+ if (ops.generate_element_map ())
{
if (!element_type)
{
@@ -631,11 +631,11 @@ namespace CXX
if (counts.global_elements > 1 &&
(element_type || par || ser) &&
- !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 ("T004"))
{
wcerr << schema.file () << ": warning T004: generating ";
diff --git a/xsd/cxx/tree/validator.hxx b/xsd/cxx/tree/validator.hxx
index 62810a7..ad156ff 100644
--- a/xsd/cxx/tree/validator.hxx
+++ b/xsd/cxx/tree/validator.hxx
@@ -7,7 +7,7 @@
#define CXX_TREE_VALIDATOR_HXX
#include <cxx/tree/elements.hxx>
-#include <cxx/tree/cli.hxx>
+#include <cxx/tree/options.hxx>
#include <xsd.hxx>
@@ -21,7 +21,7 @@ namespace CXX
Validator (); // Dummy ctor, helps with long symbols on HP-UX.
Boolean
- validate (CLI::Options const& options,
+ validate (options const&,
SemanticGraph::Schema&,
SemanticGraph::Path const& tu,
const WarningSet& disabled_warnings,