From c04f7d6ed04d62efafa79a87bcde6c5f62e95327 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jun 2012 11:54:24 +0200 Subject: Completion of the CLI port --- xsd/cxx/tree/tree-header.cxx | 99 +++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 47 deletions(-) (limited to 'xsd/cxx/tree/tree-header.cxx') 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 Streams; - // List mapping. // struct List: Traversal::List, Context @@ -142,8 +140,9 @@ namespace CXX // c-tor (istream&) // - Streams const& st (options.value ()); - 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 ()) + if (!options.suppress_parsing ()) { // c-tor (xercesc::DOMElement) // @@ -353,7 +352,7 @@ namespace CXX << "public:" << endl << endl; - if (options.value ()) + if (options.generate_default_ctor ()) { // c-tor () // @@ -400,8 +399,9 @@ namespace CXX // c-tor (istream&) // - Streams const& st (options.value ()); - 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 ()) + if (!options.suppress_parsing ()) { // c-tor (xercesc::DOMElement) // @@ -688,7 +688,7 @@ namespace CXX // default c-tor // - if (options.value ()) + if (options.generate_default_ctor ()) { if (doxygen) { @@ -808,8 +808,9 @@ namespace CXX // c-tor (istream&) // - Streams const& st (options.value ()); - 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 ()) + 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 ()); + Boolean isense (options.generate_intellisense ()); // sequence // @@ -2269,11 +2270,11 @@ namespace CXX inherits_member_ >> member_name_; names_ >> member_; - if (options.value ()) + if (options.generate_wildcard ()) names_ >> any_; names_data_ >> data_member_; - if (options.value ()) + if (options.generate_wildcard ()) names_data_ >> data_any_; } @@ -2293,7 +2294,7 @@ namespace CXX Boolean hae (has (c)); Boolean haa (has (c)); - Boolean gen_wildcard (options.value ()); + Boolean gen_wildcard (options.generate_wildcard ()); Boolean simple (true); { @@ -2426,7 +2427,7 @@ namespace CXX // default c-tor // - if (options.value ()) + 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 ()) + 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 ()); - 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 ()) + if (!options.suppress_parsing ()) { // c-tor (xercesc::DOMElement) // @@ -2975,7 +2977,7 @@ namespace CXX if (!simple) { - if (options.value ()) + if (options.suppress_assignment ()) { priv = true; os << "private:" << endl; @@ -3049,7 +3051,7 @@ namespace CXX << "//@cond" << endl << endl; - if (!options.value ()) + 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 () && + 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 ()) + if (options.generate_default_ctor ()) { if (doxygen) { @@ -3466,7 +3469,7 @@ namespace CXX << endl; } - if (!options.value ()) + if (!options.suppress_parsing ()) { // c-tor (xercesc::DOMElement) // @@ -3674,21 +3677,21 @@ namespace CXX << "#include " << endl << endl; - if (!ctx.options.value () || - ctx.options.value ()) + if (!ctx.options.suppress_parsing () || + ctx.options.generate_serialization ()) { ctx.os << "#include " << endl << endl; } - if (!ctx.options.value () || - ctx.options.value ()) + if (!ctx.options.suppress_parsing () || + ctx.options.generate_serialization ()) { ctx.os << "#include " << endl << endl; } - Boolean element_map (ctx.options.value ()); + Boolean element_map (ctx.options.generate_element_map ()); if (element_map) ctx.os << "#include " << 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 ()) + if (!ctx.options.suppress_parsing ()) { ctx.os << "#include " << endl; @@ -3719,7 +3722,7 @@ namespace CXX ctx.os << endl; } - if (ctx.options.value ()) + if (ctx.options.generate_serialization ()) { ctx.os << "#include " << endl << "#include " << endl; @@ -3741,16 +3744,17 @@ namespace CXX ctx.os << endl; } - if (ctx.options.value ()) + if (ctx.options.generate_ostream ()) { ctx.os << "#include " << endl << endl; } - Streams const& ist (ctx.options.value ()); + 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 " @@ -3764,10 +3768,11 @@ namespace CXX << endl; } - Streams const& est (ctx.options.value ()); + 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 " @@ -3795,7 +3800,7 @@ namespace CXX } else { - Boolean inline_ (ctx.options.value ()); + Boolean inline_ (ctx.options.generate_inline ()); ctx.os << "#include // std::auto_ptr" << endl << "#include // std::numeric_limits" << endl @@ -3815,23 +3820,23 @@ namespace CXX << "#include " << endl << endl; - if (!ctx.options.value ()) + if (!ctx.options.suppress_parsing ()) { ctx.os << "#include " << endl << endl; } - if (ctx.options.value ()) + if (ctx.options.generate_wildcard ()) { - if (ctx.options.value () || - !ctx.options.value ()) + if (ctx.options.suppress_parsing () || + !ctx.options.generate_serialization ()) ctx.os << "#include " << endl; ctx.os << "#include " << endl << endl; } - if (!ctx.options.value ().empty ()) + if (!ctx.options.generate_extraction ().empty ()) ctx.os << "#include " << endl << endl; @@ -3888,7 +3893,7 @@ namespace CXX names >> complex; names >> enumeration; - if (ctx.options.value ()) + if (ctx.options.generate_element_type ()) names >> element; schema.dispatch (ctx.schema_root); -- cgit v1.1