#ifndef __SMYSQL_H_
#define __SMYSQL_H_
#include <string>
#include <map>
#include <vector>
#include <mysql/mysql.h>
class Mysql
{
public:
typedef struct st_mysql MYSQL;
typedef std::map< std::string, std::string > LMAP;
typedef std::vector< LMAP > RESULT;
private:
MYSQL * _dbinstance;
public:
Mysql ( const char * hostname, const char * username, const char * password, const char * dbname );
~Mysql( );
bool Query( const char * query );
int QueryRows( const char * query );
bool RealQuery( const char * query );
std::string EscapeString( const std::string & );
bool Load( const char * query );
RESULT _info;
static Mysql &Instance();
};
inline Mysql &Mysql::Instance() {
static Mysql
instance(
"localhost", "root", "default", "kaladea_db" );;
return instance;
}
#endif