CARDS 2.4.87
Package manager for the NuTyX GNU/Linux distribution
mysql.h
1 // mysql.h
2 //
3 // Copyright (c) 2016 by NuTyX team (http://nutyx.org)
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 // USA.
19 //
20 #ifndef MYSQL_H
21 #define MYSQL_H
22 #include <mysql/mysql.h>
23 
24 #include "file_utils.h"
25 namespace Sql
26 {
27 struct boardInfo_t {
28  std::string category;
29  std::string name;
30 };
31 struct userInfo_t {
32  std::string member_name;
33  std::string real_name;
34 };
35 typedef std::map< std::string, boardInfo_t > board_t;
36 typedef std::map< std::string, std::string > category_t;
37 typedef std::map< std::string, userInfo_t > user_t;
38 
39 class mysql
40 {
41 public:
42  virtual ~mysql();
43  mysql(const char *configFileName);
44  void lastPosts(const char *forum,int n);
45 
46 private:
47  const char *m_hostname;
48  const char *m_database;
49  const char *m_username;
50  const char *m_password;
51  const char *m_socket;
52  enum {
53  m_port_no = 3306,
54  m_opt = 0
55  };
56  MYSQL *m_connection;
57  MYSQL_RES *m_result;
58  MYSQL_ROW rows;
59  Config mysqlConfig;
60 };
61 } /* namespace Sql */
62 #endif /* MYSQL_H */
63 // vim:set ts=2 :
Definition: mysql.h:39
Definition: mysql.cxx:22
Definition: file_utils.h:69
Definition: mysql.h:27
Definition: mysql.h:31