00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #pragma once
00033
00034 #include <boost/algorithm/string.hpp>
00035 #include <ostream>
00036
00037 namespace drizzled {
00038 namespace identifier {
00039
00040 class DRIZZLED_API Schema : public Identifier
00041 {
00042 std::string db;
00043 std::string db_path;
00044
00045 public:
00046 Schema(str_ref);
00047
00048 virtual std::string getSQLPath() const
00049 {
00050 return db;
00051 }
00052
00053 const std::string &getPath() const;
00054
00055 const std::string &getSchemaName() const
00056 {
00057 return db;
00058 }
00059
00060 const std::string &getCatalogName() const;
00061
00062 virtual bool isValid() const;
00063
00064 inline virtual bool isSystem() const
00065 {
00066 return false;
00067 }
00068
00069 bool compare(const std::string &arg) const;
00070 bool compare(const Schema&) const;
00071
00072 friend bool operator<(const Schema& left, const Schema& right)
00073 {
00074 return boost::ilexicographical_compare(left.getSchemaName(), right.getSchemaName());
00075 }
00076
00077 friend bool operator==(const Schema& left, const Schema& right)
00078 {
00079 return boost::iequals(left.getSchemaName(), right.getSchemaName());
00080 }
00081 };
00082
00083 std::ostream& operator<<(std::ostream&, const Schema&);
00084
00085
00086 }
00087 }