summaryrefslogtreecommitdiff
path: root/xsd/xsd/type-map/type-map.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/xsd/type-map/type-map.hxx')
-rw-r--r--xsd/xsd/type-map/type-map.hxx57
1 files changed, 38 insertions, 19 deletions
diff --git a/xsd/xsd/type-map/type-map.hxx b/xsd/xsd/type-map/type-map.hxx
index 34ceefa..cdb8a0c 100644
--- a/xsd/xsd/type-map/type-map.hxx
+++ b/xsd/xsd/type-map/type-map.hxx
@@ -1,25 +1,32 @@
// file : xsd/type-map/type-map.hxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2007-2010 Code Synthesis Tools CC
+// copyright : Copyright (c) 2007-2014 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSD_TYPE_MAP_TYPE_MAP_HXX
#define XSD_TYPE_MAP_TYPE_MAP_HXX
-#include <cult/types.hxx>
-#include <cult/containers/vector.hxx>
+#include <vector>
-#include <backend-elements/regex.hxx>
+#include <cutl/re.hxx>
+
+#include <types.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 +63,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)
{
@@ -67,7 +79,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),
@@ -77,8 +89,8 @@ namespace TypeMap
//
//
- typedef Cult::Containers::Vector<String> Includes;
- typedef Includes::ConstIterator IncludesIterator;
+ typedef std::vector<String> Includes;
+ typedef Includes::const_iterator IncludesIterator;
IncludesIterator
includes_begin () const
@@ -92,7 +104,7 @@ namespace TypeMap
return includes_.end ();
}
- Void
+ void
includes_push_back (String const& i)
{
includes_.push_back (i);
@@ -100,8 +112,8 @@ namespace TypeMap
//
//
- typedef Cult::Containers::Vector<Type> Types;
- typedef Types::ConstIterator TypesIterator;
+ typedef std::vector<Type> Types;
+ typedef Types::const_iterator TypesIterator;
TypesIterator
types_begin () const
@@ -115,7 +127,15 @@ 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"")
+ {
+ 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"")
@@ -133,7 +153,7 @@ namespace TypeMap
//
//
- Boolean
+ bool
has_cxx_name () const
{
return has_cxx_name_;
@@ -149,12 +169,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<Namespace> Namespaces;
+ typedef std::vector<Namespace> Namespaces;
}
#endif // XSD_TYPE_MAP_TYPE_MAP_HXX
-