Drizzled Public API Documentation

drizzledump_drizzle.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Andrew Hutchings
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #include "client/drizzledump_data.h"
00023 
00024 class DrizzleDumpDatabaseDrizzle;
00025 class DrizzleDumpDataDrizzle;
00026 
00027 class DrizzleDumpForeignKeyDrizzle : public DrizzleDumpForeignKey
00028 {
00029   public:
00030     DrizzleDumpForeignKeyDrizzle(std::string name, DrizzleDumpConnection* connection) : DrizzleDumpForeignKey(name, connection)
00031     { }
00032 
00033     ~DrizzleDumpForeignKeyDrizzle()
00034     {
00035     }
00036 };
00037 
00038 class DrizzleDumpIndexDrizzle : public DrizzleDumpIndex
00039 {
00040   public:
00041     DrizzleDumpIndexDrizzle(std::string &index, DrizzleDumpConnection *connection)
00042     : DrizzleDumpIndex(index, connection)
00043     { }
00044 
00045     ~DrizzleDumpIndexDrizzle()
00046     {
00047       columns.clear();
00048     }
00049 };
00050 
00051 class DrizzleDumpFieldDrizzle : public DrizzleDumpField
00052 {
00053   public:
00054     DrizzleDumpFieldDrizzle(std::string &field, DrizzleDumpConnection *connection)
00055     : DrizzleDumpField(field, connection)
00056     { }
00057 
00058     ~DrizzleDumpFieldDrizzle() { }
00059 
00060     void setType(const char* raw_type, const char* collation);
00061 };
00062 
00063 class DrizzleDumpTableDrizzle : public DrizzleDumpTable
00064 {
00065   public:
00066     DrizzleDumpTableDrizzle(std::string &table, DrizzleDumpConnection *connection)
00067     : DrizzleDumpTable(table, connection)
00068     { }
00069 
00070     ~DrizzleDumpTableDrizzle()
00071     {
00072       fields.clear();
00073       indexes.clear();
00074       fkeys.clear();
00075     }
00076     bool populateFields();
00077     bool populateIndexes();
00078     bool populateFkeys();
00079     DrizzleDumpData* getData(void);
00080 };
00081 
00082 class DrizzleDumpDatabaseDrizzle : public DrizzleDumpDatabase
00083 {
00084   public:
00085     DrizzleDumpDatabaseDrizzle(const std::string &database,
00086       DrizzleDumpConnection *connection)
00087     : DrizzleDumpDatabase(database, connection)
00088     { }
00089 
00090     ~DrizzleDumpDatabaseDrizzle()
00091     {
00092       tables.clear();
00093     }
00094     bool populateTables(void);
00095     bool populateTables(const std::vector<std::string> &table_names);
00096     void setCollate(const char* newCollate);
00097 
00098 };
00099 
00100 class DrizzleDumpDataDrizzle : public DrizzleDumpData
00101 {
00102   public:
00103     DrizzleDumpDataDrizzle(DrizzleDumpTable *dataTable,
00104       DrizzleDumpConnection *connection);
00105     ~DrizzleDumpDataDrizzle();
00106 };