Planeshift
|
#include <psdatabase.h>
Public Member Functions | |
void | Close () |
Closes sql database connection. | |
const char * | GetLastError () |
Returns the last error that occured. | |
const char * | GetLastQuery () |
Returns the last query that was performed. | |
const char * | GetLastSQLError () |
Utility functions. | |
virtual bool | Initialize (const char *host, unsigned int port, const char *user, const char *password, const char *database) |
Initialize the database manager. | |
psDatabase (iObjectRegistry *objectreg) | |
Initializing Constructor. | |
void | SetLastError (const char *str) |
Sets the last error that occured. | |
virtual | ~psDatabase () |
Destructor. | |
Protected Member Functions | |
int | InsertResponse (psAdminResponseList &responses) |
int | InsertResponse (csString &response) |
int | InsertResponseSet (stringList &responseSet) |
int | InsertTrigger (const char *trigger, const char *area, int maxAttitude, int minAttitude, int responseID, int priorID) |
Protected Attributes | |
csString | lasterror |
Contains a string that describes the last error that happened. | |
csRef< iDataConnection > | mysql |
iObjectRegistry * | object_reg |
Definition at line 45 of file psdatabase.h.
psDatabase::psDatabase | ( | iObjectRegistry * | objectreg | ) |
Initializing Constructor.
objectreg,: | The object registry for later use. |
virtual psDatabase::~psDatabase | ( | ) | [virtual] |
void psDatabase::Close | ( | ) |
Closes sql database connection.
const char* psDatabase::GetLastError | ( | ) |
Returns the last error that occured.
This error is usually intended to be explanatory to a user, rather than the SQL error technical description of the problem.
const char* psDatabase::GetLastQuery | ( | ) |
Returns the last query that was performed.
Used to help diagnose why a particular error occurred.
const char* psDatabase::GetLastSQLError | ( | ) |
Utility functions.
Returns the last error generated by SQL
virtual bool psDatabase::Initialize | ( | const char * | host, |
unsigned int | port, | ||
const char * | user, | ||
const char * | password, | ||
const char * | database | ||
) | [virtual] |
Initialize the database manager.
This will connect to the database and log on using the given username, password and start using the given database.
host,: | The URL of the server that hosts the mysql database. |
port,: | The port of the server that hosts the mysql database. |
user,: | The username for the database. |
password,: | The password used to access the database. |
database,: | The name of the database to use for the current user. |
int psDatabase::InsertResponse | ( | csString & | response | ) | [protected] |
int psDatabase::InsertResponse | ( | psAdminResponseList & | responses | ) | [protected] |
int psDatabase::InsertResponseSet | ( | stringList & | responseSet | ) | [protected] |
int psDatabase::InsertTrigger | ( | const char * | trigger, |
const char * | area, | ||
int | maxAttitude, | ||
int | minAttitude, | ||
int | responseID, | ||
int | priorID | ||
) | [protected] |
void psDatabase::SetLastError | ( | const char * | str | ) | [inline] |
Sets the last error that occured.
Definition at line 90 of file psdatabase.h.
csString psDatabase::lasterror [protected] |
Contains a string that describes the last error that happened.
Definition at line 116 of file psdatabase.h.
csRef<iDataConnection> psDatabase::mysql [protected] |
Definition at line 113 of file psdatabase.h.
iObjectRegistry* psDatabase::object_reg [protected] |
Definition at line 112 of file psdatabase.h.