From 54110801525371740298d5cae378bfc778749935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 11:50:03 +0200 Subject: Get rid of dependency on libcult --- xsd/type-map/lexer.cxx | 2 +- xsd/type-map/lexer.hxx | 16 ++++++---------- xsd/type-map/parser.cxx | 10 +++++----- xsd/type-map/parser.hxx | 13 +++++-------- xsd/type-map/type-map.hxx | 29 ++++++++++++++--------------- 5 files changed, 31 insertions(+), 39 deletions(-) (limited to 'xsd/type-map') diff --git a/xsd/type-map/lexer.cxx b/xsd/type-map/lexer.cxx index 6e1f34a..b8ea0e7 100644 --- a/xsd/type-map/lexer.cxx +++ b/xsd/type-map/lexer.cxx @@ -68,7 +68,7 @@ namespace TypeMap if (is_.eof ()) return Token (Token::eos, L"", line_); - Boolean quote (c == '"'); + bool quote (c == '"'); if (!quote) lexeme += c; diff --git a/xsd/type-map/lexer.hxx b/xsd/type-map/lexer.hxx index 762b67c..012533a 100644 --- a/xsd/type-map/lexer.hxx +++ b/xsd/type-map/lexer.hxx @@ -9,13 +9,10 @@ #include #include -#include +#include namespace TypeMap { - using namespace Cult::Types; - typedef WideString String; - class Lexer { public: @@ -29,7 +26,7 @@ namespace TypeMap eos }; - Token (Type type, String const& lexeme, UnsignedLong line) + Token (Type type, String const& lexeme, size_t line) : type_ (type), lexeme_ (lexeme), line_ (line) { } @@ -46,7 +43,7 @@ namespace TypeMap return lexeme_; } - UnsignedLong + size_t line () const { return line_; @@ -55,7 +52,7 @@ namespace TypeMap private: Type type_; String lexeme_; - UnsignedLong line_; + size_t line_; }; Lexer (std::istream&, String const& path); @@ -69,12 +66,11 @@ namespace TypeMap std::locale locale_; std::istream& is_; String path_; - UnsignedLong line_; + size_t line_; String held_lexeme_; - Boolean comment_; + bool comment_; }; } #endif // XSD_TYPE_MAP_LEXER_HXX - diff --git a/xsd/type-map/parser.cxx b/xsd/type-map/parser.cxx index 5bc2ffc..7d44543 100644 --- a/xsd/type-map/parser.cxx +++ b/xsd/type-map/parser.cxx @@ -21,7 +21,7 @@ namespace TypeMap { } - Boolean Parser:: + bool Parser:: parse (Namespaces& ns) { try @@ -83,7 +83,7 @@ namespace TypeMap return true; } - Boolean Parser:: + bool Parser:: namespace_ (Namespaces& ns) { // First get XML namespace. @@ -115,7 +115,7 @@ namespace TypeMap // t = lex_.next (); - Boolean has_cxx_name (false); + bool has_cxx_name (false); String cxx_name; if (t.type () != Token::token) @@ -191,7 +191,7 @@ namespace TypeMap return true; } - Boolean Parser:: + bool Parser:: include (Namespace& n) { Token t (lex_.next ()); @@ -222,7 +222,7 @@ namespace TypeMap return true; } - Boolean Parser:: + bool Parser:: type (Token t, Namespace& n) { Pattern xsd_name; diff --git a/xsd/type-map/parser.hxx b/xsd/type-map/parser.hxx index 603ffc8..375b824 100644 --- a/xsd/type-map/parser.hxx +++ b/xsd/type-map/parser.hxx @@ -6,16 +6,13 @@ #ifndef XSD_TYPE_MAP_PARSER_HXX #define XSD_TYPE_MAP_PARSER_HXX -#include +#include #include #include namespace TypeMap { - using namespace Cult::Types; - typedef WideString String; - class Parser { public: @@ -23,17 +20,17 @@ namespace TypeMap // Merge parsed namespaces. // - Boolean + bool parse (Namespaces&); private: - Boolean + bool namespace_ (Namespaces&); - Boolean + bool include (Namespace&); - Boolean + bool type (Lexer::Token, Namespace&); private: diff --git a/xsd/type-map/type-map.hxx b/xsd/type-map/type-map.hxx index e5715dd..2fda512 100644 --- a/xsd/type-map/type-map.hxx +++ b/xsd/type-map/type-map.hxx @@ -6,15 +6,14 @@ #ifndef XSD_TYPE_MAP_TYPE_MAP_HXX #define XSD_TYPE_MAP_TYPE_MAP_HXX +#include + #include -#include -#include +#include namespace TypeMap { - using namespace Cult::Types; - typedef WideString String; typedef cutl::re::wregex Pattern; class Type @@ -81,7 +80,7 @@ namespace TypeMap } Namespace (Pattern const& xsd_name, - Boolean has_cxx_name, + bool has_cxx_name, String const& cxx_name) : xsd_name_ (xsd_name), has_cxx_name_ (has_cxx_name), @@ -91,8 +90,8 @@ namespace TypeMap // // - typedef Cult::Containers::Vector Includes; - typedef Includes::ConstIterator IncludesIterator; + typedef std::vector Includes; + typedef Includes::const_iterator IncludesIterator; IncludesIterator includes_begin () const @@ -106,7 +105,7 @@ namespace TypeMap return includes_.end (); } - Void + void includes_push_back (String const& i) { includes_.push_back (i); @@ -114,8 +113,8 @@ namespace TypeMap // // - typedef Cult::Containers::Vector Types; - typedef Types::ConstIterator TypesIterator; + typedef std::vector Types; + typedef Types::const_iterator TypesIterator; TypesIterator types_begin () const @@ -129,7 +128,7 @@ namespace TypeMap return types_.end (); } - Void + void types_push_back (String const& xsd_type, String const& cxx_ret_type, String const& cxx_arg_type = L"") @@ -137,7 +136,7 @@ namespace TypeMap types_.push_back (Type (xsd_type, cxx_ret_type, cxx_arg_type)); } - Void + void types_push_back (Pattern const& xsd_type, String const& cxx_ret_type, String const& cxx_arg_type = L"") @@ -155,7 +154,7 @@ namespace TypeMap // // - Boolean + bool has_cxx_name () const { return has_cxx_name_; @@ -171,11 +170,11 @@ namespace TypeMap Includes includes_; Types types_; Pattern xsd_name_; - Boolean has_cxx_name_; + bool has_cxx_name_; String cxx_name_; }; - typedef Cult::Containers::Vector Namespaces; + typedef std::vector Namespaces; } #endif // XSD_TYPE_MAP_TYPE_MAP_HXX -- cgit v1.1