20 #ifndef __PSDATABASE_H__ 21 #define __PSDATABASE_H__ 28 struct iObjectRegistry;
29 class psAdminResponseList;
41 #define PS_DBNAME "planeshift" 42 #define PS_USER "planeshift" 43 #define PS_PASS "planeshift" 74 virtual bool Initialize(
const char* host,
unsigned int port,
const char* user,
75 const char* password,
const char* database);
123 int maxAttitude,
int minAttitude,
124 int responseID,
int priorID );
137 Result(iResultSet* resset) : rs(resset) {}
142 void operator = (iResultSet* resset)
144 if (rs) rs->Release();
150 return (*rs)[whichrow];
153 unsigned long Count(
void) {
return rs->Count(); }
int InsertResponseSet(stringList &responseSet)
const char * GetLastQuery()
Returns the last query that was performed.
unsigned long Count(void)
Result(iResultSet *resset)
const char * GetLastSQLError()
Utility functions.
int InsertResponse(psAdminResponseList &responses)
void SetLastError(const char *str)
Sets the last error that occured.
int InsertTrigger(const char *trigger, const char *area, int maxAttitude, int minAttitude, int responseID, int priorID)
csString lasterror
Contains a string that describes the last error that happened.
iObjectRegistry * object_reg
virtual bool Initialize(const char *host, unsigned int port, const char *user, const char *password, const char *database)
Initialize the database manager.
const char * GetLastError()
Returns the last error that occured.
virtual ~psDatabase()
Destructor.
This is a wrapper class for result sets which makes syntax for getting at the data easier and also us...
void Close()
Closes sql database connection.
csRef< iDataConnection > mysql
iResultRow & operator[](unsigned long whichrow)
psDatabase(iObjectRegistry *objectreg)
Initializing Constructor.