aboutsummaryrefslogtreecommitdiff
path: root/xsd/type-map
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-22 11:50:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-22 11:50:03 +0200
commit54110801525371740298d5cae378bfc778749935 (patch)
treef0f125135b2a1bcf1eea49a559b49d00ea25d879 /xsd/type-map
parent3f4a7a6b2a3b708ea69b980494f6e49eb0c02ebc (diff)
Get rid of dependency on libcult
Diffstat (limited to 'xsd/type-map')
-rw-r--r--xsd/type-map/lexer.cxx2
-rw-r--r--xsd/type-map/lexer.hxx16
-rw-r--r--xsd/type-map/parser.cxx10
-rw-r--r--xsd/type-map/parser.hxx13
-rw-r--r--xsd/type-map/type-map.hxx29
5 files changed, 31 insertions, 39 deletions
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"<end-of-stream>", 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 <locale>
#include <iosfwd>
-#include <cult/types.hxx>
+#include <types.hxx>
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 <cult/types.hxx>
+#include <types.hxx>
#include <type-map/type-map.hxx>
#include <type-map/lexer.hxx>
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 <vector>
+
#include <cutl/re.hxx>
-#include <cult/types.hxx>
-#include <cult/containers/vector.hxx>
+#include <types.hxx>
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<String> Includes;
- typedef Includes::ConstIterator IncludesIterator;
+ typedef std::vector<String> 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<Type> Types;
- typedef Types::ConstIterator TypesIterator;
+ typedef std::vector<Type> 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<Namespace> Namespaces;
+ typedef std::vector<Namespace> Namespaces;
}
#endif // XSD_TYPE_MAP_TYPE_MAP_HXX