diff options
Diffstat (limited to 'xsde/cxx/hybrid/generator.cxx')
-rw-r--r-- | xsde/cxx/hybrid/generator.cxx | 98 |
1 files changed, 47 insertions, 51 deletions
diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx index c2289ae..eac7cf0 100644 --- a/xsde/cxx/hybrid/generator.cxx +++ b/xsde/cxx/hybrid/generator.cxx @@ -10,9 +10,6 @@ #include <cutl/re.hxx> -#include <cult/containers/set.hxx> -#include <cult/containers/vector.hxx> - #include <cutl/compiler/code-stream.hxx> #include <cutl/compiler/cxx-indenter.hxx> #include <cutl/compiler/sloc-counter.hxx> @@ -75,7 +72,7 @@ namespace CXX { namespace { - Char const copyright_gpl[] = + char const copyright_gpl[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD/e, an XML Schema\n" @@ -96,7 +93,7 @@ namespace CXX "//\n" "//\n\n"; - Char const copyright_proprietary[] = + char const copyright_proprietary[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD/e, an XML Schema to\n" @@ -107,7 +104,7 @@ namespace CXX "//\n\n"; } - Void Hybrid::Generator:: + void Hybrid::Generator:: usage () { CXX::Hybrid::options::print_usage (wcout); @@ -125,12 +122,12 @@ namespace CXX sloc_filter; NarrowString - find_value (NarrowStrings const& v, Char const* key) + find_value (NarrowStrings const& v, char const* key) { for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ()); i != e; ++i) { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -161,15 +158,15 @@ namespace CXX return NarrowString (); } - Void - copy_values (NarrowStrings& dst, NarrowStrings const& src, Char const* key) + void + copy_values (NarrowStrings& dst, NarrowStrings const& src, char const* key) { dst.clear (); for (NarrowStrings::const_iterator i (src.begin ()), e (src.end ()); i != e; ++i) { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -201,7 +198,7 @@ namespace CXX struct FundNamespace: Namespace, Hybrid::Context { - FundNamespace (Hybrid::Context& c, Char type) + FundNamespace (Hybrid::Context& c, char type) : Namespace (c), Hybrid::Context (c), type_ (type) { } @@ -214,7 +211,7 @@ namespace CXX os << "using ::xsde::cxx::hybrid::any_type;" << endl; - Boolean us, ui; + bool us, ui; String skel, impl; if (type_ == 'p') @@ -250,7 +247,7 @@ namespace CXX } private: - Char type_; + char type_; }; } @@ -271,7 +268,7 @@ namespace CXX r->skel_type_suffix (h.pskel_type_suffix ()); r->impl_type_suffix (h.pimpl_type_suffix ()); - Char const* k = "pskel"; + char const* k = "pskel"; r->hxx_regex (find_value (h.hxx_regex (), k)); r->ixx_regex (find_value (h.ixx_regex (), k)); @@ -337,7 +334,7 @@ namespace CXX r->skel_type_suffix (h.sskel_type_suffix ()); r->impl_type_suffix (h.simpl_type_suffix ()); - Char const* k = "pskel"; + char const* k = "pskel"; r->hxx_regex (find_value (h.hxx_regex (), k)); r->ixx_regex (find_value (h.ixx_regex (), k)); @@ -386,7 +383,7 @@ namespace CXX return r; } - Void Hybrid::Generator:: + void Hybrid::Generator:: calculate_size (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file, @@ -400,7 +397,7 @@ namespace CXX throw Failed (); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_tree_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -409,7 +406,7 @@ namespace CXX proc.process (ops, schema, file, false); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_parser_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -419,7 +416,7 @@ namespace CXX throw Failed (); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_serializer_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -432,7 +429,7 @@ namespace CXX namespace { template <typename S> - Void + void open (S& ifs, NarrowString const& path) { try @@ -457,7 +454,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowString const& path, WideInputFileStream& default_is) @@ -477,19 +474,19 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def, - Char const* primary_key, - Char const* def_key) + char const* primary_key, + char const* def_key) { for (NarrowStrings const* v = &primary; v != 0; v = (v == &def ? 0 : &def)) { - Boolean found (false); - Char const* key (v == &primary ? primary_key : def_key); + bool found (false); + char const* key (v == &primary ? primary_key : def_key); for (NarrowStrings::const_iterator i (v->begin ()), e (v->end ()); i != e; ++i) @@ -498,7 +495,7 @@ namespace CXX os << i->c_str () << endl; else { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -535,22 +532,21 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def, - Char const* key) + char const* key) { append (os, primary, def, key, key); } } - - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_tree (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet& disabled_warnings, TypeMap::Namespaces& parser_type_map, TypeMap::Namespaces& serializer_type_map, @@ -562,7 +558,7 @@ namespace CXX try { - Boolean generate_xml_schema (ops.generate_xml_schema ()); + bool 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 @@ -595,9 +591,9 @@ namespace CXX // Generate code. // - Boolean inline_ (ops.generate_inline () && !generate_xml_schema); - Boolean forward (ops.generate_forward () && !generate_xml_schema); - Boolean source (!generate_xml_schema); + bool inline_ (ops.generate_inline () && !generate_xml_schema); + bool forward (ops.generate_forward () && !generate_xml_schema); + bool source (!generate_xml_schema); NarrowString name (file_path.leaf ()); @@ -769,7 +765,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); if (forward) @@ -806,7 +802,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1288,11 +1284,11 @@ namespace CXX } } - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_parser (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet&, FileList& file_list, AutoUnlinks& unlinks) @@ -1303,7 +1299,7 @@ namespace CXX try { { - Boolean gen_xml_schema (ops.generate_xml_schema ()); + bool gen_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -1450,7 +1446,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); hxx << copyright; @@ -1479,7 +1475,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1493,7 +1489,7 @@ namespace CXX if (guard_prefix) guard_prefix += '_'; - Boolean aggr (ops.generate_aggregate ()); + bool aggr (ops.generate_aggregate ()); // HXX // @@ -1674,11 +1670,11 @@ namespace CXX } } - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_serializer (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet&, FileList& file_list, AutoUnlinks& unlinks) @@ -1689,7 +1685,7 @@ namespace CXX try { { - Boolean gen_xml_schema (ops.generate_xml_schema ()); + bool gen_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -1836,7 +1832,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); hxx << copyright; @@ -1865,7 +1861,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1879,7 +1875,7 @@ namespace CXX if (guard_prefix) guard_prefix += '_'; - Boolean aggr (ops.generate_aggregate ()); + bool aggr (ops.generate_aggregate ()); // HXX // |