Database Class Reference

Maintains and interfaces with a connection to a database. More...

#include <database.hpp>

Collaboration diagram for Database:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Engine { MySQL, SQLite }

Public Member Functions

 Database ()
 Constructs a zombie Database object that should have Connect() called on it before anything else.
 Database (Database::Engine type, std::string host, std::string user, std::string pass, std::string db)
 Opens a connection to a database.
void Connect (Database::Engine type, std::string host, std::string user, std::string pass, std::string db)
 Opens a connection to a database.
Database_Result Query (const char *format,...)
 Executes a query and returns it's result.

Public Attributes

Database_Result callbackdata
 Object used to collect information from an external callback.

Protected Attributes

union {
}; 
bool connected
Engine engine


Detailed Description

Maintains and interfaces with a connection to a database.

Member Enumeration Documentation

Enumerator:
MySQL 
SQLite 


Constructor & Destructor Documentation

Database::Database (  ) 

Constructs a zombie Database object that should have Connect() called on it before anything else.

Database::Database ( Database::Engine  type,
std::string  host,
std::string  user,
std::string  pass,
std::string  db 
)

Opens a connection to a database.

Exceptions:
Database_InvalidEngine 
Database_OpenFailed 


Member Function Documentation

void Database::Connect ( Database::Engine  type,
std::string  host,
std::string  user,
std::string  pass,
std::string  db 
)

Opens a connection to a database.

Exceptions:
Database_InvalidEngine 
Database_OpenFailed 

Database_Result Database::Query ( const char *  format,
  ... 
)

Executes a query and returns it's result.

Exceptions:
Database_QueryFailed 


Member Data Documentation

union { ... } [protected]

bool Database::connected [protected]

Engine Database::engine [protected]

Object used to collect information from an external callback.


The documentation for this class was generated from the following files:

Generated on Sun Apr 5 20:28:19 2009 for EOServ by  doxygen 1.5.7.1