From 54110801525371740298d5cae378bfc778749935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 11:50:03 +0200 Subject: Get rid of dependency on libcult --- xsd/cxx/tree/validator.cxx | 75 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'xsd/cxx/tree/validator.cxx') diff --git a/xsd/cxx/tree/validator.cxx b/xsd/cxx/tree/validator.cxx index 00dfe29..32aaeb0 100644 --- a/xsd/cxx/tree/validator.cxx +++ b/xsd/cxx/tree/validator.cxx @@ -3,18 +3,17 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include +#include +#include -#include +#include #include #include #include -#include - -using std::wcerr; +using namespace std; namespace CXX { @@ -30,8 +29,8 @@ namespace CXX Tree::options const& ops, const WarningSet& disabled_warnings, Counts const& counts, - Boolean generate_xml_schema, - Boolean& valid_) + bool generate_xml_schema, + bool& valid_) : Context (std::wcerr, root, path, @@ -53,8 +52,8 @@ namespace CXX } public: - Boolean - is_disabled (Char const* w) + bool + is_disabled (char const* w) { return disabled_warnings_all_ || disabled_warnings_.find (w) != disabled_warnings_.end (); @@ -95,12 +94,12 @@ namespace CXX protected: const WarningSet& disabled_warnings_; - Boolean disabled_warnings_all_; + bool disabled_warnings_all_; - Boolean& valid; + bool& valid; - Boolean& subst_group_warning_issued; - Boolean subst_group_warning_issued_; + bool& subst_group_warning_issued; + bool subst_group_warning_issued_; }; @@ -122,7 +121,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -130,13 +129,13 @@ namespace CXX using SemanticGraph::Any; - Boolean q (e.qualified_p ()); + bool q (e.qualified_p ()); String ns (q ? e.namespace_ ().name () : ""); for (Any::NamespaceIterator i (any_.namespace_begin ()); i != any_.namespace_end (); ++i) { - Boolean failed (false); + bool failed (false); if (*i == L"##any") { @@ -205,14 +204,14 @@ namespace CXX { } - virtual Void + virtual void post (Type& c) { // Go down the inheritance hierarchy. // if (down_) { - Boolean up = up_; + bool up = up_; up_ = false; if (c.inherits_p ()) @@ -225,7 +224,7 @@ namespace CXX // if (up_) { - Boolean down = down_; + bool down = down_; down_ = false; for (Type::BegetsIterator i (c.begets_begin ()); @@ -239,10 +238,10 @@ namespace CXX } private: - Boolean up_, down_; + bool up_, down_; }; - virtual Void + virtual void traverse (SemanticGraph::Any& a) { using SemanticGraph::Compositor; @@ -295,7 +294,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { using SemanticGraph::Schema; @@ -341,7 +340,7 @@ namespace CXX Complex::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { // This is also used to traverse Complex. @@ -352,7 +351,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (is_disabled ("T002")) @@ -379,7 +378,7 @@ namespace CXX // Return true if root sources s. // - Boolean + bool sources_p (SemanticGraph::Schema& root, SemanticGraph::Schema& s) { using SemanticGraph::Schema; @@ -399,7 +398,7 @@ namespace CXX } private: - Containers::Set types_; + set types_; Sources sources_; @@ -432,7 +431,7 @@ namespace CXX *this >> names_; } - Boolean + bool traverse_common (SemanticGraph::Member& m) { SemanticGraph::Type& t (m.type ()); @@ -473,7 +472,7 @@ namespace CXX return false; } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) return; @@ -491,7 +490,7 @@ namespace CXX Traversal::Element::traverse (e); } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (traverse_common (a)) @@ -508,9 +507,9 @@ namespace CXX } private: - Boolean anonymous_error_issued_; + bool anonymous_error_issued_; - Containers::Set types_; + set types_; Sources sources_; @@ -527,21 +526,21 @@ namespace CXX // Dummy ctor, helps with long symbols on HP-UX. } - Boolean Validator:: + bool Validator:: validate (options const& ops, SemanticGraph::Schema& schema, SemanticGraph::Path const& path, const WarningSet& disabled_warnings, Counts const& counts) { - Boolean valid (true); + bool valid (true); ValidationContext ctx ( schema, path, ops, disabled_warnings, counts, false, valid); // // - Boolean import_maps (ops.import_maps ()); - Boolean export_maps (ops.export_maps ()); + bool import_maps (ops.import_maps ()); + bool export_maps (ops.export_maps ()); if (import_maps && export_maps) { @@ -601,9 +600,9 @@ namespace CXX // // - Boolean element_type (ops.generate_element_type ()); - Boolean par (!ops.suppress_parsing ()); - Boolean ser (ops.generate_serialization ()); + bool element_type (ops.generate_element_type ()); + bool par (!ops.suppress_parsing ()); + bool ser (ops.generate_serialization ()); if (ops.generate_element_map ()) { -- cgit v1.1