~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

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