summaryrefslogtreecommitdiff
path: root/odb/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-07-22 14:33:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-07-22 14:33:21 +0200
commitcea6fb57ac8c9a893c0f404fef6c1469f0b6222b (patch)
treefed8b6ffa8ea2cb6347ece69c0cb81003d0ccbf6 /odb/context.hxx
parent5f71c55a1c24c23af1eeb0d664922497a0e5c071 (diff)
Next chunk of functionality
Add SQL language lexer. Implement MySQL type declaration parser. Create sub-directories for databases, currently mysql and tracer. Create MySQL-specific context.
Diffstat (limited to 'odb/context.hxx')
-rw-r--r--odb/context.hxx33
1 files changed, 27 insertions, 6 deletions
diff --git a/odb/context.hxx b/odb/context.hxx
index 700e604..9f5723a 100644
--- a/odb/context.hxx
+++ b/odb/context.hxx
@@ -42,7 +42,7 @@ public:
column_name (semantics::data_member&) const;
string
- db_type (semantics::data_member&) const;
+ column_type (semantics::data_member&) const;
public:
// Escape C++ keywords, reserved names, and illegal characters.
@@ -50,9 +50,10 @@ public:
string
escape (string const&) const;
-private:
+protected:
struct data;
- cutl::shared_ptr<data> data_;
+ typedef cutl::shared_ptr<data> data_ptr;
+ data_ptr data_;
public:
std::ostream& os;
@@ -62,19 +63,39 @@ public:
typedef std::set<string> keyword_set_type;
keyword_set_type const& keyword_set;
- typedef std::map<string, string> type_map_type;
+ struct db_type_type
+ {
+ db_type_type () {}
+ db_type_type (string const& t, string const& it)
+ : type (t), id_type (it)
+ {
+ }
+
+ string type;
+ string id_type;
+ };
-private:
+ typedef std::map<string, db_type_type> type_map_type;
+
+protected:
struct data
{
+ virtual ~data () {}
+
keyword_set_type keyword_set_;
type_map_type type_map_;
};
public:
- context (std::ostream&, semantics::unit&, options_type const&);
+ context (std::ostream&,
+ semantics::unit&,
+ options_type const&,
+ data_ptr = data_ptr ());
context (context&);
+ virtual
+ ~context ();
+
private:
context&
operator= (context const&);