db_bridge/include/abstract_db.h
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:49:11 +0200
changeset 34 4a35f239fe5b
parent 17 b3731a25b9ec
permissions -rw-r--r--
the good, old programming error: * spoon= alloc(data, spoon); * free(spoon); -> there is a spoon (missing) Code indent with my buggy GNU Indent * -> PLEASE GUYS, FIX IT!! committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
/**
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
 * db_bridge/include/abstract_db.h
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
 * Copyright 2008 (C) Markus Broeker
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
 */
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
#ifndef ABSTRACT_DB_H
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
#define ABSTRACT_DB_H
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
#include <vector>
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
#include <string>
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
class Abstract_DB {
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
  protected:
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
    std::string user;
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
    std::string database;
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
    std::string password;
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
    std::string server;
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    19
  public:
34
4a35f239fe5b the good, old programming error:
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 17
diff changeset
    20
    typedef std::vector <std::vector <std::string> >DB_RESULT;
15
5a0ca1f9a2f1 db_bridge acts as an interactive sql monitor
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 14
diff changeset
    21
    typedef std::vector <std::string> DB_ROW;
14
862d63715611 the long vector needs a typedef
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 13
diff changeset
    22
12
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    23
    virtual bool connect () = 0;
14
862d63715611 the long vector needs a typedef
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 13
diff changeset
    24
    virtual DB_RESULT query (std::string) = 0;
12
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
};
9f0ce4eaa1ce I added a small db_bridge to the repository
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    26
#endif