diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-09 11:52:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-05-09 11:52:59 +0200 |
commit | 713324411804114f2699c6c127c659345d7359d5 (patch) | |
tree | 614357de1a6607d864faf5df5a4b7e085e08fc03 /xsde/type-map | |
parent | 1061c7c0ac3e6e9f6de93a9d8c68ce5d7a40c7ed (diff) |
Port to use regex from libcutl instead of libbackend-elements
Diffstat (limited to 'xsde/type-map')
-rw-r--r-- | xsde/type-map/parser.cxx | 8 | ||||
-rw-r--r-- | xsde/type-map/type-map.hxx | 29 |
2 files changed, 29 insertions, 8 deletions
diff --git a/xsde/type-map/parser.cxx b/xsde/type-map/parser.cxx index 929c3d3..16bb7ec 100644 --- a/xsde/type-map/parser.cxx +++ b/xsde/type-map/parser.cxx @@ -5,7 +5,7 @@ #include <iostream> -#include <backend-elements/regex.hxx> +#include <cutl/re.hxx> #include <type-map/parser.hxx> @@ -14,7 +14,7 @@ using std::endl; namespace TypeMap { typedef Lexer::Token Token; - typedef BackendElements::Regex::Format<WideChar> Format; + typedef cutl::re::wformat Format; Parser::Parser (Lexer& lex, String const& path) : lex_ (lex), path_ (path), e (std::wcerr) @@ -99,7 +99,7 @@ namespace TypeMap catch (Format const& ex) { e << path_ << ":" << t.line () << ": invalid namespace pattern: " - << ex.description () << endl; + << ex.description ().c_str () << endl; return false; } @@ -234,7 +234,7 @@ namespace TypeMap catch (Format const& ex) { e << path_ << ":" << t.line () << ": invalid namespace pattern: " - << ex.description () << endl; + << ex.description ().c_str () << endl; return false; } diff --git a/xsde/type-map/type-map.hxx b/xsde/type-map/type-map.hxx index 459b64a..3218c5e 100644 --- a/xsde/type-map/type-map.hxx +++ b/xsde/type-map/type-map.hxx @@ -6,20 +6,29 @@ #ifndef XSDE_TYPE_MAP_TYPE_MAP_HXX #define XSDE_TYPE_MAP_TYPE_MAP_HXX +#include <cutl/re.hxx> + #include <cult/types.hxx> #include <cult/containers/vector.hxx> -#include <backend-elements/regex.hxx> - namespace TypeMap { using namespace Cult::Types; typedef WideString String; - typedef BackendElements::Regex::Pattern<WideChar> Pattern; + typedef cutl::re::wregex Pattern; class Type { public: + Type (String const& xsd_name, + String const& cxx_ret_name, + String const& cxx_arg_name) + : xsd_name_ (xsd_name), + cxx_ret_name_ (cxx_ret_name), + cxx_arg_name_ (cxx_arg_name) + { + } + Type (Pattern const& xsd_name, String const& cxx_ret_name, String const& cxx_arg_name) @@ -56,6 +65,11 @@ namespace TypeMap class Namespace { public: + Namespace (String const& xsd_name) + : xsd_name_ (xsd_name), has_cxx_name_ (false) + { + } + Namespace (Pattern const& xsd_name) : xsd_name_ (xsd_name), has_cxx_name_ (false) { @@ -116,6 +130,14 @@ namespace TypeMap } Void + types_push_back (String const& xsd_type, + String const& cxx_ret_type, + String const& cxx_arg_type = L"") + { + types_.push_back (Type (xsd_type, cxx_ret_type, cxx_arg_type)); + } + + Void types_push_back (Pattern const& xsd_type, String const& cxx_ret_type, String const& cxx_arg_type = L"") @@ -157,4 +179,3 @@ namespace TypeMap } #endif // XSDE_TYPE_MAP_TYPE_MAP_HXX - |