db_bridge/include/mysql_db.hpp
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:13 +0200
changeset 65 76514757b0d6
permissions -rw-r--r--
GNU Indent cannot handle C++ Source Files... I like GNU indent. I like it so much that i use it for all my projects. But it doesn't work with C++ sources. To avoid further problems, all C++ Headers will be renamed from *.h to their *.hpp counterparts. mbroeker committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
65
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
/**
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
 * db_bridge/include/mysql_db.h
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
 * Copyright 2008 (C) Markus Broeker
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
 */
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
#ifndef MYSQL_DB_H
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
#define MYSQL_DB_H
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
#include <iostream>
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
#include <mysql/mysql.h>
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
#include <abstract_db.hpp>
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
class MySQL_DB:public Abstract_DB {
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
  private:
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
    MYSQL * conn;
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
    MYSQL_RES *res;
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    19
  public:
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
    MySQL_DB (std::string, std::string, std::string, std::string);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
    virtual ~ MySQL_DB ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
    bool connect ();
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    23
    Abstract_DB::DB_RESULT query (std::string);
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
};
76514757b0d6 GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
#endif