1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_IDENTIFIER_CATALOG_H
22
#define DRIZZLED_IDENTIFIER_CATALOG_H
24
#include <drizzled/enum.h>
25
#include "drizzled/definitions.h"
26
#include "drizzled/message/table.pb.h"
37
#include <boost/algorithm/string.hpp>
40
namespace identifier {
48
// @note this should be changed to protected once Session contains an
49
// identifier for current db.
53
Catalog(const std::string &name_arg);
58
const std::string &getPath() const;
60
const std::string &getName() const
66
bool compare(const std::string &arg) const;
68
size_t getHashValue() const
73
friend bool operator<(const Catalog &left, const Catalog &right)
75
return boost::algorithm::to_upper_copy(left.getName()) < boost::algorithm::to_upper_copy(right.getName());
78
friend std::ostream& operator<<(std::ostream& output,
81
output << "Catalog:(";
82
output << identifier.getName();
84
output << identifier.getPath();
87
return output; // for multiple << operators.
90
friend bool operator==(const Catalog &left,
93
return boost::iequals(left.getName(), right.getName());
101
std::size_t hash_value(Catalog const& b);
103
} /* namespace identifier */
104
} /* namespace drizzled */
106
#endif /* DRIZZLED_IDENTIFIER_CATALOG_H */