diff options
Diffstat (limited to 'xsde/cxx/hybrid/serializer-name-processor.cxx')
-rw-r--r-- | xsde/cxx/hybrid/serializer-name-processor.cxx | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/xsde/cxx/hybrid/serializer-name-processor.cxx b/xsde/cxx/hybrid/serializer-name-processor.cxx index 4071ecb..b29b509 100644 --- a/xsde/cxx/hybrid/serializer-name-processor.cxx +++ b/xsde/cxx/hybrid/serializer-name-processor.cxx @@ -3,6 +3,11 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include <set> +#include <map> +#include <sstream> +#include <iostream> + #include <cxx/elements.hxx> #include <cxx/hybrid/elements.hxx> #include <cxx/hybrid/serializer-name-processor.hxx> @@ -10,10 +15,7 @@ #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> -#include <cult/containers/set.hxx> - -#include <sstream> -#include <iostream> +using namespace std; namespace CXX { @@ -21,10 +23,7 @@ namespace CXX { namespace { - // - // - typedef Cult::Containers::Set<String> NameSet; - + typedef set<String> NameSet; struct Failed {}; class Context: public CXX::Context @@ -60,7 +59,7 @@ namespace CXX // Split the string in two parts at the last '='. // - Size pos (s.rfind ('=')); + size_t pos (s.rfind ('=')); // If no delimiter found then both base and include are empty. // @@ -111,7 +110,7 @@ namespace CXX { String name (escape (n + suffix)); - for (UnsignedLong i (1); set.find (name) != set.end (); ++i) + for (size_t i (1); set.find (name) != set.end (); ++i) { std::wostringstream os; os << i; @@ -129,7 +128,7 @@ namespace CXX } public: - Boolean + bool recursive (SemanticGraph::Type& t) { return t.context ().count ("recursive"); @@ -205,25 +204,23 @@ namespace CXX String include; }; - typedef - Cult::Containers::Map<String, CustomSerializer> - CustomSerializerMap; + typedef map<String, CustomSerializer> CustomSerializerMap; private: String const impl_suffix_; String const aggr_suffix_; CustomSerializerMap custom_serializer_map_; - Cult::Containers::Map<String, NameSet*> global_type_names_; + map<String, NameSet*> global_type_names_; public: options_type const& options; - Boolean aggregate; + bool aggregate; String const& impl_suffix; String const& aggr_suffix; CustomSerializerMap const& custom_serializer_map; - Cult::Containers::Map<String, NameSet*>& global_type_names; + map<String, NameSet*>& global_type_names; }; // @@ -235,7 +232,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -283,7 +280,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { SemanticGraph::Context& lc (l.context ()); @@ -319,7 +316,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Context& uc (u.context ()); @@ -350,7 +347,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { if (c.max () != 1) @@ -375,7 +372,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -400,7 +397,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -416,7 +413,7 @@ namespace CXX // // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) restriction = c.inherits ().is_a<SemanticGraph::Restricts> () && @@ -479,7 +476,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -489,8 +486,8 @@ namespace CXX // See if this serializer is being customized. // - Boolean custom (false); - CustomSerializerMap::ConstIterator i ( + bool custom (false); + CustomSerializerMap::const_iterator i ( custom_serializer_map.find (name)); if (i != custom_serializer_map.end ()) @@ -558,10 +555,10 @@ namespace CXX process (*last_); } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { - Boolean p (false); + bool p (false); if (last_ == 0 && options.root_element_first ()) p = true; @@ -602,7 +599,7 @@ namespace CXX } private: - Void + void process (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -625,7 +622,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { SemanticGraph::Context& nsc (ns.context ()); @@ -676,7 +673,7 @@ namespace CXX Traversal::Includes, Traversal::Imports { - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -688,7 +685,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -700,7 +697,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -712,16 +709,16 @@ namespace CXX } } - static Char const* seen_key; + static char const* seen_key; }; - Char const* Uses::seen_key = "cxx-hybrid-serializer-name-processor-seen"; + char const* Uses::seen_key = "cxx-hybrid-serializer-name-processor-seen"; - Void + void process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { Context ctx (ops, tu, file); @@ -783,11 +780,11 @@ namespace CXX } } - Boolean SerializerNameProcessor:: + bool SerializerNameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { try { |