diff options
Diffstat (limited to 'xsd/cxx/tree')
41 files changed, 1174 insertions, 1215 deletions
diff --git a/xsd/cxx/tree/counter.cxx b/xsd/cxx/tree/counter.cxx index 548fc77..40a7c61 100644 --- a/xsd/cxx/tree/counter.cxx +++ b/xsd/cxx/tree/counter.cxx @@ -15,40 +15,40 @@ namespace CXX { struct Member: Traversal::Member { - Member (UnsignedLong& complexity) + Member (size_t& complexity) : complexity_ (complexity) { } - virtual Void + virtual void traverse (Type&) { complexity_++; } - UnsignedLong& complexity_; + size_t& complexity_; }; struct Any: Traversal::Any, Traversal::AnyAttribute { - Any (UnsignedLong& complexity) + Any (size_t& complexity) : complexity_ (complexity) { } - virtual Void + virtual void traverse (SemanticGraph::Any&) { complexity_++; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute&) { complexity_++; } - UnsignedLong& complexity_; + size_t& complexity_; }; struct TypeBase: Traversal::List, @@ -57,27 +57,27 @@ namespace CXX Traversal::Complex, Context { - TypeBase (Context& c, UnsignedLong& complexity) + TypeBase (Context& c, size_t& complexity) : Context (c), complexity_ (complexity) { } - virtual Void + virtual void traverse (SemanticGraph::List&) { complexity_++; } - virtual Void + virtual void traverse (SemanticGraph::Union&) { complexity_++; } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); @@ -86,7 +86,7 @@ namespace CXX complexity_ += (string_based ? 1 : 2); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { complexity_++; // One for the type itself. @@ -106,7 +106,7 @@ namespace CXX } private: - UnsignedLong& complexity_; + size_t& complexity_; }; @@ -120,12 +120,12 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { counts_.global_types++; - UnsignedLong complexity (0); + size_t complexity (0); TypeBase type (*this, complexity); type.dispatch (t); @@ -160,7 +160,7 @@ namespace CXX } } - virtual Void + virtual void traverse (Type& e) { // Check if the previous element we saw needs to be generated. @@ -177,14 +177,14 @@ namespace CXX } private: - Void + void count_last () { if (generate_p (*last_)) { counts_.generated_global_elements++; - UnsignedLong complexity (0); + size_t complexity (0); if (doc_root_p (*last_)) { diff --git a/xsd/cxx/tree/default-value.cxx b/xsd/cxx/tree/default-value.cxx index 6ac5f5c..1ed6a48 100644 --- a/xsd/cxx/tree/default-value.cxx +++ b/xsd/cxx/tree/default-value.cxx @@ -13,14 +13,14 @@ namespace CXX { namespace { - Void + void normalize (String& s) { - Size n (s.size ()); + size_t n (s.size ()); - for (Size i (0); i < n; ++i) + for (size_t i (0); i < n; ++i) { - WideChar& c (s[i]); + wchar_t& c (s[i]); if (c == 0x0D || // carriage return c == 0x09 || // tab @@ -29,15 +29,15 @@ namespace CXX } } - Void + void collapse (String& s) { - Size n (s.size ()), j (0); - Boolean subs (false), trim (true); + size_t n (s.size ()), j (0); + bool subs (false), trim (true); - for (Size i (0); i < n; ++i) + for (size_t i (0); i < n; ++i) { - WideChar c (s[i]); + wchar_t c (s[i]); if (c == 0x20 || c == 0x09 || c == 0x0A) subs = true; @@ -61,21 +61,21 @@ namespace CXX s.resize (j); } - Void + void strip_zeros (String& s) { - Size n (s.size ()), i (0); + size_t n (s.size ()), i (0); if (n > 0 && (s[i] == '-' || s[i] == '+')) i++; - Size j (i); + size_t j (i); - Boolean strip (true); + bool strip (true); for (; i < n; ++i) { - WideChar c (s[i]); + wchar_t c (s[i]); if (c == '0') { @@ -97,7 +97,7 @@ namespace CXX s.resize (j); } - Void + void make_float (String& s) { if (s.find ('.') == String::npos && @@ -112,13 +112,13 @@ namespace CXX // IsLiteralValue:: - IsLiteralValue (Boolean& r) + IsLiteralValue (bool& r) : IsFundamentalType (r) { *this >> inherits_ >> *this; } - Void IsLiteralValue:: + void IsLiteralValue:: traverse (SemanticGraph::Complex& c) { inherits (c); @@ -144,7 +144,7 @@ namespace CXX return literal_; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Complex& c) { inherits (c); @@ -152,7 +152,7 @@ namespace CXX // Boolean. // - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Boolean&) { collapse (value_); @@ -161,7 +161,7 @@ namespace CXX // Integral types. // - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Byte&) { collapse (value_); @@ -169,7 +169,7 @@ namespace CXX literal_ = value_; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::UnsignedByte&) { collapse (value_); @@ -177,7 +177,7 @@ namespace CXX literal_ = value_ + L"U"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Short&) { collapse (value_); @@ -185,7 +185,7 @@ namespace CXX literal_ = value_; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::UnsignedShort&) { collapse (value_); @@ -193,7 +193,7 @@ namespace CXX literal_ = value_ + L"U"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Int&) { collapse (value_); @@ -201,7 +201,7 @@ namespace CXX literal_ = value_; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::UnsignedInt&) { collapse (value_); @@ -209,7 +209,7 @@ namespace CXX literal_ = value_ + L"U"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Long&) { collapse (value_); @@ -218,7 +218,7 @@ namespace CXX literal_ += L"LL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::UnsignedLong&) { collapse (value_); @@ -227,7 +227,7 @@ namespace CXX literal_ += L"ULL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Integer&) { collapse (value_); @@ -235,7 +235,7 @@ namespace CXX literal_ = value_ + L"LL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { collapse (value_); @@ -243,7 +243,7 @@ namespace CXX literal_ = value_ + L"LL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { collapse (value_); @@ -251,7 +251,7 @@ namespace CXX literal_ = value_ + L"ULL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::PositiveInteger&) { collapse (value_); @@ -259,7 +259,7 @@ namespace CXX literal_ = value_ + L"ULL"; } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::NegativeInteger&) { collapse (value_); @@ -269,7 +269,7 @@ namespace CXX // Floats. // - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Float& t) { collapse (value_); @@ -297,7 +297,7 @@ namespace CXX } } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Double& t) { collapse (value_); @@ -325,7 +325,7 @@ namespace CXX } } - Void LiteralValue:: + void LiteralValue:: traverse (SemanticGraph::Fundamental::Decimal&) { collapse (value_); @@ -345,43 +345,43 @@ namespace CXX *this >> inherits_ >> *this; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::List&) { r_ = function; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Complex& c) { inherits (c); } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Fundamental::Base64Binary&) { r_ = data; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Fundamental::HexBinary&) { r_ = data; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Fundamental::NameTokens&) { r_ = function; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Fundamental::IdRefs&) { r_ = function; } - Void InitKind:: + void InitKind:: traverse (SemanticGraph::Fundamental::Entities&) { r_ = function; @@ -397,14 +397,14 @@ namespace CXX { } - Void InitValue:: + void InitValue:: dispatch (SemanticGraph::Node& type, String const& value) { value_ = value; Traversal::NodeBase::dispatch (type); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::List& l) { collapse (value_); @@ -415,9 +415,9 @@ namespace CXX SemanticGraph::Type& t (l.argumented ().type ()); String ov (value_); - Size b (0); + size_t b (0); - for (Size e (ov.find (' ')); ; e = ov.find (' ', b)) + for (size_t e (ov.find (' ')); ; e = ov.find (' ', b)) { String v (ov, b, e != String::npos ? e - b : e); @@ -448,13 +448,13 @@ namespace CXX value_ = ov; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Union&) { os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Complex& c) { Traversal::NodeBase::dispatch (ultimate_base (c)); @@ -462,13 +462,13 @@ namespace CXX // anyType & anySimpleType. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::AnyType& t) { os << fq_name (t) << " (" << strlit (value_) << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::AnySimpleType& t) { os << fq_name (t) << " (" << strlit (value_) << ")"; @@ -476,34 +476,34 @@ namespace CXX // Strings. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::String&) { os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NormalizedString&) { normalize (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Token&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NameToken&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NameTokens&) { string_sequence_type ( @@ -511,21 +511,21 @@ namespace CXX xs_ns ().find ("NMTOKEN").first->named ())); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Name&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NCName&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Language&) { collapse (value_); @@ -534,10 +534,10 @@ namespace CXX // Qualified name. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::QName& t) { - Size p (value_.rfind ('#')); + size_t p (value_.rfind ('#')); if (p != String::npos) { @@ -569,21 +569,21 @@ namespace CXX // ID/IDREF. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Id&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::IdRef&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::IdRefs&) { string_sequence_type ( @@ -593,7 +593,7 @@ namespace CXX // URI. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::AnyURI&) { collapse (value_); @@ -621,7 +621,7 @@ namespace CXX return r; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Base64Binary& t) { collapse (value_); @@ -634,17 +634,17 @@ namespace CXX // Decode. // - Size size (value_.size ()); + size_t size (value_.size ()); // Remove all whitespaces. // { - Size j (0); - Boolean subs (false); + size_t j (0); + bool subs (false); - for (Size i (0); i < size; ++i) + for (size_t i (0); i < size; ++i) { - WideChar c (value_[i]); + wchar_t c (value_[i]); if (c == 0x20 || c == 0x0A || c == 0x0D || c == 0x09) subs = true; @@ -663,20 +663,20 @@ namespace CXX // Our length should be a multiple of four. // - Size quad_count (size / 4); + size_t quad_count (size / 4); // Source and destination indexes. // - Size si (0), di (0); + size_t si (0), di (0); // Process all quads except the last one. // unsigned short v; unsigned char b1, b2, b3, b4; - WideChar prev_fill (os.fill ('0')); + wchar_t prev_fill (os.fill ('0')); - for (Size q (0); q < quad_count - 1; ++q) + for (size_t q (0); q < quad_count - 1; ++q) { b1 = base64_decode (value_[si++]); b2 = base64_decode (value_[si++]); @@ -709,7 +709,7 @@ namespace CXX b1 = base64_decode (value_[si++]); b2 = base64_decode (value_[si++]); - WideChar e3 (value_[si++]), e4 (value_[si++]); + wchar_t e3 (value_[si++]), e4 (value_[si++]); if (quad_count != 1) os << ", "; @@ -803,7 +803,7 @@ namespace CXX return r; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::HexBinary& t) { collapse (value_); @@ -816,10 +816,10 @@ namespace CXX // Decode. // - Size n (value_.size () / 2); - WideChar prev_fill (os.fill ('0')); + size_t n (value_.size () / 2); + wchar_t prev_fill (os.fill ('0')); - for (Size i (0); i < n; ++i) + for (size_t i (0); i < n; ++i) { unsigned char h (hex_decode (value_[2 * i])); unsigned char l (hex_decode (value_[2 * i + 1])); @@ -862,15 +862,15 @@ namespace CXX // Date/time. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Date& t) { // date := [-]CCYY[N]*-MM-DD[Z|(+|-)HH:MM] // collapse (value_); - Size b (0); - Size e (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t b (0); + size_t e (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, e); b = e + 1; @@ -888,15 +888,15 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::DateTime& t) { // date_time := [-]CCYY[N]*-MM-DDTHH:MM:SS[.S+][Z|(+|-)HH:MM] // collapse (value_); - Size b (0); - Size e (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t b (0); + size_t e (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, e); b = e + 1; @@ -915,7 +915,7 @@ namespace CXX e = b + 2; for (; e < value_.size (); ++e) { - WideChar c (value_[e]); + wchar_t c (value_[e]); if (c == 'Z' || c == '+' || c == '-') break; @@ -940,12 +940,12 @@ namespace CXX namespace { - Size - find_delim (String const& s, Size pos) + size_t + find_delim (String const& s, size_t pos) { for (; pos < s.size (); ++pos) { - WideChar c (s[pos]); + wchar_t c (s[pos]); if (c == 'Y' || c == 'D' || c == 'M' || c == 'H' || c == 'M' || c == 'S' || c == 'T') @@ -956,14 +956,14 @@ namespace CXX } } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Duration& t) { // duration := [-]P[nY][nM][nD][TnHnMn[.n+]S] // collapse (value_); - Size b (1), e, n (value_.size ()); + size_t b (1), e, n (value_.size ()); os << fq_name (t) << " ("; @@ -1059,7 +1059,7 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Day& t) { // gday := ---DD[Z|(+|-)HH:MM] @@ -1074,7 +1074,7 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Month& t) { // gmonth := --MM[Z|(+|-)HH:MM] @@ -1089,7 +1089,7 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::MonthDay& t) { // gmonth_day := --MM-DD[Z|(+|-)HH:MM] @@ -1107,17 +1107,17 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Year& t) { // gyear := [-]CCYY[N]*[Z|(+|-)HH:MM] // collapse (value_); - Size pos (value_[0] == '-' ? 5 : 4); + size_t pos (value_[0] == '-' ? 5 : 4); for (; pos < value_.size (); ++pos) { - WideChar c (value_[pos]); + wchar_t c (value_[pos]); if (c == 'Z' || c == '+' || c == '-') break; @@ -1131,14 +1131,14 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::YearMonth& t) { // gyear_month := [-]CCYY[N]*-MM[Z|(+|-)HH:MM] // collapse (value_); - Size pos (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t pos (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, pos); String month (value_, pos + 1, 2); @@ -1151,7 +1151,7 @@ namespace CXX os << ")"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Time& t) { // time := HH:MM:SS[.S+][Z|(+|-)HH:MM] @@ -1161,10 +1161,10 @@ namespace CXX String hours (value_, 0, 2); String minutes (value_, 3, 2); - Size e (8); + size_t e (8); for (; e < value_.size (); ++e) { - WideChar c (value_[e]); + wchar_t c (value_[e]); if (c == 'Z' || c == '+' || c == '-') break; @@ -1182,8 +1182,8 @@ namespace CXX os << ")"; } - Void InitValue:: - time_zone (Size pos) + void InitValue:: + time_zone (size_t pos) { // time_zone := Z|(+|-)HH:MM // @@ -1217,14 +1217,14 @@ namespace CXX // Entity. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Entity&) { collapse (value_); os << strlit (value_); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Entities&) { string_sequence_type ( @@ -1232,7 +1232,7 @@ namespace CXX xs_ns ().find ("ENTITY").first->named ())); } - Void InitValue:: + void InitValue:: string_sequence_type (SemanticGraph::Type& t) { collapse (value_); @@ -1240,9 +1240,9 @@ namespace CXX if (!value_) return; - Size b (0); + size_t b (0); - for (Size e (value_.find (' ')); ; e = value_.find (' ', b)) + for (size_t e (value_.find (' ')); ; e = value_.find (' ', b)) { String v (value_, b, e != String::npos ? e - b : e); diff --git a/xsd/cxx/tree/default-value.hxx b/xsd/cxx/tree/default-value.hxx index cd3d0f2..f8451c2 100644 --- a/xsd/cxx/tree/default-value.hxx +++ b/xsd/cxx/tree/default-value.hxx @@ -17,9 +17,9 @@ namespace CXX { struct IsLiteralValue: IsFundamentalType, Traversal::Complex { - IsLiteralValue (Boolean& r); + IsLiteralValue (bool& r); - virtual Void + virtual void traverse (SemanticGraph::Complex&); private: @@ -57,64 +57,64 @@ namespace CXX // Handle inheritance. // - virtual Void + virtual void traverse (SemanticGraph::Complex&); // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&); // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&); // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&); private: @@ -148,25 +148,25 @@ namespace CXX // InitKind (Kind& r); - virtual Void + virtual void traverse (SemanticGraph::List&); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&); private: @@ -218,136 +218,136 @@ namespace CXX { InitValue (Context&); - Void + void data (String const& data) { data_ = data; dispatch_count_ = 0; } - Void + void dispatch (SemanticGraph::Node& type, String const& value); - virtual Void + virtual void traverse (SemanticGraph::List&); - virtual Void + virtual void traverse (SemanticGraph::Union&); - virtual Void + virtual void traverse (SemanticGraph::Complex&); // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType&); - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&); // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&); // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName&); // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&); // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&); // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&); // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time&); // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&); private: - Void + void string_sequence_type (SemanticGraph::Type& element_type); - Void - time_zone (Size pos); + void + time_zone (size_t pos); private: String value_; String data_; - Size dispatch_count_; + size_t dispatch_count_; MemberTypeName type_name_; LiteralValue literal_value_; }; diff --git a/xsd/cxx/tree/elements.cxx b/xsd/cxx/tree/elements.cxx index a608672..f96c24c 100644 --- a/xsd/cxx/tree/elements.cxx +++ b/xsd/cxx/tree/elements.cxx @@ -11,14 +11,14 @@ namespace CXX { // Context // - Void Context:: + void Context:: update_ns_scope () // Keeping this function first helps HP-UX { // (long symbols). ns_scope.clear (); - Boolean first (true); + bool first (true); - for (NamespaceStack::Iterator i (ns_scope_stack.begin ()); + for (NamespaceStack::iterator i (ns_scope_stack.begin ()); i != ns_scope_stack.end (); ++i) { @@ -39,7 +39,7 @@ namespace CXX SemanticGraph::Path const& path, options_type const& ops, Counts const& counts_, - Boolean generate_xml_schema__, + bool generate_xml_schema__, StringLiteralMap const* map, Regex const* fe, Regex const* he, @@ -178,7 +178,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 type and base are empty. // @@ -231,11 +231,11 @@ namespace CXX if (s.empty ()) throw InvalidCustomTypeMapping (s, "mapping string is empty"); - WideChar delimiter (s[0]); + wchar_t delimiter (s[0]); // First get pattern. // - Size pos (s.find (delimiter, 1)); + size_t pos (s.find (delimiter, 1)); if (pos == String::npos) throw InvalidCustomTypeMapping ( @@ -363,7 +363,7 @@ namespace CXX { } - Boolean Context:: + bool Context:: custom_type (SemanticGraph::Type const& t, String& r) const { String const& name (t.name ()); @@ -371,7 +371,7 @@ namespace CXX // First search the direct mapping. // { - DirectCustomTypeMap::ConstIterator i ( + DirectCustomTypeMap::const_iterator i ( direct_custom_type_map.find (name)); if (i != direct_custom_type_map.end ()) @@ -384,7 +384,7 @@ namespace CXX // Second search the regex mapping. // - for (RegexCustomTypeMap::ConstIterator + for (RegexCustomTypeMap::const_iterator i (regex_custom_type_map.begin ()), e (regex_custom_type_map.end ()); i != e; ++i) @@ -422,7 +422,7 @@ namespace CXX return r; } - Boolean Context:: + bool Context:: renamed_type (SemanticGraph::Type const& t, String& r) const { String const& name (t.name ()); @@ -430,7 +430,7 @@ namespace CXX // First search the direct mapping. // { - DirectCustomTypeMap::ConstIterator i ( + DirectCustomTypeMap::const_iterator i ( direct_custom_type_map.find (name)); if (i != direct_custom_type_map.end ()) @@ -443,7 +443,7 @@ namespace CXX // Second search the regex mapping. // - for (RegexCustomTypeMap::ConstIterator + for (RegexCustomTypeMap::const_iterator i (regex_custom_type_map.begin ()), e (regex_custom_type_map.end ()); i != e; ++i) @@ -464,17 +464,17 @@ namespace CXX return false; } - Void Context:: + void Context:: write_annotation (SemanticGraph::Annotation& a) { String const& doc (a.documentation ()); - WideChar const* s (doc.c_str ()); - Size size (doc.size ()); + wchar_t const* s (doc.c_str ()); + size_t size (doc.size ()); // Remove leading and trailing whitespaces. // - while (*s == WideChar (0x20) || *s == WideChar (0x0A) || - *s == WideChar (0x0D) || *s == WideChar (0x09)) + while (*s == wchar_t (0x20) || *s == wchar_t (0x0A) || + *s == wchar_t (0x0D) || *s == wchar_t (0x09)) { s++; size--; @@ -482,11 +482,11 @@ namespace CXX if (size != 0) { - WideChar const* e (s + size - 1); + wchar_t const* e (s + size - 1); while (e > s && - (*e == WideChar (0x20) || *e == WideChar (0x0A) || - *e == WideChar (0x0D) || *e == WideChar (0x09))) + (*e == wchar_t (0x20) || *e == wchar_t (0x0A) || + *e == wchar_t (0x0D) || *e == wchar_t (0x09))) --e; size = s <= e ? e - s + 1 : 0; @@ -499,15 +499,15 @@ namespace CXX // Go over the data, forcing newline after 80 chars and adding // ' * ' after each new line. // - WideChar const* last_space (0); - WideChar const* b (s); - WideChar const* e (s); - Boolean after_newline (false); - Boolean rogue (false); + wchar_t const* last_space (0); + wchar_t const* b (s); + wchar_t const* e (s); + bool after_newline (false); + bool rogue (false); for (; e < s + size; ++e) { - UnsignedLong u (unicode_char (e)); // May advance e. + unsigned int u (unicode_char (e)); // May advance e. // We are going to treat \v and \f as rogue here even though // they can be present in C++ source code. @@ -564,16 +564,16 @@ namespace CXX } } - Void Context:: - write_rogue_text (WideChar const* s, Size size, Boolean rogue) + void Context:: + write_rogue_text (wchar_t const* s, size_t size, bool rogue) { if (!rogue) os.write (s, size); else { - for (WideChar const* p (s); p < s + size; ++p) + for (wchar_t const* p (s); p < s + size; ++p) { - UnsignedLong u (unicode_char (p)); // May advance p. + unsigned int u (unicode_char (p)); // May advance p. // We are going to treat \v and \f as rogue here even though // they can be present in C++ source code. @@ -581,12 +581,12 @@ namespace CXX if (u > 127 || (u < 32 && u != '\t' && u != '\n')) os.put ('?'); else - os.put (static_cast<WideChar> (u)); + os.put (static_cast<wchar_t> (u)); } } } - Boolean Context:: + bool Context:: polymorphic_p (SemanticGraph::Type& t) { // IDREF templates cannot be polymorphic. @@ -598,16 +598,16 @@ namespace CXX if (polymorphic_all) { - Boolean fund (false); + bool fund (false); IsFundamentalType test (fund); test.dispatch (t); return !fund; } else - return t.context ().get<Boolean> ("polymorphic"); + return t.context ().get<bool> ("polymorphic"); } - Boolean Context:: + bool Context:: anonymous_substitutes_p (SemanticGraph::Type& t) { // IDREF templates cannot match. @@ -636,14 +636,14 @@ namespace CXX // GenerateDefautCtor // GenerateDefaultCtor:: - GenerateDefaultCtor (Context& c, Boolean& generate, Boolean no_base) + GenerateDefaultCtor (Context& c, bool& generate, bool no_base) : Context (c), generate_ (generate), no_base_ (no_base) { *this >> inherits_ >> *this; *this >> names_ >> *this; } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Complex& c) { // Make sure we figure out if we have any required members before @@ -655,35 +655,35 @@ namespace CXX Complex::inherits (c, inherits_); } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Type&) { if (!no_base_) generate_ = true; } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Enumeration&) { if (!no_base_) generate_ = true; } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Element& e) { if (!skip (e) && min (e) == 1 && max (e) == 1) generate_ = true; } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Attribute& a) { if (min (a) == 1 && !a.fixed_p ()) generate_ = true; } - Void GenerateDefaultCtor:: + void GenerateDefaultCtor:: traverse (SemanticGraph::Any& a) { if (options.generate_wildcard () && @@ -695,7 +695,7 @@ namespace CXX // GenerateFromBaseCtor // GenerateFromBaseCtor:: - GenerateFromBaseCtor (Context& c, Boolean& generate) + GenerateFromBaseCtor (Context& c, bool& generate) : generate_ (generate), custom_ (false), traverser_ (c, generate, custom_) @@ -703,7 +703,7 @@ namespace CXX inherits_ >> traverser_; } - Void GenerateFromBaseCtor:: + void GenerateFromBaseCtor:: traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -721,14 +721,14 @@ namespace CXX } GenerateFromBaseCtor::Traverser:: - Traverser (Context& c, Boolean& generate, Boolean& custom) + Traverser (Context& c, bool& generate, bool& custom) : Context (c), generate_ (generate), custom_ (custom) { *this >> inherits_ >> *this; *this >> names_ >> *this; } - Void GenerateFromBaseCtor::Traverser:: + void GenerateFromBaseCtor::Traverser:: traverse (SemanticGraph::Type& t) { if (!custom_) @@ -738,7 +738,7 @@ namespace CXX } } - Void GenerateFromBaseCtor::Traverser:: + void GenerateFromBaseCtor::Traverser:: traverse (SemanticGraph::Complex& c) { names (c, names_); @@ -750,21 +750,21 @@ namespace CXX traverse (static_cast<SemanticGraph::Type&> (c)); } - Void GenerateFromBaseCtor::Traverser:: + void GenerateFromBaseCtor::Traverser:: traverse (SemanticGraph::Element& e) { if (!skip (e) && min (e) == 1 && max (e) == 1) generate_ = true; } - Void GenerateFromBaseCtor::Traverser:: + void GenerateFromBaseCtor::Traverser:: traverse (SemanticGraph::Attribute& a) { if (min (a) == 1 && !a.fixed_p ()) generate_ = true; } - Void GenerateFromBaseCtor::Traverser:: + void GenerateFromBaseCtor::Traverser:: traverse (SemanticGraph::Any& a) { if (options.generate_wildcard () && @@ -776,10 +776,10 @@ namespace CXX // HasComplexPolyNonOptArgs:: HasComplexPolyNonOptArgs (Context& c, - Boolean base, - Boolean& complex, - Boolean& poly, - Boolean& clash) + bool base, + bool& complex, + bool& poly, + bool& clash) : Context (c), complex_ (complex), poly_ (poly), @@ -791,7 +791,7 @@ namespace CXX *this >> names_ >> *this; } - Void HasComplexPolyNonOptArgs:: + void HasComplexPolyNonOptArgs:: traverse (SemanticGraph::Complex& c) { // No optimizations: need to check every arg for clashes. @@ -800,14 +800,14 @@ namespace CXX names (c, names_); } - Void HasComplexPolyNonOptArgs:: + void HasComplexPolyNonOptArgs:: traverse (SemanticGraph::Element& e) { if (!skip (e) && min (e) == 1 && max (e) == 1) { - Boolean poly (polymorphic && polymorphic_p (e.type ())); + bool poly (polymorphic && polymorphic_p (e.type ())); - Boolean simple (true); + bool simple (true); IsSimpleType t (simple); t.dispatch (e.type ()); @@ -825,12 +825,12 @@ namespace CXX // FromBaseCtorArg // FromBaseCtorArg:: - FromBaseCtorArg (Context& c, ArgType at, Boolean arg) + FromBaseCtorArg (Context& c, ArgType at, bool arg) : Context (c), arg_type_ (at), arg_ (arg) { } - Void FromBaseCtorArg:: + void FromBaseCtorArg:: traverse (SemanticGraph::Any& a) { if (!options.generate_wildcard ()) @@ -848,7 +848,7 @@ namespace CXX } } - Void FromBaseCtorArg:: + void FromBaseCtorArg:: traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -860,13 +860,13 @@ namespace CXX os << "," << endl; - Boolean auto_ptr (false); + bool auto_ptr (false); switch (arg_type_) { case arg_complex_auto_ptr: { - Boolean simple (true); + bool simple (true); IsSimpleType t (simple); t.dispatch (e.type ()); auto_ptr = !simple; @@ -891,7 +891,7 @@ namespace CXX } } - Void FromBaseCtorArg:: + void FromBaseCtorArg:: traverse (SemanticGraph::Attribute& a) { // Note that we are not going to include attributes with @@ -936,7 +936,7 @@ namespace CXX *this >> names_ >> *this; } - Void CtorArgs:: + void CtorArgs:: traverse (SemanticGraph::Type& t) { os << comma () << "const "; @@ -957,7 +957,7 @@ namespace CXX } } - Void CtorArgs:: + void CtorArgs:: traverse (SemanticGraph::Enumeration& e) { os << comma () << "const "; @@ -974,7 +974,7 @@ namespace CXX } } - Void CtorArgs:: + void CtorArgs:: traverse (SemanticGraph::Any& a) { if (!options.generate_wildcard ()) @@ -989,7 +989,7 @@ namespace CXX } } - Void CtorArgs:: + void CtorArgs:: traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -997,13 +997,13 @@ namespace CXX if (min (e) == 1 && max (e) == 1) { - Boolean auto_ptr (false); + bool auto_ptr (false); switch (arg_type_) { case arg_complex_auto_ptr: { - Boolean simple (true); + bool simple (true); IsSimpleType t (simple); t.dispatch (e.type ()); auto_ptr = !simple; @@ -1028,7 +1028,7 @@ namespace CXX } } - Void CtorArgs:: + void CtorArgs:: traverse (SemanticGraph::Attribute& a) { // Note that we are not going to include attributes with @@ -1047,7 +1047,7 @@ namespace CXX String CtorArgs:: comma () { - Boolean tmp (first_); + bool tmp (first_); first_ = false; return tmp ? "" : ",\n"; } @@ -1056,14 +1056,14 @@ namespace CXX // CtorArgsWithoutBase // CtorArgsWithoutBase:: - CtorArgsWithoutBase (Context& c, ArgType at, Boolean arg, Boolean first) + CtorArgsWithoutBase (Context& c, ArgType at, bool arg, bool first) : Context (c), arg_type_ (at), arg_ (arg), first_ (first) { *this >> inherits_ >> *this; *this >> names_ >> *this; } - Void CtorArgsWithoutBase:: + void CtorArgsWithoutBase:: traverse (SemanticGraph::Any& a) { if (!options.generate_wildcard ()) @@ -1078,7 +1078,7 @@ namespace CXX } } - Void CtorArgsWithoutBase:: + void CtorArgsWithoutBase:: traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -1086,13 +1086,13 @@ namespace CXX if (min (e) == 1 && max (e) == 1) { - Boolean auto_ptr (false); + bool auto_ptr (false); switch (arg_type_) { case arg_complex_auto_ptr: { - Boolean simple (true); + bool simple (true); IsSimpleType t (simple); t.dispatch (e.type ()); auto_ptr = !simple; @@ -1117,7 +1117,7 @@ namespace CXX } } - Void CtorArgsWithoutBase:: + void CtorArgsWithoutBase:: traverse (SemanticGraph::Attribute& a) { // Note that we are not going to include attributes with @@ -1136,14 +1136,14 @@ namespace CXX String CtorArgsWithoutBase:: comma () { - Boolean tmp (first_); + bool tmp (first_); first_ = false; return tmp ? "" : ",\n"; } // GlobalElementBase // - Boolean GlobalElementBase:: + bool GlobalElementBase:: generate_p (SemanticGraph::Element& e) { if (e.substitutes_p () && ctx_.polymorphic) @@ -1163,7 +1163,7 @@ namespace CXX return true; } - Boolean GlobalElementBase:: + bool GlobalElementBase:: doc_root_p (SemanticGraph::Element& e) { if (!ctx_.options.root_element_first () && @@ -1207,8 +1207,8 @@ namespace CXX // Namespace:: Namespace (Context& c, - UnsignedLong first, - UnsignedLong last) + size_t first, + size_t last) : CXX::Namespace (c, *this), GlobalElementBase (c), ctx_ (c), @@ -1218,7 +1218,7 @@ namespace CXX { } - Void Namespace:: + void Namespace:: traverse (Type& ns) { using SemanticGraph::Element; @@ -1227,7 +1227,7 @@ namespace CXX CXX::Namespace::traverse (ns); else { - Boolean opened (false); + bool opened (false); for (Type::NamesIterator i (ns.names_begin ()); i != ns.names_end (); ++i) @@ -1257,13 +1257,13 @@ namespace CXX } } - Void Namespace:: - enter (Type&, String const& name, Boolean) + void Namespace:: + enter (Type&, String const& name, bool) { ctx_.enter_ns_scope (name); } - Void Namespace:: + void Namespace:: leave () { ctx_.leave_ns_scope (); @@ -1271,7 +1271,7 @@ namespace CXX // Includes // - Void TypeForward:: + void TypeForward:: traverse (SemanticGraph::Type& t) { String const& name (ename (t)); @@ -1293,14 +1293,14 @@ namespace CXX os << "class " << name << ";"; } - Void Includes:: + void Includes:: traverse_ (SemanticGraph::Uses& u) { // Support for weak (forward) inclusion used in the file-per-type // compilation model. // Type t (type_); - Boolean weak (u.context ().count ("weak")); + bool weak (u.context ().count ("weak")); SemanticGraph::Schema& s (u.schema ()); if (weak && t == header) diff --git a/xsd/cxx/tree/elements.hxx b/xsd/cxx/tree/elements.hxx index da9a182..d02bfe7 100644 --- a/xsd/cxx/tree/elements.hxx +++ b/xsd/cxx/tree/elements.hxx @@ -6,14 +6,13 @@ #ifndef CXX_TREE_ELEMENTS_HXX #define CXX_TREE_ELEMENTS_HXX +#include <map> +#include <deque> +#include <vector> #include <sstream> #include <cutl/re.hxx> -#include <cult/containers/map.hxx> -#include <cult/containers/deque.hxx> -#include <cult/containers/vector.hxx> - #include <types.hxx> #include <cxx/elements.hxx> @@ -34,15 +33,15 @@ namespace CXX { } - UnsignedLong global_types; - UnsignedLong global_elements; - UnsignedLong generated_global_elements; + size_t global_types; + size_t global_elements; + size_t generated_global_elements; // Complexity value for each global type and generated global // element, in order. // - Cult::Containers::Vector<UnsignedLong> complexity; - UnsignedLong complexity_total; + std::vector<size_t> complexity; + size_t complexity_total; }; struct InvalidCustomTypeMapping @@ -106,13 +105,8 @@ namespace CXX String base_sub; }; - typedef - Cult::Containers::Vector<RegexCustomTypeMapInfo> - RegexCustomTypeMap; - - typedef - Cult::Containers::Map<String, DirectCustomTypeMapInfo> - DirectCustomTypeMap; + typedef std::vector<RegexCustomTypeMapInfo> RegexCustomTypeMap; + typedef std::map<String, DirectCustomTypeMapInfo> DirectCustomTypeMap; public: Context (std::wostream& o, @@ -120,7 +114,7 @@ namespace CXX SemanticGraph::Path const& path, options_type const& ops, Counts const& counts_, - Boolean generate_xml_schema, + bool generate_xml_schema, StringLiteralMap const*, Regex const* fwd_expr, Regex const* hxx_expr, @@ -142,7 +136,7 @@ namespace CXX // populated with the custom type name or empty if the // original name should be used. // - Boolean + bool custom_type (SemanticGraph::Type const&, String& name) const; // Returns true if this type has been renamed as part of the @@ -150,7 +144,7 @@ namespace CXX // name string is populated with the new name or empty if // the type should not be generated at all. // - Boolean + bool renamed_type (SemanticGraph::Type const&, String& name) const; public: @@ -158,16 +152,16 @@ namespace CXX // line after 80 characters as well as "commentizing" the text by // adding '* ' after each newline. // - Void + void write_annotation (SemanticGraph::Annotation&); // // public: - Boolean + bool polymorphic_p (SemanticGraph::Type&); - Boolean + bool anonymous_p (SemanticGraph::Type const& t) { return t.context ().count ("anonymous"); @@ -176,7 +170,7 @@ namespace CXX // Return true if this anonymous type is defined in an element // that belongs to a substitution group. // - Boolean + bool anonymous_substitutes_p (SemanticGraph::Type&); // Escaped names. @@ -338,7 +332,7 @@ namespace CXX // dom_document // - static Boolean + static bool edom_document_p (SemanticGraph::Complex const& c) { return c.context ().count ("dom-document"); @@ -350,7 +344,7 @@ namespace CXX return c.context ().get<String> ("dom-document"); } - static Boolean + static bool edom_document_member_p (SemanticGraph::Complex const& c) { return c.context ().count ("dom-document-member"); @@ -377,14 +371,14 @@ namespace CXX } public: - Void + void enter_ns_scope (String const& name) { ns_scope_stack.push_back (name); update_ns_scope (); } - Void + void leave_ns_scope () { ns_scope_stack.pop_back (); @@ -392,15 +386,15 @@ namespace CXX } private: - Void + void update_ns_scope (); private: // Write text that may contain characters that we will have // to escape (indicated by the rogue flag). // - Void - write_rogue_text (WideChar const* s, Size size, Boolean rogue); + void + write_rogue_text (wchar_t const* s, size_t size, bool rogue); public: options_type const& options; @@ -426,11 +420,11 @@ namespace CXX String& as_double_type; String& as_decimal_type; - Boolean& generate_xml_schema; - Boolean& doxygen; - Boolean polymorphic; - Boolean polymorphic_all; - Boolean detach; + bool& generate_xml_schema; + bool& doxygen; + bool polymorphic; + bool polymorphic_all; + bool detach; Regex const* fwd_expr; Regex const* hxx_expr; @@ -463,16 +457,11 @@ namespace CXX String as_double_type_; String as_decimal_type_; - Boolean generate_xml_schema_; - Boolean doxygen_; - - typedef - Cult::Containers::Deque<String> - NamespaceStack; + bool generate_xml_schema_; + bool doxygen_; - typedef - Cult::Containers::Deque<String> - ScopeStack; + typedef std::deque<String> NamespaceStack; + typedef std::deque<String> ScopeStack; String ns_scope_; @@ -510,86 +499,86 @@ namespace CXX Traversal::Fundamental::Decimal { - IsFundamentalType (Boolean& r) + IsFundamentalType (bool& r) : r_ (r) { } // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&) { r_ = true; @@ -597,7 +586,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&) { r_ = true; @@ -605,26 +594,26 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&) { r_ = true; } private: - Boolean& r_; + bool& r_; }; // Check whether this is a string-based type. @@ -639,19 +628,19 @@ namespace CXX Traversal::Fundamental::NCName, Traversal::Fundamental::Language { - IsStringBasedType (Boolean& r) + IsStringBasedType (bool& r) : r_ (r) { *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); } - virtual Void + virtual void traverse (SemanticGraph::Union&) { // Current mapping of union is string-based. @@ -661,50 +650,50 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { r_ = true; } private: - Boolean& r_; + bool& r_; Traversal::Inherits inherits_; }; @@ -722,7 +711,7 @@ namespace CXX inherits_ >> enum_; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -736,7 +725,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (e_ == 0) @@ -829,25 +818,25 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type&) { abort (); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { os << fq_name (l); } - virtual Void + virtual void traverse (SemanticGraph::Union& u) { os << fq_name (u); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { os << fq_name (c); @@ -855,13 +844,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { os << fq_name (t); @@ -869,79 +858,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { os << fq_name (t); @@ -949,7 +938,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { os << fq_name (t); @@ -957,19 +946,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { os << fq_name (t); @@ -977,49 +966,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { os << fq_name (t); @@ -1028,7 +1017,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { os << fq_name (t); @@ -1037,13 +1026,13 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { if (t.named_p ()) @@ -1063,7 +1052,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { if (t.named_p ()) @@ -1086,7 +1075,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { os << fq_name (t); @@ -1094,13 +1083,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { os << fq_name (t); @@ -1109,55 +1098,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { os << fq_name (t); @@ -1165,13 +1154,13 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { os << fq_name (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { os << fq_name (t); @@ -1209,7 +1198,7 @@ namespace CXX { } - virtual Void + virtual void fundamental_base (SemanticGraph::Type& t) { os << "::xsd::cxx::tree::fundamental_base< " << @@ -1219,79 +1208,79 @@ namespace CXX // Integrals. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { fundamental_base (t); @@ -1299,7 +1288,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { fundamental_base (t); @@ -1307,13 +1296,13 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { fundamental_base (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { os << "::xsd::cxx::tree::fundamental_base< " << @@ -1322,7 +1311,7 @@ namespace CXX "::xsd::cxx::tree::schema_type::double_ >"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { os << "::xsd::cxx::tree::fundamental_base< " << @@ -1339,14 +1328,14 @@ namespace CXX Traversal::Any, Traversal::AnyAttribute { - IsSimpleType (Boolean& v) + IsSimpleType (bool& v) : v_ (v) { *this >> names_ >> *this; *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { names (c, names_); @@ -1355,26 +1344,26 @@ namespace CXX inherits (c, inherits_); } - virtual Void + virtual void traverse (SemanticGraph::Member&) { v_ = false; } - virtual Void + virtual void traverse (SemanticGraph::Any&) { v_ = false; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute&) { v_ = false; } private: - Boolean& v_; + bool& v_; Traversal::Names names_; Traversal::Inherits inherits_; }; @@ -1392,29 +1381,29 @@ namespace CXX { // generate should initially be false. // - GenerateDefaultCtor (Context&, Boolean& generate, Boolean no_base); + GenerateDefaultCtor (Context&, bool& generate, bool no_base); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Type&); - virtual Void + virtual void traverse (SemanticGraph::Enumeration&); - virtual Void + virtual void traverse (SemanticGraph::Element&); - virtual Void + virtual void traverse (SemanticGraph::Attribute&); - virtual Void + virtual void traverse (SemanticGraph::Any&); private: - Boolean& generate_; - Boolean no_base_; + bool& generate_; + bool no_base_; private: Traversal::Inherits inherits_; @@ -1427,14 +1416,14 @@ namespace CXX { // generate should initially be false. // - GenerateFromBaseCtor (Context& c, Boolean& generate); + GenerateFromBaseCtor (Context& c, bool& generate); - virtual Void + virtual void traverse (SemanticGraph::Complex& c); private: - Boolean& generate_; - Boolean custom_; + bool& generate_; + bool custom_; // Note that we are not interested in anyAttribute since it is always // mapped to a sequence. @@ -1446,26 +1435,26 @@ namespace CXX Traversal::Any, Context { - Traverser (Context& c, Boolean& generate, Boolean& custom); + Traverser (Context& c, bool& generate, bool& custom); - virtual Void + virtual void traverse (SemanticGraph::Type&); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Attribute&); - virtual Void + virtual void traverse (SemanticGraph::Element&); - virtual Void + virtual void traverse (SemanticGraph::Any&); private: - Boolean& generate_; - Boolean& custom_; + bool& generate_; + bool& custom_; private: Traversal::Inherits inherits_; @@ -1486,21 +1475,21 @@ namespace CXX // should initially be true. // HasComplexPolyNonOptArgs (Context& c, - Boolean including_base, - Boolean& complex, - Boolean& poly, - Boolean& clash); + bool including_base, + bool& complex, + bool& poly, + bool& clash); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Element&); private: - Boolean& complex_; - Boolean& poly_; - Boolean& clash_; + bool& complex_; + bool& poly_; + bool& clash_; Traversal::Inherits inherits_; Traversal::Names names_; @@ -1521,20 +1510,20 @@ namespace CXX arg_poly_auto_ptr }; - FromBaseCtorArg (Context& c, ArgType, Boolean arg); + FromBaseCtorArg (Context& c, ArgType, bool arg); - virtual Void + virtual void traverse (SemanticGraph::Any&); - virtual Void + virtual void traverse (SemanticGraph::Attribute&); - virtual Void + virtual void traverse (SemanticGraph::Element&); private: ArgType arg_type_; - Boolean arg_; + bool arg_; }; // List of all non-optional members and a simple base. Note that @@ -1561,19 +1550,19 @@ namespace CXX CtorArgs (Context&, ArgType); CtorArgs (Context&, ArgType, String& base_arg); - virtual Void + virtual void traverse (SemanticGraph::Type&); - virtual Void + virtual void traverse (SemanticGraph::Enumeration&); - virtual Void + virtual void traverse (SemanticGraph::Any&); - virtual Void + virtual void traverse (SemanticGraph::Attribute&); - virtual Void + virtual void traverse (SemanticGraph::Element&); private: @@ -1584,7 +1573,7 @@ namespace CXX ArgType arg_type_; String base_; String* base_arg_; - Boolean first_; + bool first_; private: Traversal::Inherits inherits_; @@ -1616,92 +1605,92 @@ namespace CXX { // generate should initially be false. // - GenerateWithoutBaseCtor (Boolean& generate) + GenerateWithoutBaseCtor (bool& generate) : generate_ (generate) { *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::List&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Union&) { // No default initialization. } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { Complex::inherits (c); } - virtual Void + virtual void traverse (SemanticGraph::Enumeration&) { // No default initialization. } - virtual Void + virtual void traverse (SemanticGraph::AnyType&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&) { generate_ = true; } private: - Boolean& generate_; + bool& generate_; Traversal::Inherits inherits_; }; @@ -1722,15 +1711,15 @@ namespace CXX arg_poly_auto_ptr }; - CtorArgsWithoutBase (Context& c, ArgType, Boolean arg, Boolean first); + CtorArgsWithoutBase (Context& c, ArgType, bool arg, bool first); - virtual Void + virtual void traverse (SemanticGraph::Any&); - virtual Void + virtual void traverse (SemanticGraph::Element&); - virtual Void + virtual void traverse (SemanticGraph::Attribute&); private: @@ -1739,8 +1728,8 @@ namespace CXX private: ArgType arg_type_; - Boolean arg_; - Boolean first_; + bool arg_; + bool first_; private: Traversal::Inherits inherits_; @@ -1756,10 +1745,10 @@ namespace CXX { } - Boolean + bool generate_p (SemanticGraph::Element&); - Boolean + bool doc_root_p (SemanticGraph::Element&); private: @@ -1774,26 +1763,26 @@ namespace CXX CXX::Namespace::ScopeTracker { Namespace (Context&, - UnsignedLong first = 1, - UnsignedLong last = 0); + size_t first = 1, + size_t last = 0); - virtual Void + virtual void traverse (Type&); protected: - virtual Void - enter (Type&, String const& name, Boolean last); + virtual void + enter (Type&, String const& name, bool last); - virtual Void + virtual void leave (); protected: Context& ctx_; private: - UnsignedLong first_; - UnsignedLong last_; - UnsignedLong count_; + size_t first_; + size_t last_; + size_t count_; }; // @@ -1805,8 +1794,8 @@ namespace CXX { } - virtual Void - enter (Type& ns, String const& name, Boolean last) + virtual void + enter (Type& ns, String const& name, bool last) { Namespace::enter (ns, name, last); @@ -1832,7 +1821,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t); }; @@ -1857,26 +1846,26 @@ namespace CXX schema_ >> schema_names_ >> namespace_ >> names_ >> type_forward_; } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { traverse_ (i); } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { traverse_ (i); } private: - Void + void traverse_ (SemanticGraph::Uses&); private: Context& ctx_; Type type_; - Boolean forward_; + bool forward_; Traversal::Schema schema_; Traversal::Names schema_names_; @@ -1916,85 +1905,85 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { gen_include (t, "byte.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { gen_include (t, "unsigned-byte.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { gen_include (t, "short.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { gen_include (t, "unsigned-short.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { gen_include (t, "int.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { gen_include (t, "unsigned-int.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { if (!long_) long_ = gen_include (t, "long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { if (!unsigned_long_) unsigned_long_ = gen_include (t, "unsigned-long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { if (!long_) long_ = gen_include (t, "long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { if (!long_) long_ = gen_include (t, "long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { if (!unsigned_long_) unsigned_long_ = gen_include (t, "unsigned-long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { if (!unsigned_long_) unsigned_long_ = gen_include (t, "unsigned-long.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { if (!long_) @@ -2003,7 +1992,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { gen_include (t, "boolean.hxx"); @@ -2011,26 +2000,26 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { gen_include (t, "float.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { gen_include (t, "double.hxx"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { gen_include (t, "decimal.hxx"); } private: - Boolean + bool gen_include (SemanticGraph::Type& t, String const& file) { String custom; @@ -2055,8 +2044,8 @@ namespace CXX private: String prefix_; - Boolean long_; - Boolean unsigned_long_; + bool long_; + bool unsigned_long_; }; } } diff --git a/xsd/cxx/tree/fundamental-header.hxx b/xsd/cxx/tree/fundamental-header.hxx index 424034d..dd67f89 100644 --- a/xsd/cxx/tree/fundamental-header.hxx +++ b/xsd/cxx/tree/fundamental-header.hxx @@ -6,8 +6,8 @@ #ifndef CXX_TREE_FUNDAMENTAL_HEADER_HXX #define CXX_TREE_FUNDAMENTAL_HEADER_HXX -#include <cult/containers/set.hxx> -#include <cult/containers/vector.hxx> +#include <set> +#include <vector> #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> @@ -88,13 +88,13 @@ namespace CXX xs_ns_ = ns_name (xs_ns ()); } - Void + void gen_typedef (String const& name, String const& type, String const& arg1 = L"", String const& arg2 = L"", String const& arg3 = L"", - Boolean export_type = true) + bool export_type = true) { os << "typedef " << type; @@ -225,7 +225,7 @@ namespace CXX // anyType and anySimpleType // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { os << "// anyType and anySimpleType." << endl @@ -237,7 +237,7 @@ namespace CXX type_ = built_in_type (t, "::xsd::cxx::tree::type"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { simple_type_ = built_in_type ( @@ -259,7 +259,7 @@ namespace CXX // Integrals. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { os << "// 8-bit" << endl @@ -271,14 +271,14 @@ namespace CXX built_in_type (t, "signed char"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { built_in_type (t, "unsigned char"); os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { os << "// 16-bit" << endl @@ -290,14 +290,14 @@ namespace CXX built_in_type (t, "short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { built_in_type (t, "unsigned short"); os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { os << "// 32-bit" << endl @@ -309,14 +309,14 @@ namespace CXX built_in_type (t, "int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { built_in_type (t, "unsigned int"); os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { os << "// 64-bit" << endl @@ -328,14 +328,14 @@ namespace CXX built_in_type (t, "long long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { built_in_type (t, "unsigned long long"); os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { os << "// Supposed to be arbitrary-length integral types." << endl @@ -347,25 +347,25 @@ namespace CXX built_in_type (t, "long long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { built_in_type (t, "long long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { built_in_type (t, "unsigned long long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { built_in_type (t, "unsigned long long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { built_in_type (t, "long long"); @@ -374,7 +374,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { os << "// Boolean." << endl @@ -390,7 +390,7 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { os << "// Floating-point types." << endl @@ -402,13 +402,13 @@ namespace CXX built_in_type (t, "float"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { double_ = built_in_type (t, "double"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { decimal_ = built_in_type (t, "double"); @@ -418,7 +418,7 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { os << "// String types." << endl @@ -431,7 +431,7 @@ namespace CXX t, L"::xsd::cxx::tree::string< " + char_type + L", ", simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { norm_string_ = built_in_type ( @@ -440,21 +440,21 @@ namespace CXX string_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { token_ = built_in_type ( t, L"::xsd::cxx::tree::token< " + char_type + L", ", norm_string_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { nmtoken_ = built_in_type ( t, L"::xsd::cxx::tree::nmtoken< " + char_type + L", ", token_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { built_in_type ( @@ -464,21 +464,21 @@ namespace CXX nmtoken_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { name_ = built_in_type ( t, L"::xsd::cxx::tree::name< " + char_type + L", ", token_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { ncname_ = built_in_type ( t, L"::xsd::cxx::tree::ncname< " + char_type + L", ", name_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { built_in_type ( @@ -489,7 +489,7 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { os << "// ID/IDREF." << endl @@ -502,14 +502,14 @@ namespace CXX t, L"::xsd::cxx::tree::id< " + char_type + L", ", ncname_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { idref_ = built_in_type ( t, L"::xsd::cxx::tree::idref< " + char_type + L", ", ncname_, type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { built_in_type ( @@ -524,7 +524,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { os << "// URI." << endl @@ -541,7 +541,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { os << "// Qualified name." << endl @@ -562,7 +562,7 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { os << "// Binary." << endl @@ -586,7 +586,7 @@ namespace CXX simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { built_in_type ( @@ -600,7 +600,7 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { os << "// Date/time." << endl @@ -622,7 +622,7 @@ namespace CXX t, L"::xsd::cxx::tree::date< " + char_type + L", ", simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { built_in_type ( @@ -631,7 +631,7 @@ namespace CXX simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { built_in_type ( @@ -640,21 +640,21 @@ namespace CXX simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { built_in_type ( t, L"::xsd::cxx::tree::gday< " + char_type + L", ", simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { built_in_type ( t, L"::xsd::cxx::tree::gmonth< " + char_type + L", ", simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { built_in_type ( @@ -663,14 +663,14 @@ namespace CXX simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { built_in_type ( t, L"::xsd::cxx::tree::gyear< " + char_type + L", ", simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { built_in_type ( @@ -679,7 +679,7 @@ namespace CXX simple_type_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { built_in_type ( @@ -690,7 +690,7 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { os << "// Entity." << endl @@ -703,7 +703,7 @@ namespace CXX t, L"::xsd::cxx::tree::entity< " + char_type + L", ", ncname_); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { built_in_type ( @@ -715,14 +715,14 @@ namespace CXX os << endl; } - virtual Void + virtual void post (SemanticGraph::Namespace& n) { SemanticGraph::Context& c (xs_ns ().context()); - Boolean parsing (!options.suppress_parsing ()); - Boolean serialization (options.generate_serialization ()); - Boolean element_map (options.generate_element_map ()); + bool parsing (!options.suppress_parsing ()); + bool serialization (options.generate_serialization ()); + bool element_map (options.generate_element_map ()); if (options.generate_element_type ()) { @@ -1228,7 +1228,7 @@ namespace CXX { StringSet ns_set; - for (StringList::ConstIterator i (exports_.begin ()); + for (StringList::const_iterator i (exports_.begin ()); i != exports_.end (); ++i) { String const& e (*i); @@ -1245,14 +1245,14 @@ namespace CXX << "namespace cxx" << "{"; - for (StringSet::ConstIterator i (ns_set.begin ()); + for (StringSet::const_iterator i (ns_set.begin ()); i != ns_set.end (); ++i) { String const& ns (*i); String prefix (L"::xsd::cxx::" + ns); - Size n (1); - for (Size b (0), e (ns.find (':')); ; n++) + size_t n (1); + for (size_t b (0), e (ns.find (':')); ; n++) { os << "namespace " << String (ns, b, e) << "{"; @@ -1264,7 +1264,7 @@ namespace CXX e = ns.find (':', b); } - for (StringList::ConstIterator i (exports_.begin ()); + for (StringList::const_iterator i (exports_.begin ()); i != exports_.end (); ++i) { String const& e (*i); @@ -1289,10 +1289,10 @@ namespace CXX } private: - typedef Cult::Containers::Set<String> StringSet; - typedef Cult::Containers::Vector<String> StringList; + typedef std::set<String> StringSet; + typedef std::vector<String> StringList; - Boolean export_; + bool export_; StringList exports_; StringSet exports_set_; String xs_ns_; diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx index 4eb4de2..ff2b705 100644 --- a/xsd/cxx/tree/generator.cxx +++ b/xsd/cxx/tree/generator.cxx @@ -3,6 +3,7 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include <vector> #include <iostream> #include <boost/filesystem/fstream.hpp> @@ -10,9 +11,6 @@ #include <cutl/re.hxx> #include <cutl/shared-ptr.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> @@ -50,10 +48,7 @@ #include "../../../libxsd/xsd/cxx/version.hxx" -using std::endl; -using std::wcerr; -using std::wcout; - +using namespace std; using namespace cutl; using namespace XSDFrontend::SemanticGraph; @@ -71,7 +66,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, an XML Schema to\n" @@ -105,7 +100,7 @@ namespace CXX "// in the accompanying FLOSSE file.\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, an XML Schema\n" @@ -116,7 +111,7 @@ namespace CXX "//\n\n"; } - Void Tree::Generator:: + void Tree::Generator:: usage () { CXX::Tree::options::print_usage (wcout); @@ -125,7 +120,7 @@ namespace CXX namespace { - Void + void open (WideInputFileStream& ifs, NarrowString const& path) { try @@ -150,7 +145,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowString const& path, WideInputFileStream& default_is) @@ -170,7 +165,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def) @@ -186,24 +181,20 @@ namespace CXX } - UnsignedLong Tree::Generator:: + size_t Tree::Generator:: generate (Tree::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, StringLiteralMap const& string_literal_map, const WarningSet& disabled_warnings, FileList& file_list, AutoUnlinks& unlinks) { - using std::ios_base; - typedef cutl::re::regexsub Regex; - using Cult::Containers::Vector; - - typedef Vector<Path> Paths; - typedef Vector<shared_ptr<WideOutputFileStream> > WideOutputFileStreams; + typedef vector<Path> Paths; + typedef vector<shared_ptr<WideOutputFileStream> > WideOutputFileStreams; try { @@ -280,7 +271,7 @@ namespace CXX // // - 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 @@ -296,9 +287,9 @@ namespace CXX } } - 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); // Generate code. // @@ -370,7 +361,7 @@ namespace CXX { if (parts > 1) { - for (UnsignedLong i (0); i < parts; ++i) + for (size_t i (0); i < parts; ++i) { std::ostringstream os; os << i; @@ -430,7 +421,7 @@ namespace CXX ixx_path = out_dir / ixx_path; fwd_path = out_dir / fwd_path; - for (Paths::Iterator i (cxx_paths.begin ()); + for (Paths::iterator i (cxx_paths.begin ()); i != cxx_paths.end (); ++i) *i = out_dir / *i; } @@ -493,7 +484,7 @@ namespace CXX // if (source) { - for (Paths::Iterator i (cxx_paths.begin ()); + for (Paths::iterator i (cxx_paths.begin ()); i != cxx_paths.end (); ++i) { shared_ptr<WideOutputFileStream> s ( @@ -514,7 +505,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); if (forward) @@ -539,7 +530,7 @@ namespace CXX if (source) { - for (WideOutputFileStreams::Iterator i (cxx.begin ()); + for (WideOutputFileStreams::iterator i (cxx.begin ()); i != cxx.end (); ++i) **i << copyright; } @@ -568,7 +559,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); typedef compiler::ostream_filter<compiler::cxx_indenter, wchar_t> diff --git a/xsd/cxx/tree/generator.hxx b/xsd/cxx/tree/generator.hxx index 0e05585..5db4a5d 100644 --- a/xsd/cxx/tree/generator.hxx +++ b/xsd/cxx/tree/generator.hxx @@ -6,12 +6,11 @@ #ifndef CXX_TREE_GENERATOR_HXX #define CXX_TREE_GENERATOR_HXX -#include <cult/types.hxx> - #include <xsd-frontend/semantic-graph/elements.hxx> // Path #include <xsd-frontend/semantic-graph/schema.hxx> #include <xsd.hxx> +#include <types.hxx> #include <cxx/literal-map.hxx> #include <cxx/tree/options.hxx> @@ -20,21 +19,19 @@ namespace CXX { namespace Tree { - using namespace Cult::Types; - class Generator { public: - static Void + static void usage (); struct Failed {}; - static UnsignedLong + static size_t generate (options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, - Boolean file_per_type, + bool file_per_type, StringLiteralMap const&, const WarningSet& disabled_warnings, FileList& file_list, diff --git a/xsd/cxx/tree/name-processor.cxx b/xsd/cxx/tree/name-processor.cxx index 5fc7876..1e21bab 100644 --- a/xsd/cxx/tree/name-processor.cxx +++ b/xsd/cxx/tree/name-processor.cxx @@ -3,18 +3,19 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include <set> +#include <map> +#include <vector> #include <sstream> #include <iostream> #include <cutl/re.hxx> -#include <cult/containers/set.hxx> -#include <cult/containers/map.hxx> -#include <cult/containers/vector.hxx> - #include <cxx/tree/default-value.hxx> #include <cxx/tree/name-processor.hxx> +using namespace std; + namespace CXX { namespace Tree @@ -29,7 +30,7 @@ namespace CXX { // // - typedef Cult::Containers::Set<String> NameSet; + typedef set<String> NameSet; class Context: public Tree::Context { @@ -38,7 +39,7 @@ namespace CXX Context (Tree::options const& ops, Counts const& counts, - Boolean generate_xml_schema, + bool generate_xml_schema, SemanticGraph::Schema& root, SemanticGraph::Path const& path, StringLiteralMap const& map) @@ -69,12 +70,9 @@ namespace CXX enumerator_regex (enumerator_regex_), element_type_regex (element_type_regex_) { - typedef Containers::Vector<NarrowString> Vector; - NarrowString tn (options.type_naming ()); NarrowString fn (options.function_naming ()); - // Type name regex. // { @@ -285,12 +283,12 @@ namespace CXX typedef cutl::re::wregexsub Regex; typedef cutl::re::wformat RegexFormat; - struct RegexVector: Cult::Containers::Vector<Regex> + struct RegexVector: vector<Regex> { void push_back (String const& r) { - Cult::Containers::Vector<Regex>::push_back (Regex (r)); + vector<Regex>::push_back (Regex (r)); } }; @@ -299,12 +297,12 @@ namespace CXX RegexVector const& rv, String const& id) { - Boolean trace (options.name_regex_trace ()); + bool trace (options.name_regex_trace ()); if (trace) os << id << " name: '" << name << "'" << endl; - for (RegexVector::ConstReverseIterator i (rv.rbegin ()); + for (RegexVector::const_reverse_iterator i (rv.rbegin ()); i != rv.rend (); ++i) { if (trace) @@ -333,12 +331,12 @@ namespace CXX RegexVector const& backup, String const& id) { - Boolean trace (options.name_regex_trace ()); + bool trace (options.name_regex_trace ()); if (trace) os << id << " name: '" << name << "'" << endl; - for (RegexVector::ConstReverseIterator i (primary.rbegin ()); + for (RegexVector::const_reverse_iterator i (primary.rbegin ()); i != primary.rend (); ++i) { if (trace) @@ -358,7 +356,7 @@ namespace CXX os << '-' << endl; } - for (RegexVector::ConstReverseIterator i (backup.rbegin ()); + for (RegexVector::const_reverse_iterator i (backup.rbegin ()); i != backup.rend (); ++i) { if (trace) @@ -388,12 +386,12 @@ namespace CXX String const& id) { String s (ns + L' ' + name); - Boolean trace (options.name_regex_trace ()); + bool trace (options.name_regex_trace ()); if (trace) os << id << " name: '" << s << "'" << endl; - for (RegexVector::ConstReverseIterator i (rv.rbegin ()); + for (RegexVector::const_reverse_iterator i (rv.rbegin ()); i != rv.rend (); ++i) { if (trace) @@ -424,12 +422,12 @@ namespace CXX String const& id) { String s (ns + L' ' + name); - Boolean trace (options.name_regex_trace ()); + bool trace (options.name_regex_trace ()); if (trace) os << id << " name: '" << s << "'" << endl; - for (RegexVector::ConstReverseIterator i (primary.rbegin ()); + for (RegexVector::const_reverse_iterator i (primary.rbegin ()); i != primary.rend (); ++i) { if (trace) @@ -449,7 +447,7 @@ namespace CXX os << '-' << endl; } - for (RegexVector::ConstReverseIterator i (backup.rbegin ()); + for (RegexVector::const_reverse_iterator i (backup.rbegin ()); i != backup.rend (); ++i) { if (trace) @@ -476,11 +474,11 @@ namespace CXX String find_name (String const& base_name, NameSet& set, - Boolean insert = true) + bool insert = true) { String name (base_name); - 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; @@ -494,7 +492,7 @@ namespace CXX } private: - Void + void compile_regex (NarrowStrings const& sv, RegexVector& rv, String const& id) @@ -517,8 +515,8 @@ namespace CXX } private: - Cult::Containers::Map<String, NameSet> global_type_names_; - Cult::Containers::Map<String, NameSet> global_element_names_; + map<String, NameSet> global_type_names_; + map<String, NameSet> global_element_names_; RegexVector type_regex_; RegexVector accessor_regex_; @@ -535,10 +533,10 @@ namespace CXX RegexVector element_type_regex_; public: - Cult::Containers::Map<String, NameSet>& global_type_names; - Cult::Containers::Map<String, NameSet>& global_element_names; + map<String, NameSet>& global_type_names; + map<String, NameSet>& global_element_names; - Boolean detach; + bool detach; RegexVector& type_regex; RegexVector& accessor_regex; @@ -564,7 +562,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // Process the name with enumerator name regex. @@ -591,7 +589,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // Use processed name. @@ -631,7 +629,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Tree::Context::skip (m)) @@ -658,19 +656,19 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Tree::Context::skip (m)) return; - UnsignedLong max (Tree::Context::max (m)); - UnsignedLong min (Tree::Context::min (m)); + size_t max (Tree::Context::max (m)); + size_t min (Tree::Context::min (m)); String const& s (m.context ().get<String> ("stem")); String const& b (m.context ().get<String> ("name")); - Boolean def_attr (m.default_p () && + bool def_attr (m.default_p () && m.is_a<SemanticGraph::Attribute> ()); // Accessors/modifiers. Note that we postpone inserting @@ -810,7 +808,7 @@ namespace CXX // if (m.default_p ()) { - Boolean simple (true); + bool simple (true); if (m.is_a<SemanticGraph::Element> ()) { @@ -827,7 +825,7 @@ namespace CXX m.context ().set ( "default-value", find_name (an, name_set_)); - Boolean lit (false); + bool lit (false); { IsLiteralValue test (lit); test.dispatch (m.type ()); @@ -855,7 +853,7 @@ namespace CXX Any (Context& c, NameSet& name_set, NameSet& stem_set, - Boolean& has_wildcard) + bool& has_wildcard) : Context (c), name_set_ (name_set), stem_set_ (stem_set), @@ -863,11 +861,11 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { - UnsignedLong max (Tree::Context::max (a)); - UnsignedLong min (Tree::Context::min (a)); + size_t max (Tree::Context::max (a)); + size_t min (Tree::Context::min (a)); String s (find_name (L"any", stem_set_)); @@ -985,7 +983,7 @@ namespace CXX has_wildcard_ = true; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String s (find_name (L"any,attribute", stem_set_)); @@ -1051,7 +1049,7 @@ namespace CXX private: NameSet& name_set_; NameSet& stem_set_; - Boolean& has_wildcard_; + bool& has_wildcard_; }; // @@ -1063,7 +1061,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -1149,7 +1147,7 @@ namespace CXX // if (options.generate_wildcard ()) { - Boolean has_wildcard (false); + bool has_wildcard (false); Any any (*this, member_set, stem_set, has_wildcard); Traversal::Names names (any); Complex::names (c, names); @@ -1212,7 +1210,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { // Process the name with type name regex. @@ -1255,7 +1253,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First we need to figure out if we need to process this @@ -1430,7 +1428,7 @@ namespace CXX if (type_set_.find (r) != type_set_.end ()) r += L"_"; - for (UnsignedLong i (1); + for (size_t i (1); element_set_.find (r) != element_set_.end () || type_set_.find (r) != type_set_.end (); ++i) { @@ -1454,7 +1452,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { NameSet& type_set (global_type_names[ns.name ()]); @@ -1475,7 +1473,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { String const& name (ns.name ()); @@ -1557,7 +1555,7 @@ namespace CXX *this >> names_ >> *this; } - Void + void process_name (SemanticGraph::Type& t, String const& name) { String r ( @@ -1567,10 +1565,10 @@ namespace CXX t.context ().set ("name", escape (r)); } - Void + void process_name (SemanticGraph::Namespace& n, String const& name, - Char const* key) + char const* key) { String r (process_regex (name, type_regex, L"type")); n.context ().set (key, escape (r)); @@ -1578,13 +1576,13 @@ namespace CXX // anyType and anySimpleType // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { process_name (t, "type"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { process_name (t, "simple,type"); @@ -1592,79 +1590,79 @@ namespace CXX // Integrals. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { process_name (t, "byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { process_name (t, "unsigned,byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { process_name (t, "short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { process_name (t, "unsigned,short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { process_name (t, "int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { process_name (t, "unsigned,int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { process_name (t, "long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { process_name (t, "unsigned,long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { process_name (t, "integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { process_name (t, "non,positive,integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { process_name (t, "non,negative,integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { process_name (t, "positive,integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { process_name (t, "negative,integer"); @@ -1672,7 +1670,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { process_name (t, "boolean"); @@ -1680,19 +1678,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { process_name (t, "float"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { process_name (t, "double"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { process_name (t, "decimal"); @@ -1700,49 +1698,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { process_name (t, "string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { process_name (t, "normalized,string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { process_name (t, "token"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { process_name (t, "nmtoken"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { process_name (t, "nmtokens"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { process_name (t, "name"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { process_name (t, "ncname"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { process_name (t, "language"); @@ -1750,19 +1748,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { process_name (t, "id"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { process_name (t, "idref"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { process_name (t, "idrefs"); @@ -1771,7 +1769,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { process_name (t, "uri"); @@ -1779,7 +1777,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { process_name (t, "qname"); @@ -1787,13 +1785,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { process_name (t, "base64,binary"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { process_name (t, "hex,binary"); @@ -1802,55 +1800,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { process_name (t, "date"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { process_name (t, "date,time"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { process_name (t, "duration"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { process_name (t, "gday"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { process_name (t, "gmonth"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { process_name (t, "gmonth,day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { process_name (t, "gyear"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { process_name (t, "gyear,month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { process_name (t, "time"); @@ -1858,19 +1856,19 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { process_name (t, "entity"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { process_name (t, "entities"); } - virtual Void + virtual void post (SemanticGraph::Namespace& n) { // Assign names to extra stuff in the XML Schema namespace. @@ -1955,7 +1953,7 @@ namespace CXX // struct UsesPassOne: Traversal::Uses { - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Schema& s (u.schema ()); @@ -1970,7 +1968,7 @@ namespace CXX struct UsesPassThree: Traversal::Uses { - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Schema& s (u.schema ()); @@ -1988,7 +1986,7 @@ namespace CXX // struct Implies: Traversal::Implies { - virtual Void + virtual void traverse (SemanticGraph::Implies& i) { SemanticGraph::Schema& s (i.schema ()); @@ -2001,7 +1999,7 @@ namespace CXX } }; - Boolean + bool process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, @@ -2128,7 +2126,7 @@ namespace CXX } } - Boolean NameProcessor:: + bool NameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, diff --git a/xsd/cxx/tree/name-processor.hxx b/xsd/cxx/tree/name-processor.hxx index 2d87388..8026a3d 100644 --- a/xsd/cxx/tree/name-processor.hxx +++ b/xsd/cxx/tree/name-processor.hxx @@ -6,6 +6,8 @@ #ifndef CXX_TREE_NAME_PROCESSOR_HXX #define CXX_TREE_NAME_PROCESSOR_HXX +#include <types.hxx> + #include <cxx/tree/elements.hxx> #include <cxx/tree/options.hxx> @@ -13,14 +15,12 @@ namespace CXX { namespace Tree { - using namespace Cult::Types; - class NameProcessor { public: NameProcessor (); // Dummy ctor, helps with long symbols on HP-UX. - Boolean + bool process (options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, diff --git a/xsd/cxx/tree/options.cli b/xsd/cxx/tree/options.cli index 9d67653..0d548e4 100644 --- a/xsd/cxx/tree/options.cli +++ b/xsd/cxx/tree/options.cli @@ -3,11 +3,9 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -include <vector>; -include <string>; include <cstddef>; // std::size_t -include <cult/types.hxx>; // NarrowString +include <types.hxx>; // NarrowString, NarrowStrings include <cxx/options.cli>; @@ -27,7 +25,7 @@ namespace CXX hierarchies are polymorphic." }; - std::vector<Cult::Types::NarrowString> --polymorphic-type + NarrowStrings --polymorphic-type { "<type>", "Indicate that <type> is a root of a polymorphic type hierarchy. The @@ -113,7 +111,7 @@ namespace CXX this option." }; - std::vector<Cult::Types::NarrowString> --generate-insertion + NarrowStrings --generate-insertion { "<os>", "Generate data representation stream insertion operators for the <os> @@ -125,7 +123,7 @@ namespace CXX declarations." }; - std::vector<Cult::Types::NarrowString> --generate-extraction + NarrowStrings --generate-extraction { "<is>", "Generate data representation stream extraction constructors for the @@ -181,7 +179,7 @@ namespace CXX // Naming. // - Cult::Types::NarrowString --type-naming = "knr" + NarrowString --type-naming = "knr" { "<style>", "Specify the type naming convention that should be used in the @@ -190,7 +188,7 @@ namespace CXX information." }; - Cult::Types::NarrowString --function-naming = "knr" + NarrowString --function-naming = "knr" { "<style>", "Specify the function naming convention that should be used in the @@ -199,7 +197,7 @@ namespace CXX information." }; - std::vector<Cult::Types::NarrowString> --type-regex + NarrowStrings --type-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -207,7 +205,7 @@ namespace CXX section below for more information." }; - std::vector<Cult::Types::NarrowString> --accessor-regex + NarrowStrings --accessor-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -215,7 +213,7 @@ namespace CXX names. See the NAMING CONVENTION section below for more information." }; - std::vector<Cult::Types::NarrowString> --one-accessor-regex + NarrowStrings --one-accessor-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -224,7 +222,7 @@ namespace CXX below for more information." }; - std::vector<Cult::Types::NarrowString> --opt-accessor-regex + NarrowStrings --opt-accessor-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -233,7 +231,7 @@ namespace CXX below for more information." }; - std::vector<Cult::Types::NarrowString> --seq-accessor-regex + NarrowStrings --seq-accessor-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -242,7 +240,7 @@ namespace CXX below for more information." }; - std::vector<Cult::Types::NarrowString> --modifier-regex + NarrowStrings --modifier-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -250,7 +248,7 @@ namespace CXX names. See the NAMING CONVENTION section below for more information." }; - std::vector<Cult::Types::NarrowString> --one-modifier-regex + NarrowStrings --one-modifier-regex { "<regex>", @@ -260,7 +258,7 @@ namespace CXX for more information." }; - std::vector<Cult::Types::NarrowString> --opt-modifier-regex + NarrowStrings --opt-modifier-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -269,7 +267,7 @@ namespace CXX below for more information." }; - std::vector<Cult::Types::NarrowString> --seq-modifier-regex + NarrowStrings --seq-modifier-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -278,7 +276,7 @@ namespace CXX below for more information." }; - std::vector<Cult::Types::NarrowString> --parser-regex + NarrowStrings --parser-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -286,7 +284,7 @@ namespace CXX NAMING CONVENTION section below for more information." }; - std::vector<Cult::Types::NarrowString> --serializer-regex + NarrowStrings --serializer-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -294,7 +292,7 @@ namespace CXX the NAMING CONVENTION section below for more information." }; - std::vector<Cult::Types::NarrowString> --enumerator-regex + NarrowStrings --enumerator-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -302,7 +300,7 @@ namespace CXX NAMING CONVENTION section below for more information." }; - std::vector<Cult::Types::NarrowString> --element-type-regex + NarrowStrings --element-type-regex { "<regex>", "Add <regex> to the list of regular expressions used to translate @@ -345,7 +343,7 @@ namespace CXX global elements are considered document roots." }; - std::vector<Cult::Types::NarrowString> --root-element + NarrowStrings --root-element { "<element>", "Treat only <element> as a document root. Repeat this option to @@ -354,7 +352,7 @@ namespace CXX // Custom type. // - std::vector<Cult::Types::NarrowString> --custom-type + NarrowStrings --custom-type { "<map>", "Use a custom C++ type instead of the generated class. The <map> @@ -367,7 +365,7 @@ namespace CXX still generated but with that name." }; - std::vector<Cult::Types::NarrowString> --custom-type-regex + NarrowStrings --custom-type-regex { "<regex>", "Use custom C++ types instead of the generated classes. The <regex> @@ -397,7 +395,7 @@ namespace CXX to insufficient memory)." }; - Cult::Types::NarrowString --parts-suffix = "-" + NarrowString --parts-suffix = "-" { "<suffix>", "Use <suffix> instead of the default '\cb{-}' to separate the file diff --git a/xsd/cxx/tree/parser-header.cxx b/xsd/cxx/tree/parser-header.cxx index 61eb79a..59cc043 100644 --- a/xsd/cxx/tree/parser-header.cxx +++ b/xsd/cxx/tree/parser-header.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) @@ -449,7 +449,7 @@ namespace CXX } - Void + void generate_parser_header (Context& ctx) { ctx.os << "#include <iosfwd>" << endl diff --git a/xsd/cxx/tree/parser-header.hxx b/xsd/cxx/tree/parser-header.hxx index 478ddff..0857f83 100644 --- a/xsd/cxx/tree/parser-header.hxx +++ b/xsd/cxx/tree/parser-header.hxx @@ -13,7 +13,7 @@ namespace CXX { namespace Tree { - Void + void generate_parser_header (Context&); } } diff --git a/xsd/cxx/tree/parser-source.cxx b/xsd/cxx/tree/parser-source.cxx index ee83fd2..32491ac 100644 --- a/xsd/cxx/tree/parser-source.cxx +++ b/xsd/cxx/tree/parser-source.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) @@ -294,7 +294,7 @@ namespace CXX // DOM. // - Boolean fund (false); + bool fund (false); { IsFundamentalType test (fund); test.dispatch (t); @@ -304,7 +304,7 @@ namespace CXX // If this element's type is anonymous then we don't need to do // anything. // - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); // const DOMDocument& // @@ -517,10 +517,8 @@ namespace CXX }; } - Void - generate_parser_source (Context& ctx, - UnsignedLong first, - UnsignedLong last) + void + generate_parser_source (Context& ctx, size_t first, size_t last) { ctx.os << "#include <istream>" << endl << "#include <xsd/cxx/xml/sax/std-input-source.hxx>" << endl diff --git a/xsd/cxx/tree/parser-source.hxx b/xsd/cxx/tree/parser-source.hxx index b4d0d15..62f7bbc 100644 --- a/xsd/cxx/tree/parser-source.hxx +++ b/xsd/cxx/tree/parser-source.hxx @@ -12,8 +12,8 @@ namespace CXX { namespace Tree { - Void - generate_parser_source (Context&, UnsignedLong first, UnsignedLong last); + void + generate_parser_source (Context&, size_t first, size_t last); } } diff --git a/xsd/cxx/tree/polymorphism-processor.cxx b/xsd/cxx/tree/polymorphism-processor.cxx index 66e7c63..be9fe81 100644 --- a/xsd/cxx/tree/polymorphism-processor.cxx +++ b/xsd/cxx/tree/polymorphism-processor.cxx @@ -3,17 +3,16 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include <set> +#include <iostream> + #include <cxx/tree/elements.hxx> #include <cxx/tree/polymorphism-processor.hxx> #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> -#include <cult/containers/set.hxx> - -#include <iostream> - -using std::wcerr; +using namespace std; namespace CXX { @@ -30,10 +29,10 @@ namespace CXX insert (*begin); } - Void + void insert (String const& name) { - Size p (name.rfind ('#')); + size_t p (name.rfind ('#')); if (p == String::npos) unames_.insert (name); @@ -41,7 +40,7 @@ namespace CXX qnames_.insert (name); } - Boolean + bool find (SemanticGraph::Type& t) { if (!unames_.empty ()) @@ -61,7 +60,7 @@ namespace CXX } private: - typedef Cult::Containers::Set<String> StringSet; + typedef set<String> StringSet; StringSet unames_; StringSet qnames_; @@ -78,7 +77,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& ctx (t.context ()); @@ -87,7 +86,7 @@ namespace CXX ctx.set ("polymorphic", poly_types_.find (t)); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { SemanticGraph::Context& ctx (c.context ()); @@ -96,7 +95,7 @@ namespace CXX { // First check our base. // - Boolean pb (false); + bool pb (false); if (c.inherits_p ()) { SemanticGraph::Type& b (c.inherits ().base ()); @@ -104,7 +103,7 @@ namespace CXX if (!b.context ().count ("polymorphic")) dispatch (b); - pb = b.context ().get<Boolean> ("polymorphic"); + pb = b.context ().get<bool> ("polymorphic"); } ctx.set ("polymorphic", pb || poly_types_.find (c)); @@ -171,13 +170,13 @@ namespace CXX Traversal::Fundamental::Entity, Traversal::Fundamental::Entities { - FundType (TypeSet& poly_types, Boolean& valid) + FundType (TypeSet& poly_types, bool& valid) : poly_types_ (poly_types), valid_ (valid) { } - Void - check (SemanticGraph::Type& t, Boolean fund) + void + check (SemanticGraph::Type& t, bool fund) { SemanticGraph::Context& ctx (t.context ()); @@ -201,13 +200,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { check (t, false); @@ -215,7 +214,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { check (t, true); @@ -223,79 +222,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { check (t, true); @@ -303,19 +302,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { check (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { check (t, true); @@ -323,49 +322,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { check (t, false); @@ -374,7 +373,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { check (t, false); @@ -383,19 +382,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { check (t, false); @@ -403,7 +402,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { check (t, false); @@ -411,13 +410,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { check (t, false); @@ -426,55 +425,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { check (t, false); @@ -482,13 +481,13 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { check (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { check (t, false); @@ -496,13 +495,13 @@ namespace CXX private: TypeSet& poly_types_; - Boolean& valid_; + bool& valid_; }; struct GlobalElement: Traversal::Element { GlobalElement (TypeSet& poly_types, - Boolean& valid, + bool& valid, const WarningSet& disabled_warnings) : poly_types_ (poly_types), valid_ (valid), warning_ (true) { @@ -511,7 +510,7 @@ namespace CXX warning_ = false; } - virtual Void + virtual void traverse (Type& e) { using SemanticGraph::Schema; @@ -528,13 +527,13 @@ namespace CXX // We may need to override the previous value. // - if (ctx.count ("polymorphic") && ctx.get<Boolean> ("polymorphic")) + if (ctx.count ("polymorphic") && ctx.get<bool> ("polymorphic")) return; // Built-in types that are mapped to fundamental types cannot // be declared polymorphic. // - Boolean fund (false); + bool fund (false); IsFundamentalType test (fund); test.dispatch (rt); @@ -585,7 +584,7 @@ namespace CXX private: // Return true if root sources s. // - Boolean + bool sources_p (SemanticGraph::Schema& root, SemanticGraph::Schema& s) { using SemanticGraph::Schema; @@ -606,8 +605,8 @@ namespace CXX private: TypeSet& poly_types_; - Boolean& valid_; - Boolean warning_; + bool& valid_; + bool warning_; }; // Go into sourced/included/imported schemas while making sure @@ -617,12 +616,12 @@ namespace CXX Traversal::Includes, Traversal::Imports { - Uses (Char const* seen_key) + Uses (char const* seen_key) : seen_key_ (seen_key) { } - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -634,7 +633,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -646,7 +645,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -659,19 +658,19 @@ namespace CXX } private: - Char const* seen_key_; + char const* seen_key_; }; - Char const* pass_one_key = "cxx-tree-polymorphism-processor-seen-one"; - Char const* pass_two_key = "cxx-tree-polymorphism-processor-seen-two"; + char const* pass_one_key = "cxx-tree-polymorphism-processor-seen-one"; + char const* pass_two_key = "cxx-tree-polymorphism-processor-seen-two"; - Boolean + bool process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const&, const WarningSet& disabled_warnings) { - Boolean valid (true); + bool valid (true); // Prepare a set of polymorphic types. // @@ -779,7 +778,7 @@ namespace CXX } } - Boolean PolymorphismProcessor:: + bool PolymorphismProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, diff --git a/xsd/cxx/tree/polymorphism-processor.hxx b/xsd/cxx/tree/polymorphism-processor.hxx index aebf8d4..fb0a29a 100644 --- a/xsd/cxx/tree/polymorphism-processor.hxx +++ b/xsd/cxx/tree/polymorphism-processor.hxx @@ -6,24 +6,21 @@ #ifndef CXX_TREE_POLYMORPHISM_PROCESSOR_HXX #define CXX_TREE_POLYMORPHISM_PROCESSOR_HXX -#include <cult/types.hxx> - #include <xsd-frontend/semantic-graph.hxx> -#include <cxx/tree/options.hxx> - #include <xsd.hxx> +#include <types.hxx> + +#include <cxx/tree/options.hxx> namespace CXX { namespace Tree { - using namespace Cult::Types; - class PolymorphismProcessor { public: - Boolean + bool process (options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, diff --git a/xsd/cxx/tree/serialization-header.cxx b/xsd/cxx/tree/serialization-header.cxx index 1070847..33359fc 100644 --- a/xsd/cxx/tree/serialization-header.cxx +++ b/xsd/cxx/tree/serialization-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -67,7 +67,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -112,7 +112,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -156,7 +156,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -175,7 +175,7 @@ namespace CXX "const " << name << "&);" << endl; - Boolean simple (true); + bool simple (true); { IsSimpleType t (simple); t.dispatch (c); @@ -211,7 +211,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (doc_root_p (e)) @@ -237,7 +237,7 @@ namespace CXX } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) @@ -533,10 +533,10 @@ namespace CXX } - Void + void generate_serialization_header (Context& ctx) { - Boolean elemen_type (ctx.options.generate_element_type ()); + bool elemen_type (ctx.options.generate_element_type ()); if (!elemen_type) ctx.os << "#include <iosfwd>" << endl diff --git a/xsd/cxx/tree/serialization-header.hxx b/xsd/cxx/tree/serialization-header.hxx index b0eb726..0b772e3 100644 --- a/xsd/cxx/tree/serialization-header.hxx +++ b/xsd/cxx/tree/serialization-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_serialization_header (Context&); } } diff --git a/xsd/cxx/tree/serialization-source.cxx b/xsd/cxx/tree/serialization-source.cxx index 411a5ef..8711210 100644 --- a/xsd/cxx/tree/serialization-source.cxx +++ b/xsd/cxx/tree/serialization-source.cxx @@ -42,7 +42,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -133,7 +133,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -204,7 +204,7 @@ namespace CXX inherits_base_ >> base_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -290,7 +290,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) @@ -307,7 +307,7 @@ namespace CXX // dynamically-type with xsi:type. // SemanticGraph::Type& t (e.type ()); - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); os << "// " << comment (e.name ()) << endl << "//" << endl; @@ -514,7 +514,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& aname (eaname (a)); @@ -572,7 +572,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& aname (eaname (a)); @@ -665,7 +665,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& aname (eaname (a)); @@ -702,7 +702,7 @@ namespace CXX inherits_ >> base_; } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -760,7 +760,7 @@ namespace CXX os << "}"; - Boolean simple (true); + bool simple (true); { IsSimpleType t (simple); t.dispatch (c); @@ -768,7 +768,7 @@ namespace CXX if (simple) { - Boolean hb (c.inherits_p ()); + bool hb (c.inherits_p ()); // operator<< (xercesc::DOMAttr) // @@ -849,7 +849,7 @@ namespace CXX belongs_ >> type_name_; } - virtual Void + virtual void traverse (Type& e) { if (polymorphic && e.substitutes_p ()) @@ -892,7 +892,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (doc_root_p (e)) @@ -928,7 +928,7 @@ namespace CXX } private: - Boolean element_map_; + bool element_map_; }; struct ElementFunction: Traversal::Element, @@ -940,7 +940,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) @@ -961,7 +961,7 @@ namespace CXX // If this element's type is anonymous then we don't need to do // anything. // - Boolean poly (polymorphic && + bool poly (polymorphic && polymorphic_p (type) && !anonymous_p (type)); @@ -1240,12 +1240,10 @@ namespace CXX }; } - Void - generate_serialization_source (Context& ctx, - UnsignedLong first, - UnsignedLong last) + void + generate_serialization_source (Context& ctx, size_t first, size_t last) { - Boolean elemen_type (ctx.options.generate_element_type ()); + bool elemen_type (ctx.options.generate_element_type ()); if (!elemen_type) ctx.os << "#include <ostream>" << endl @@ -1259,8 +1257,8 @@ namespace CXX ctx.os << "#include <xsd/cxx/tree/type-serializer-map.hxx>" << endl << endl; - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { diff --git a/xsd/cxx/tree/serialization-source.hxx b/xsd/cxx/tree/serialization-source.hxx index b86537c..12f31f2 100644 --- a/xsd/cxx/tree/serialization-source.hxx +++ b/xsd/cxx/tree/serialization-source.hxx @@ -12,10 +12,8 @@ namespace CXX { namespace Tree { - Void - generate_serialization_source (Context&, - UnsignedLong first, - UnsignedLong last); + void + generate_serialization_source (Context&, size_t first, size_t last); } } diff --git a/xsd/cxx/tree/stream-extraction-source.cxx b/xsd/cxx/tree/stream-extraction-source.cxx index 53eaa09..622056f 100644 --- a/xsd/cxx/tree/stream-extraction-source.cxx +++ b/xsd/cxx/tree/stream-extraction-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -43,7 +43,7 @@ namespace CXX base += L" >"; - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_extraction ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -102,7 +102,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -115,7 +115,7 @@ namespace CXX String const& base (xs_string_type); - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_extraction ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -162,7 +162,7 @@ namespace CXX inherits_base_ >> base_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -173,13 +173,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); if (string_based) { SemanticGraph::Enumeration* base_enum (0); @@ -193,7 +193,7 @@ namespace CXX if (string_based) value = evalue (e); - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_extraction ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -260,7 +260,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (skip (m)) @@ -280,7 +280,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -292,7 +292,7 @@ namespace CXX << " " << member << " (this->" << dom_doc << " ())"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& member (emember (a)); @@ -312,7 +312,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) @@ -323,7 +323,7 @@ namespace CXX SemanticGraph::Type& t (e.type ()); String type (etype (e)); - Boolean fund (false); + bool fund (false); { IsFundamentalType traverser (fund); traverser.dispatch (t); @@ -335,7 +335,7 @@ namespace CXX // from which makes it impossible to substitute or dynamically- // type with xsi:type. // - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); if (max (e) != 1) { @@ -495,13 +495,13 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& member (emember (a)); String type (etype (a)); - Boolean fund (false); + bool fund (false); { IsFundamentalType traverser (fund); traverser.dispatch (a.type ()); @@ -565,7 +565,7 @@ namespace CXX names_ctor_member_ >> ctor_any_; } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -576,9 +576,9 @@ namespace CXX if (renamed_type (c, name) && !name) return; - Boolean has_members (has<Traversal::Member> (c)); + bool has_members (has<Traversal::Member> (c)); - Boolean facets (false); + bool facets (false); if (c.inherits_p ()) { // See if we have any facets that we need to handle. @@ -596,7 +596,7 @@ namespace CXX } } - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_extraction ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -696,7 +696,7 @@ namespace CXX }; } - Void + void generate_stream_extraction_source (Context& ctx) { if (ctx.polymorphic) @@ -706,8 +706,8 @@ namespace CXX ctx.os << "#include <xsd/cxx/tree/stream-extraction-map.hxx>" << endl << endl; - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { @@ -759,7 +759,7 @@ namespace CXX ctx.os << "namespace _xsd" << "{"; - UnsignedLong n (0); + size_t n (0); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) { diff --git a/xsd/cxx/tree/stream-extraction-source.hxx b/xsd/cxx/tree/stream-extraction-source.hxx index 04f5f20..6d00140 100644 --- a/xsd/cxx/tree/stream-extraction-source.hxx +++ b/xsd/cxx/tree/stream-extraction-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_stream_extraction_source (Context&); } } diff --git a/xsd/cxx/tree/stream-header.cxx b/xsd/cxx/tree/stream-header.cxx index 76c1ac9..258d335 100644 --- a/xsd/cxx/tree/stream-header.cxx +++ b/xsd/cxx/tree/stream-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -48,7 +48,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -75,7 +75,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -86,13 +86,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); if (string_based) { SemanticGraph::Enumeration* be (0); @@ -129,7 +129,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -149,7 +149,7 @@ namespace CXX }; } - Void + void generate_stream_header (Context& ctx) { String c (ctx.char_type); diff --git a/xsd/cxx/tree/stream-header.hxx b/xsd/cxx/tree/stream-header.hxx index 6c9414c..e2689dd 100644 --- a/xsd/cxx/tree/stream-header.hxx +++ b/xsd/cxx/tree/stream-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_stream_header (Context&); } } diff --git a/xsd/cxx/tree/stream-insertion-header.cxx b/xsd/cxx/tree/stream-insertion-header.cxx index 139bf8b..5907dad 100644 --- a/xsd/cxx/tree/stream-insertion-header.cxx +++ b/xsd/cxx/tree/stream-insertion-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -55,7 +55,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -89,7 +89,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -122,7 +122,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -149,7 +149,7 @@ namespace CXX }; } - Void + void generate_stream_insertion_header (Context& ctx) { String c (ctx.char_type); diff --git a/xsd/cxx/tree/stream-insertion-header.hxx b/xsd/cxx/tree/stream-insertion-header.hxx index 23c5bb6..d224a13 100644 --- a/xsd/cxx/tree/stream-insertion-header.hxx +++ b/xsd/cxx/tree/stream-insertion-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_stream_insertion_header (Context&); } } diff --git a/xsd/cxx/tree/stream-insertion-source.cxx b/xsd/cxx/tree/stream-insertion-source.cxx index 2dbbc79..9c93060 100644 --- a/xsd/cxx/tree/stream-insertion-source.cxx +++ b/xsd/cxx/tree/stream-insertion-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -43,7 +43,7 @@ namespace CXX base += L" >"; - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_insertion ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -101,7 +101,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -114,7 +114,7 @@ namespace CXX String const& base (xs_string_type); - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_insertion ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -161,7 +161,7 @@ namespace CXX inherits_base_ >> base_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -172,13 +172,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); if (string_based) { SemanticGraph::Enumeration* base_enum (0); @@ -192,7 +192,7 @@ namespace CXX if (string_based) value = evalue (e); - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_insertion ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -253,7 +253,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) return; @@ -268,7 +268,7 @@ namespace CXX // from which makes it impossible to substitute or dynamically- // type with xsi:type. // - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); if (max (e) != 1) { @@ -363,7 +363,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& aname (eaname (a)); @@ -393,7 +393,7 @@ namespace CXX inherits_ >> base_; } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -404,9 +404,9 @@ namespace CXX if (renamed_type (c, name) && !name) return; - Boolean has_body (has<Traversal::Member> (c) || c.inherits_p ()); + bool has_body (has<Traversal::Member> (c) || c.inherits_p ()); - UnsignedLong n (0); + size_t n (0); NarrowStrings const& st (options.generate_insertion ()); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) @@ -471,7 +471,7 @@ namespace CXX }; } - Void + void generate_stream_insertion_source (Context& ctx) { if (ctx.polymorphic) @@ -481,8 +481,8 @@ namespace CXX ctx.os << "#include <xsd/cxx/tree/stream-insertion-map.hxx>" << endl << endl; - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { @@ -533,7 +533,7 @@ namespace CXX ctx.os << "namespace _xsd" << "{"; - UnsignedLong n (0); + size_t n (0); for (NarrowStrings::const_iterator i (st.begin ()); i != st.end (); ++i) { diff --git a/xsd/cxx/tree/stream-insertion-source.hxx b/xsd/cxx/tree/stream-insertion-source.hxx index fb61b43..22db93f 100644 --- a/xsd/cxx/tree/stream-insertion-source.hxx +++ b/xsd/cxx/tree/stream-insertion-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_stream_insertion_source (Context&); } } diff --git a/xsd/cxx/tree/stream-source.cxx b/xsd/cxx/tree/stream-source.cxx index e2c0ca5..77cfa81 100644 --- a/xsd/cxx/tree/stream-source.cxx +++ b/xsd/cxx/tree/stream-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -89,7 +89,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -135,7 +135,7 @@ namespace CXX inherits_base_ >> base_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -146,13 +146,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); if (string_based) { SemanticGraph::Enumeration* be (0); @@ -217,7 +217,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) @@ -232,7 +232,7 @@ namespace CXX // dynamically-type with xsi:type. // SemanticGraph::Type& t (e.type ()); - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); // aCC cannot handle an inline call to std_ostream_map_instance. // @@ -310,7 +310,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& aname (eaname (a)); @@ -340,7 +340,7 @@ namespace CXX inherits_ >> base_; } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -353,7 +353,7 @@ namespace CXX // // - Boolean has_body (has<Traversal::Member> (c) || c.inherits_p ()); + bool has_body (has<Traversal::Member> (c) || c.inherits_p ()); os << std_ostream_type << "&" << endl << "operator<< (" << std_ostream_type << "& o, " << @@ -408,10 +408,8 @@ namespace CXX }; } - Void - generate_stream_source (Context& ctx, - UnsignedLong first, - UnsignedLong last) + void + generate_stream_source (Context& ctx, size_t first, size_t last) { String c (ctx.char_type); @@ -423,8 +421,8 @@ namespace CXX ctx.os << "#include <xsd/cxx/tree/std-ostream-map.hxx>" << endl << endl; - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { diff --git a/xsd/cxx/tree/stream-source.hxx b/xsd/cxx/tree/stream-source.hxx index d45d5c3..06fc66e 100644 --- a/xsd/cxx/tree/stream-source.hxx +++ b/xsd/cxx/tree/stream-source.hxx @@ -12,10 +12,8 @@ namespace CXX { namespace Tree { - Void - generate_stream_source (Context&, - UnsignedLong first, - UnsignedLong last); + void + generate_stream_source (Context&, size_t first, size_t last); } } diff --git a/xsd/cxx/tree/tree-forward.cxx b/xsd/cxx/tree/tree-forward.cxx index 7f8f5ea..b3468ed 100644 --- a/xsd/cxx/tree/tree-forward.cxx +++ b/xsd/cxx/tree/tree-forward.cxx @@ -22,7 +22,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename (l)); @@ -52,7 +52,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename (u)); @@ -82,7 +82,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& name (ename (e)); @@ -112,7 +112,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { String const& name (ename (c)); @@ -136,7 +136,7 @@ namespace CXX }; } - Void + void generate_forward (Context& ctx) { NarrowString xml_schema (ctx.options.extern_xml_schema ()); @@ -178,7 +178,7 @@ namespace CXX << endl; } - Boolean element_map (ctx.options.generate_element_map ()); + bool element_map (ctx.options.generate_element_map ()); if (element_map) ctx.os << "#include <xsd/cxx/tree/element-map.hxx>" << endl diff --git a/xsd/cxx/tree/tree-forward.hxx b/xsd/cxx/tree/tree-forward.hxx index d542bf1..b0b131b 100644 --- a/xsd/cxx/tree/tree-forward.hxx +++ b/xsd/cxx/tree/tree-forward.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_forward (Context&); } } diff --git a/xsd/cxx/tree/tree-header.cxx b/xsd/cxx/tree/tree-header.cxx index 9d7aea5..4024bc3 100644 --- a/xsd/cxx/tree/tree-header.cxx +++ b/xsd/cxx/tree/tree-header.cxx @@ -25,7 +25,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -317,7 +317,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -551,7 +551,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (doxygen && e.annotated_p ()) @@ -579,7 +579,7 @@ namespace CXX names_ >> enumerator_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -590,13 +590,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); SemanticGraph::Enumeration* base_enum (0); if (string_based) @@ -614,7 +614,7 @@ namespace CXX // Get to the ultimate base and see if is a fundamental type. // - Boolean fund_based (false); + bool fund_based (false); SemanticGraph::Type& ult_base (ultimate_base (e)); { IsFundamentalType t (fund_based); @@ -623,7 +623,7 @@ namespace CXX // Count enumerators. // - UnsignedLong enum_count (0); + size_t enum_count (0); for (Type::NamesIterator i (e.names_begin ()), end (e.names_end ()); i != end; ++i) @@ -1032,7 +1032,7 @@ namespace CXX os << "};"; } - virtual Void + virtual void comma (Type&) { os << "," << endl; @@ -1059,7 +1059,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -1070,13 +1070,13 @@ namespace CXX String kind (m.is_a<SemanticGraph::Element> () ? "element" : "attribute"); - Boolean fund (false); + bool fund (false); { IsFundamentalType t (fund); t.dispatch (m.type ()); } - Boolean def_attr (m.default_p () && + bool def_attr (m.default_p () && m.is_a<SemanticGraph::Attribute> ()); if (max (m) != 1) @@ -1374,7 +1374,7 @@ namespace CXX // if (m.default_p ()) { - Boolean simple (true); + bool simple (true); if (m.is_a<SemanticGraph::Element> ()) { @@ -1384,7 +1384,7 @@ namespace CXX if (simple) { - Boolean lit (false); + bool lit (false); { IsLiteralValue test (lit); test.dispatch (m.type ()); @@ -1426,7 +1426,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& aname (eaname (a)); @@ -1699,7 +1699,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& aname (eaname (a)); @@ -1779,16 +1779,16 @@ namespace CXX belongs_ >> type_name_; } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) return; String const& type (etype (m)); - Boolean el (m.is_a<SemanticGraph::Element> ()); + bool el (m.is_a<SemanticGraph::Element> ()); - Boolean def_attr (m.default_p () && !el); + bool def_attr (m.default_p () && !el); if (doxygen) { @@ -1850,7 +1850,7 @@ namespace CXX if (max (m) != 1) { String const& container (econtainer (m)); - Boolean isense (options.generate_intellisense ()); + bool isense (options.generate_intellisense ()); // sequence // @@ -1968,7 +1968,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { if (doxygen) @@ -2070,7 +2070,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& container (econtainer (a)); @@ -2153,14 +2153,14 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) return; String const& member (emember (m)); - Boolean def_attr (m.default_p () && + bool def_attr (m.default_p () && m.is_a<SemanticGraph::Attribute> ()); if (max (m) != 1) @@ -2187,7 +2187,7 @@ namespace CXX // if (m.default_p ()) { - Boolean simple (true); + bool simple (true); if (m.is_a<SemanticGraph::Element> ()) { @@ -2197,7 +2197,7 @@ namespace CXX if (simple) { - Boolean lit (false); + bool lit (false); { IsLiteralValue test (lit); test.dispatch (m.type ()); @@ -2222,7 +2222,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -2247,7 +2247,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { os << econtainer (a) << " " << emember (a) << ";"; @@ -2278,7 +2278,7 @@ namespace CXX names_data_ >> data_any_; } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -2289,20 +2289,20 @@ namespace CXX if (renamed_type (c, name) && !name) return; - Boolean has_members (has<Traversal::Member> (c)); + bool has_members (has<Traversal::Member> (c)); - Boolean hae (has<Traversal::Any> (c)); - Boolean haa (has<Traversal::AnyAttribute> (c)); + bool hae (has<Traversal::Any> (c)); + bool haa (has<Traversal::AnyAttribute> (c)); - Boolean gen_wildcard (options.generate_wildcard ()); + bool gen_wildcard (options.generate_wildcard ()); - Boolean simple (true); + bool simple (true); { IsSimpleType t (simple); t.dispatch (c); } - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (c); @@ -2408,15 +2408,15 @@ namespace CXX << "//" << endl; } - Boolean generate_no_base_ctor (false); + bool generate_no_base_ctor (false); { GenerateWithoutBaseCtor t (generate_no_base_ctor); t.traverse (c); } - Boolean has_complex_non_op_args (false); - Boolean has_poly_non_op_args (false); - Boolean complex_poly_args_clash (true); + bool has_complex_non_op_args (false); + bool has_poly_non_op_args (false); + bool complex_poly_args_clash (true); { HasComplexPolyNonOptArgs t (*this, true, has_complex_non_op_args, @@ -2435,7 +2435,7 @@ namespace CXX // c-tor (all-non-optional-members) if we have no required // members. // - Boolean generate (false); + bool generate (false); { GenerateDefaultCtor t (*this, generate, generate_no_base_ctor); t.traverse (c); @@ -2471,7 +2471,7 @@ namespace CXX // customized version may not necessarily be convertible to // the base without loss of information. // - Boolean generate (false); + bool generate (false); { GenerateFromBaseCtor t (*this, generate); t.traverse (c); @@ -2479,9 +2479,9 @@ namespace CXX if (generate) { - Boolean has_complex_non_op_args (false); - Boolean has_poly_non_op_args (false); - Boolean complex_poly_args_clash (true); + bool has_complex_non_op_args (false); + bool has_poly_non_op_args (false); + bool complex_poly_args_clash (true); { HasComplexPolyNonOptArgs t (*this, false, has_complex_non_op_args, @@ -3147,7 +3147,7 @@ namespace CXX belongs_ >> type_name_; } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) @@ -3155,13 +3155,13 @@ namespace CXX SemanticGraph::Type& t (e.type ()); - Boolean fund (false); + bool fund (false); { IsFundamentalType test (fund); test.dispatch (t); } - Boolean simple (true); + bool simple (true); if (!fund) { IsSimpleType test (simple); @@ -3660,7 +3660,7 @@ namespace CXX }; } - Void + void generate_tree_header (Context& ctx) { if (ctx.generate_xml_schema) @@ -3691,7 +3691,7 @@ namespace CXX << endl; } - Boolean element_map (ctx.options.generate_element_map ()); + bool element_map (ctx.options.generate_element_map ()); if (element_map) ctx.os << "#include <xsd/cxx/tree/element-map.hxx>" << endl @@ -3800,7 +3800,7 @@ namespace CXX } else { - Boolean inline_ (ctx.options.generate_inline ()); + bool inline_ (ctx.options.generate_inline ()); ctx.os << "#include <memory> // std::auto_ptr" << endl << "#include <limits> // std::numeric_limits" << endl diff --git a/xsd/cxx/tree/tree-header.hxx b/xsd/cxx/tree/tree-header.hxx index 5d785f5..ec34603 100644 --- a/xsd/cxx/tree/tree-header.hxx +++ b/xsd/cxx/tree/tree-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Tree { - Void + void generate_tree_header (Context&); } } diff --git a/xsd/cxx/tree/tree-inline.cxx b/xsd/cxx/tree/tree-inline.cxx index 9656a2d..0641a4d 100644 --- a/xsd/cxx/tree/tree-inline.cxx +++ b/xsd/cxx/tree/tree-inline.cxx @@ -22,7 +22,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -106,7 +106,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -182,7 +182,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { // This type should be ultimately string based. @@ -196,7 +196,7 @@ namespace CXX os << ")"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Type& t) { base_type_name_.dispatch (t); @@ -217,7 +217,7 @@ namespace CXX inherits_member_ >> member_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -228,13 +228,13 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } - Boolean enum_based (false); + bool enum_based (false); if (string_based) { SemanticGraph::Enumeration* be (0); @@ -250,7 +250,7 @@ namespace CXX // Get to the ultimate base and see if is a fundamental type. // - Boolean fund_based (false); + bool fund_based (false); SemanticGraph::Type& ult_base (ultimate_base (e)); { IsFundamentalType t (fund_based); @@ -427,7 +427,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -437,13 +437,13 @@ namespace CXX String const& mname (emname (m)); String const& member (emember (m)); - Boolean fund (false); + bool fund (false); { IsFundamentalType t (fund); t.dispatch (m.type ()); } - Boolean def_attr (m.default_p () && + bool def_attr (m.default_p () && m.is_a<SemanticGraph::Attribute> ()); if (max (m) != 1) @@ -613,7 +613,7 @@ namespace CXX // if (m.default_p ()) { - Boolean simple (true); + bool simple (true); if (m.is_a<SemanticGraph::Element> ()) { @@ -660,7 +660,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& aname (eaname (a)); @@ -810,7 +810,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& aname (eaname (a)); @@ -862,7 +862,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -924,13 +924,13 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (!doc_root_p (e)) return; - Boolean fund (false); + bool fund (false); { IsFundamentalType test (fund); test.dispatch (e.type ()); @@ -1007,8 +1007,8 @@ namespace CXX }; } - Void - generate_tree_inline (Context& ctx, UnsignedLong first, UnsignedLong last) + void + generate_tree_inline (Context& ctx, size_t first, size_t last) { // Generate includes. // diff --git a/xsd/cxx/tree/tree-inline.hxx b/xsd/cxx/tree/tree-inline.hxx index 7293102..9ea352e 100644 --- a/xsd/cxx/tree/tree-inline.hxx +++ b/xsd/cxx/tree/tree-inline.hxx @@ -12,8 +12,8 @@ namespace CXX { namespace Tree { - Void - generate_tree_inline (Context&, UnsignedLong first, UnsignedLong last); + void + generate_tree_inline (Context&, size_t first, size_t last); } } diff --git a/xsd/cxx/tree/tree-source.cxx b/xsd/cxx/tree/tree-source.cxx index 45628cf..fb4be66 100644 --- a/xsd/cxx/tree/tree-source.cxx +++ b/xsd/cxx/tree/tree-source.cxx @@ -3,7 +3,8 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include <cult/containers/list.hxx> +#include <map> +#include <list> #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> @@ -11,6 +12,8 @@ #include <cxx/tree/tree-source.hxx> #include <cxx/tree/default-value.hxx> +using namespace std; + namespace CXX { namespace Tree @@ -24,7 +27,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String name (ename (l)); @@ -158,7 +161,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String name (ename (u)); @@ -264,7 +267,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { os << strlit (e.name ()); @@ -285,13 +288,13 @@ namespace CXX String name_; }; - Boolean + bool operator< (LiteralInfo const& x, LiteralInfo const& y) { return x.value_ < y.value_; } - typedef Cult::Containers::List<LiteralInfo> LiteralInfoList; + typedef list<LiteralInfo> LiteralInfoList; // Populate LiteralInfoList @@ -304,7 +307,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { list_.push_back (LiteralInfo (e.name (), ename (e))); @@ -323,7 +326,7 @@ namespace CXX names_enumerator_literal_ >> enumerator_literal_; } - virtual Void + virtual void traverse (Type& e) { String name (ename (e)); @@ -334,14 +337,14 @@ namespace CXX if (renamed_type (e, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (e); } SemanticGraph::Enumeration* be (0); - Boolean enum_based (false); + bool enum_based (false); if (string_based) { IsEnumBasedType t (be); @@ -354,7 +357,7 @@ namespace CXX if (string_based) value = evalue (e); - UnsignedLong enum_count (0); + size_t enum_count (0); for (Type::NamesIterator i (e.names_begin ()), end (e.names_end ()); i != end; ++i) @@ -506,7 +509,7 @@ namespace CXX String fq_name (ns_scope + L"::" + name); - for (LiteralInfoList::Iterator + for (LiteralInfoList::iterator b (l.begin ()), i (b), end (l.end ()); i != end; ++i) { if (i != b) @@ -552,7 +555,7 @@ namespace CXX } } - virtual Void + virtual void comma (Type&) { os << "," << endl; @@ -573,7 +576,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -584,7 +587,7 @@ namespace CXX if (m.default_p ()) { SemanticGraph::Type& t (m.type ()); - Boolean simple (true); + bool simple (true); if (m.is_a<SemanticGraph::Element> ()) { @@ -594,7 +597,7 @@ namespace CXX if (simple) { - Boolean lit (false); + bool lit (false); { IsLiteralValue test (lit); test.dispatch (t); @@ -685,7 +688,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) @@ -698,7 +701,7 @@ namespace CXX SemanticGraph::Type& t (e.type ()); - Boolean fund (false); + bool fund (false); { IsFundamentalType traverser (fund); traverser.dispatch (t); @@ -710,7 +713,7 @@ namespace CXX // derived from which makes it impossible to substitute or // dynamically-type with xsi:type. // - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); os << "// " << comment (e.name ()) << endl << "//" << endl; @@ -887,7 +890,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) @@ -917,7 +920,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& member (emember (a)); @@ -1054,7 +1057,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { if (max (a) == 1 && min (a) == 1) @@ -1079,7 +1082,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& member (emember (a)); @@ -1099,7 +1102,7 @@ namespace CXX << "{"; } - Boolean fund (false); + bool fund (false); { IsFundamentalType traverser (fund); traverser.dispatch (a.type ()); @@ -1133,7 +1136,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& member (emember (a)); @@ -1226,7 +1229,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& member (emember (a)); @@ -1270,21 +1273,21 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type&) { if (base_arg_) os << base_arg_; } - virtual Void + virtual void traverse (SemanticGraph::Enumeration&) { if (base_arg_) os << base_arg_; } - Void + void traverse (SemanticGraph::Complex& c) { Args args (*this, base_arg_); @@ -1310,21 +1313,21 @@ namespace CXX *this >> names_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Type&) { if (base_arg_) os << comma () << base_arg_; } - virtual Void + virtual void traverse (SemanticGraph::Enumeration&) { if (base_arg_) os << comma () << base_arg_; } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { if (!options.generate_wildcard ()) @@ -1338,7 +1341,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (!skip (e) && min (e) == 1 && max (e) == 1) @@ -1349,7 +1352,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { // Note that we are not including attributes with default @@ -1369,14 +1372,14 @@ namespace CXX String comma () { - Boolean tmp (first_); + bool tmp (first_); first_ = false; return tmp ? "" : ",\n"; } private: String base_arg_; - Boolean first_; + bool first_; Traversal::Inherits inherits_; Traversal::Names names_; @@ -1395,7 +1398,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -1426,12 +1429,12 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { String const& member (emember (a)); - Boolean def (a.default_p ()); + bool def (a.default_p ()); if (min (a) == 0 && !def) { @@ -1472,7 +1475,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -1504,7 +1507,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& dom_doc ( @@ -1524,7 +1527,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (skip (m)) @@ -1550,7 +1553,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -1563,7 +1566,7 @@ namespace CXX arg_name << "." << member << ", this->" << dom_doc << " ())"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& member (emember (a)); @@ -1587,7 +1590,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (skip (m)) @@ -1607,14 +1610,14 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); os << "this->" << member << " = x." << member << ";"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& member (emember (a)); @@ -1632,7 +1635,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -1654,7 +1657,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -1666,7 +1669,7 @@ namespace CXX << " " << member << " (this->" << dom_doc << " ())"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& member (emember (a)); @@ -1691,7 +1694,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -1703,7 +1706,7 @@ namespace CXX << " " << member << " (this)"; } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { String const& member (emember (a)); @@ -1732,7 +1735,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& member (emember (a)); @@ -1744,7 +1747,7 @@ namespace CXX << " " << member << " (this->" << dom_doc << " ())"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& member (emember (a)); @@ -1771,39 +1774,39 @@ namespace CXX { // generate should initially be false. // - HasComparisonOperator (Context& c, Boolean& generate) + HasComparisonOperator (Context& c, bool& generate) : Context (c), generate_ (generate) { *this >> inherits_ >> *this; *this >> names_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Type&) { // All built-in types are comparable. generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::List&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Union&) { generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { Traversal::Enumeration::inherits (e); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { Complex::names (c); @@ -1812,21 +1815,21 @@ namespace CXX Complex::inherits (c); } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (!skip (m)) generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Any&) { if (options.generate_wildcard ()) generate_ = true; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute&) { if (options.generate_wildcard ()) @@ -1834,7 +1837,7 @@ namespace CXX } private: - Boolean& generate_; + bool& generate_; Traversal::Inherits inherits_; Traversal::Names names_; @@ -1851,7 +1854,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) @@ -1866,7 +1869,7 @@ namespace CXX // dynamically-type with xsi:type. // SemanticGraph::Type& t (e.type ()); - Boolean poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); + bool poly (polymorphic && polymorphic_p (t) && !anonymous_p (t)); if (!poly) { @@ -1942,7 +1945,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { String const& aname (eaname (a)); @@ -1962,7 +1965,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& aname (eaname (a)); @@ -1978,7 +1981,7 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& aname (eaname (a)); @@ -1999,14 +2002,14 @@ namespace CXX Traversal::AnyAttribute, Context { - HasParseFunction (Context& c, Boolean& has_el, Boolean& has_at) + HasParseFunction (Context& c, bool& has_el, bool& has_at) : Context (c), has_el_ (has_el), has_at_ (has_at) { *this >> names_ >> *this; *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { names (c); @@ -2015,25 +2018,25 @@ namespace CXX inherits (c); } - virtual Void + virtual void traverse (SemanticGraph::Element&) { has_el_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Any&) { has_el_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Attribute&) { has_at_ = true; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute&) { if (options.generate_wildcard ()) @@ -2041,8 +2044,8 @@ namespace CXX } private: - Boolean& has_el_; - Boolean& has_at_; + bool& has_el_; + bool& has_at_; Traversal::Names names_; Traversal::Inherits inherits_; @@ -2057,14 +2060,14 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { Facets f; FacetCollector col (f); col.traverse (c); - for (Facets::ConstIterator i (f.begin ()); i != f.end (); ++i) + for (Facets::const_iterator i (f.begin ()); i != f.end (); ++i) { if (i->first == L"fractionDigits") os << "{::xsd::cxx::tree::facet::fraction_digits, " << @@ -2076,7 +2079,7 @@ namespace CXX } private: - typedef Cult::Containers::Map<String, String> Facets; + typedef map<String, String> Facets; struct FacetCollector: Traversal::Complex { @@ -2086,7 +2089,7 @@ namespace CXX *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (Type& c) { if (c.inherits_p ()) @@ -2148,7 +2151,7 @@ namespace CXX comparison_member_ (c), facet_array_ (c) { - Boolean gen_wildcard (options.generate_wildcard ()); + bool gen_wildcard (options.generate_wildcard ()); inherits_member_ >> member_name_; @@ -2186,7 +2189,7 @@ namespace CXX } - virtual Void + virtual void traverse (Type& c) { String name (ename (c)); @@ -2197,7 +2200,7 @@ namespace CXX if (renamed_type (c, name) && !name) return; - Boolean string_based (false); + bool string_based (false); { IsStringBasedType t (string_based); t.dispatch (c); @@ -2209,7 +2212,7 @@ namespace CXX t.dispatch (c); } - Boolean facets (false); + bool facets (false); String base; // base type name if (c.inherits_p ()) { @@ -2272,15 +2275,15 @@ namespace CXX // c-tors // - Boolean generate_no_base_ctor (false); + bool generate_no_base_ctor (false); { GenerateWithoutBaseCtor t (generate_no_base_ctor); t.traverse (c); } - Boolean has_complex_non_op_args (false); - Boolean has_poly_non_op_args (false); - Boolean complex_poly_args_clash (true); + bool has_complex_non_op_args (false); + bool has_poly_non_op_args (false); + bool complex_poly_args_clash (true); { HasComplexPolyNonOptArgs t (*this, true, has_complex_non_op_args, @@ -2293,7 +2296,7 @@ namespace CXX // if (options.generate_default_ctor ()) { - Boolean generate (false); + bool generate (false); { GenerateDefaultCtor t (*this, generate, generate_no_base_ctor); t.traverse (c); @@ -2326,7 +2329,7 @@ namespace CXX // if (options.generate_from_base_ctor ()) { - Boolean generate (false); + bool generate (false); { GenerateFromBaseCtor t (*this, generate); t.traverse (c); @@ -2334,9 +2337,9 @@ namespace CXX if (generate) { - Boolean has_complex_non_op_args (false); - Boolean has_poly_non_op_args (false); - Boolean complex_poly_args_clash (true); + bool has_complex_non_op_args (false); + bool has_poly_non_op_args (false); + bool complex_poly_args_clash (true); { HasComplexPolyNonOptArgs t (*this, false, has_complex_non_op_args, @@ -2856,13 +2859,13 @@ namespace CXX // // - Boolean he (has<Traversal::Element> (c)); - Boolean hae (has<Traversal::Any> (c)); + bool he (has<Traversal::Element> (c)); + bool hae (has<Traversal::Any> (c)); - Boolean ha (has<Traversal::Attribute> (c)); - Boolean haa (has<Traversal::AnyAttribute> (c)); + bool ha (has<Traversal::Attribute> (c)); + bool haa (has<Traversal::AnyAttribute> (c)); - Boolean gen_wildcard (options.generate_wildcard ()); + bool gen_wildcard (options.generate_wildcard ()); // // @@ -2897,7 +2900,7 @@ namespace CXX os << "this->_facet_table (_xsd_" << name << "_facet_table);" << endl; - Boolean base_has_el (false), base_has_at (false); + bool base_has_el (false), base_has_at (false); // We are only interested in this information if we are // generating out own parse(). @@ -2925,7 +2928,7 @@ namespace CXX os << "}"; - Boolean simple (true); + bool simple (true); { IsSimpleType t (simple); t.dispatch (c); @@ -3118,7 +3121,7 @@ namespace CXX (he || ha || !c.inherits_p () || ((hae || haa) && gen_wildcard))) { - Boolean base_comp (false); + bool base_comp (false); if (c.inherits_p ()) { @@ -3126,7 +3129,7 @@ namespace CXX test.dispatch (c.inherits ().base ()); } - Boolean has_body (he || ha || base_comp || + bool has_body (he || ha || base_comp || ((hae || haa) && gen_wildcard)); os << "bool" << endl @@ -3219,20 +3222,20 @@ namespace CXX belongs_ >> type_name_; } - virtual Void + virtual void traverse (Type& e) { if (element_type_ && doc_root_p (e)) { SemanticGraph::Type& t (e.type ()); - Boolean fund (false); + bool fund (false); { IsFundamentalType test (fund); test.dispatch (t); } - Boolean simple (true); + bool simple (true); if (!fund) { IsSimpleType test (simple); @@ -3308,7 +3311,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.suppress_parsing ()); + bool parsing (!options.suppress_parsing ()); if (parsing) { String const& tr (etraits (e)); @@ -3432,17 +3435,15 @@ namespace CXX } private: - Boolean element_type_; - Boolean element_map_; + bool element_type_; + bool element_map_; Traversal::Belongs belongs_; MemberTypeName type_name_; }; } - Void - generate_tree_source (Context& ctx, - UnsignedLong first, - UnsignedLong last) + void + generate_tree_source (Context& ctx, size_t first, size_t last) { if (ctx.options.generate_wildcard ()) { @@ -3456,8 +3457,8 @@ namespace CXX if (ctx.polymorphic) { - Boolean parsing (!ctx.options.suppress_parsing ()); - Boolean comparison (ctx.options.generate_comparison ()); + bool parsing (!ctx.options.suppress_parsing ()); + bool comparison (ctx.options.generate_comparison ()); if (parsing) ctx.os << "#include <xsd/cxx/tree/type-factory-map.hxx>" << endl @@ -3469,8 +3470,8 @@ namespace CXX if (parsing || comparison) { - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { diff --git a/xsd/cxx/tree/tree-source.hxx b/xsd/cxx/tree/tree-source.hxx index 8983687..221bd5f 100644 --- a/xsd/cxx/tree/tree-source.hxx +++ b/xsd/cxx/tree/tree-source.hxx @@ -12,8 +12,8 @@ namespace CXX { namespace Tree { - Void - generate_tree_source (Context&, UnsignedLong first, UnsignedLong last); + void + generate_tree_source (Context&, size_t first, size_t last); } } 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 <cxx/tree/validator.hxx> +#include <set> +#include <iostream> -#include <cult/containers/set.hxx> +#include <cxx/tree/validator.hxx> #include <xsd-frontend/semantic-graph.hxx> #include <xsd-frontend/traversal.hxx> #include <cxx/tree/elements.hxx> -#include <iostream> - -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<String> types_; + set<String> 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<String> types_; + set<String> 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 ()) { diff --git a/xsd/cxx/tree/validator.hxx b/xsd/cxx/tree/validator.hxx index ad156ff..f79adcb 100644 --- a/xsd/cxx/tree/validator.hxx +++ b/xsd/cxx/tree/validator.hxx @@ -20,7 +20,7 @@ namespace CXX public: Validator (); // Dummy ctor, helps with long symbols on HP-UX. - Boolean + bool validate (options const&, SemanticGraph::Schema&, SemanticGraph::Path const& tu, |