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 <drizzled/enum.h>
00035 #include <drizzled/definitions.h>
00036 #include <drizzled/message/table.pb.h>
00037 #include <drizzled/catalog/local.h>
00038 #include <string.h>
00039
00040 #include <assert.h>
00041
00042 #include <ostream>
00043 #include <list>
00044 #include <algorithm>
00045 #include <functional>
00046 #include <iostream>
00047
00048 #include <boost/algorithm/string.hpp>
00049
00050 #include <drizzled/visibility.h>
00051
00052 namespace drizzled {
00053 namespace identifier {
00054
00055 class DRIZZLED_API Schema : public Identifier
00056 {
00057 std::string db;
00058 std::string db_path;
00059
00060 public:
00061 typedef std::vector <Schema> vector;
00062 typedef const Schema& const_reference;
00063
00064 Schema(const std::string &db_arg);
00065
00066 virtual ~Schema()
00067 { }
00068
00069 virtual void getSQLPath(std::string &arg) const;
00070
00071 const std::string &getPath() const;
00072
00073 const std::string &getSchemaName() const
00074 {
00075 return db;
00076 }
00077
00078 const std::string &getCatalogName() const;
00079
00080 virtual bool isValid() const;
00081
00082 inline virtual bool isSystem() const
00083 {
00084 return false;
00085 }
00086
00087 bool compare(const std::string &arg) const;
00088 bool compare(Schema::const_reference) const;
00089
00090 friend bool operator<(Schema::const_reference left, Schema::const_reference right)
00091 {
00092 return boost::algorithm::to_upper_copy(left.getSchemaName()) < boost::algorithm::to_upper_copy(right.getSchemaName());
00093 }
00094
00095 friend bool operator==(Schema::const_reference left,
00096 Schema::const_reference right)
00097 {
00098 return boost::iequals(left.getSchemaName(), right.getSchemaName());
00099 }
00100 };
00101
00102 std::ostream& operator<<(std::ostream& output, const Schema&identifier);
00103
00104
00105 }
00106 }