~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/identifier/schema.cc

  • Committer: Brian Aker
  • Date: 2011-01-06 18:00:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2064.
  • Revision ID: brian@tangent.org-20110106180047-0l214nvry9x1lkxo
Merge in fixes for microtimestamp,

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
namespace drizzled
42
42
{
43
43
 
44
 
namespace identifier
45
 
{
46
 
 
47
44
extern string drizzle_tmpdir;
48
45
extern pid_t current_pid;
49
46
 
64
61
  return path.length();
65
62
}
66
63
 
67
 
Schema::Schema(const std::string &db_arg) :
 
64
SchemaIdentifier::SchemaIdentifier(const std::string &db_arg) :
68
65
  db(db_arg),
69
 
  db_path("")
 
66
  db_path(""),
 
67
  catalog("LOCAL")
70
68
71
69
#if 0
72
70
  string::size_type lastPos= db.find_first_of('/', 0);
80
78
 
81
79
  if (not db_arg.empty())
82
80
  {
83
 
    build_schema_filename(db_path, db);
 
81
    drizzled::build_schema_filename(db_path, db);
84
82
    assert(db_path.length()); // TODO throw exception, this is a possibility
85
83
  }
86
84
}
87
85
 
88
 
void Schema::getSQLPath(std::string &arg) const
 
86
void SchemaIdentifier::getSQLPath(std::string &arg) const
89
87
{
90
88
  arg= db;
91
89
}
92
90
 
93
 
const std::string &Schema::getPath() const
 
91
const std::string &SchemaIdentifier::getPath() const
94
92
{
95
93
  return db_path;
96
94
}
97
95
 
98
 
bool Schema::compare(const std::string &arg) const
 
96
bool SchemaIdentifier::compare(const std::string &arg) const
99
97
{
100
98
  return boost::iequals(arg, db);
101
99
}
102
100
 
103
 
bool Schema::compare(Schema::const_reference arg) const
 
101
bool SchemaIdentifier::compare(SchemaIdentifier::const_reference arg) const
104
102
{
105
103
  return boost::iequals(arg.getSchemaName(), db);
106
104
}
107
105
 
108
 
bool Schema::isValid() const
 
106
bool SchemaIdentifier::isValid() const
109
107
{
110
108
  bool error= false;
111
109
 
159
157
  return true;
160
158
}
161
159
 
162
 
const std::string &Schema::getCatalogName() const
163
 
{
164
 
  return drizzled::catalog::local_identifier().name();
165
 
}
166
 
 
167
 
std::ostream& operator<<(std::ostream& output, const Schema&identifier)
168
 
{
169
 
  output << "identifier::Schema:(";
170
 
  output <<  catalog::local_identifier();
171
 
  output << ", ";
172
 
  output <<  identifier.getSchemaName().c_str();
173
 
  output << ", ";
174
 
  output << identifier.getPath().c_str();
175
 
  output << ")";
176
 
 
177
 
  return output;  // for multiple << operators.
178
 
}
179
 
 
180
 
} /* namespace identifier */
181
160
} /* namespace drizzled */