~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to drizzled/identifier/constants/schema.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include <config.h>
22
 
 
23
22
#include <drizzled/identifier.h>
24
23
 
25
24
namespace drizzled {
30
29
class Schema : public identifier::Schema
31
30
{
32
31
public:
33
 
  Schema(const std::string &name) :
34
 
    identifier::Schema(name)
35
 
  {
36
 
    std::transform(name.begin(), name.end(), _path.begin(), ::tolower);
37
 
  }
38
 
 
39
 
  const std::string &getPath() const
40
 
  {
41
 
    return _path;
42
 
  }
43
 
 
44
 
  inline bool isSystem() const
 
32
  Schema(const char* name) :
 
33
    identifier::Schema(str_ref(name)),
 
34
    path_(boost::to_lower_copy(getSchemaName()))
 
35
  {
 
36
  }
 
37
 
 
38
  const std::string& getPath() const
 
39
  {
 
40
    return path_;
 
41
  }
 
42
 
 
43
  bool isSystem() const
45
44
  {
46
45
    return true;
47
46
  }
48
47
 
49
48
private:
50
 
  std::string _path;
 
49
  std::string path_;
51
50
};
52
51
 
53
52
} /* namespace constants */
54
53
 
55
 
identifier::Schema::const_reference data_dictionary()
 
54
static constants::Schema g_dd= "DATA_DICTIONARY";
 
55
static constants::Schema g_is= "INFORMATION_SCHEMA";
 
56
 
 
57
const Schema& data_dictionary()
56
58
{
57
 
  static drizzled::identifier::Schema _tmp("DATA_DICTIONARY");
58
 
 
59
 
  return _tmp;
 
59
  return g_dd;
60
60
}
61
61
 
62
 
identifier::Schema::const_reference information_schema()
 
62
const Schema& information_schema()
63
63
{
64
 
  static drizzled::identifier::Schema _tmp("INFORMATION_SCHEMA");
65
 
 
66
 
  return _tmp;
 
64
  return g_is;
67
65
}
68
66
 
69
67
} /* namespace identifier */