~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.h

  • Committer: Olaf van der Spek
  • Date: 2011-04-05 12:26:58 UTC
  • mto: (2278.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2272.
  • Revision ID: olafvdspek@gmail.com-20110405122658-xxrvmobwwwwf3oct
Refactor Open_tables_state

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
  This will replace Table_ident.
30
30
  */
31
31
 
32
 
 
33
 
 
34
 
#ifndef DRIZZLED_IDENTIFIER_SCHEMA_H
35
 
#define DRIZZLED_IDENTIFIER_SCHEMA_H
36
 
 
37
 
#include <drizzled/enum.h>
38
 
#include <drizzled/definitions.h>
39
 
#include <drizzled/message/table.pb.h>
40
 
#include <drizzled/catalog/local.h>
41
 
#include <string.h>
42
 
 
43
 
#include <assert.h>
44
 
 
 
32
#pragma once
 
33
 
 
34
#include <boost/algorithm/string.hpp>
45
35
#include <ostream>
46
 
#include <list>
47
 
#include <algorithm>
48
 
#include <functional>
49
 
#include <iostream>
50
 
 
51
 
#include <boost/algorithm/string.hpp>
52
 
 
53
 
#include <drizzled/visibility.h>
54
36
 
55
37
namespace drizzled {
56
38
namespace identifier {
61
43
  std::string db_path;
62
44
 
63
45
public:
64
 
  typedef std::vector <Schema> vector;
65
 
  typedef const Schema& const_reference;
66
 
 
67
46
  Schema(const std::string &db_arg);
68
47
 
69
 
  virtual ~Schema()
70
 
  { }
71
 
 
72
 
  virtual void getSQLPath(std::string &arg) const;
 
48
  virtual std::string getSQLPath() const
 
49
        {
 
50
                return db;
 
51
        }
73
52
 
74
53
  const std::string &getPath() const;
75
54
 
88
67
  }
89
68
 
90
69
  bool compare(const std::string &arg) const;
91
 
  bool compare(Schema::const_reference) const;
 
70
  bool compare(const Schema&) const;
92
71
 
93
 
  friend bool operator<(Schema::const_reference left, Schema::const_reference right)
 
72
  friend bool operator<(const Schema& left, const Schema& right)
94
73
  {
95
 
    return  boost::algorithm::to_upper_copy(left.getSchemaName()) < boost::algorithm::to_upper_copy(right.getSchemaName());
 
74
    return boost::ilexicographical_compare(left.getSchemaName(), right.getSchemaName());
96
75
  }
97
76
 
98
 
  friend bool operator==(Schema::const_reference left,
99
 
                         Schema::const_reference right)
 
77
  friend bool operator==(const Schema& left,
 
78
                         const Schema& right)
100
79
  {
101
80
    return boost::iequals(left.getSchemaName(), right.getSchemaName());
102
81
  }
107
86
 
108
87
} /* namespace identifier */
109
88
} /* namespace drizzled */
110
 
 
111
 
#endif /* DRIZZLED_IDENTIFIER_SCHEMA_H */