Drizzled Public API Documentation

drizzledump_mysql.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2010 Andrew Hutchings
5  *
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; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 
22 #include "drizzledump_data.h"
23 
26 
28 {
29  public:
30  DrizzleDumpIndexMySQL(std::string &index, DrizzleDumpConnection *connection)
31  : DrizzleDumpIndex(index, connection)
32  { }
33 
35  {
36  columns.clear();
37  }
38 
39 };
40 
42 {
43  public:
44  DrizzleDumpFieldMySQL(std::string &field, DrizzleDumpConnection *connection)
45  : DrizzleDumpField(field, connection)
46  { }
47 
49 
50  void dateTimeConvert(void);
51  void setCollate(const char* newCollate);
52  void setType(const char* raw_type, const char* collation);
53 };
54 
56 {
57  public:
58  DrizzleDumpTableMySQL(std::string &table, DrizzleDumpConnection *connection)
59  : DrizzleDumpTable(table, connection)
60  { }
61 
63  {
64  fields.clear();
65  indexes.clear();
66  }
67 
68  bool populateFields();
69  bool populateIndexes();
70  bool populateFkeys();
71  void setEngine(const char* newEngine);
72  void setCollate(const char* newCollate);
73  DrizzleDumpData* getData(void);
74 };
75 
77 {
78  public:
79  DrizzleDumpDatabaseMySQL(const std::string &database,
80  DrizzleDumpConnection *connection)
81  : DrizzleDumpDatabase(database, connection)
82  { }
84  {
85  tables.clear();
86  }
87  bool populateTables(void);
88  bool populateTables(const std::vector<std::string> &table_names);
89  void setCollate(const char* newCollate);
90 };
91 
93 {
94  public:
96  DrizzleDumpConnection *connection);
98 
99  /* For 0000-00-00 -> NULL conversion */
100  std::string convertDate(const char* oldDate) const;
101  /* For xx:xx:xx -> INT conversion */
102  long convertTime(const char* oldTime) const;
103  std::string checkDateTime(const char* item, uint32_t field) const;
104 };