#include <Database.h>
Public Member Functions | |
Database () | |
Public constructor. | |
virtual | ~Database () |
Virtual destructor. | |
common::ErrorCodeType | Connect (const std::string &hostname, const std::string &username, const std::string &password) |
Connects database. | |
common::ErrorCodeType | Close () |
Closes database. | |
common::ErrorCodeType | GetPlayer (const std::string &rUsername, const std::string &rPassword, common::Player &rPlayer) |
Gets player. | |
common::ErrorCodeType | GetTimeStamp (std::string &rTimeStamp) |
Gets time stamp. | |
Private Member Functions | |
common::ErrorCodeType | Query (const std::string &rQuery, std::string &rResult) |
Executes query. | |
std::string | EscapeString (const std::string &rString) |
Sanitizes string. | |
Private Attributes | |
MYSQL * | m_pDatabase |
Pointer to private MySQL structure. | |
SDL_mutex * | m_pQueryMutex |
Pointer to query mutex. |
Database | ( | ) |
Public constructor.
~Database | ( | ) | [virtual] |
Virtual destructor.
common::ErrorCodeType Connect | ( | const std::string & | hostname, | |
const std::string & | username, | |||
const std::string & | password | |||
) |
Connects database.
Failure otherwise.
hostname | Host name or IP address. |
username | User login name on host. |
password | Password of given user. |
common::ErrorCodeType Close | ( | ) |
Closes database.
common::ErrorCodeType GetPlayer | ( | const std::string & | rUsername, | |
const std::string & | rPassword, | |||
common::Player & | rPlayer | |||
) |
Gets player.
Failure otherwise.
rUsername | Username. |
rPassword | Password. |
rPlayer | Player. |
common::ErrorCodeType GetTimeStamp | ( | std::string & | rTimeStamp | ) |
Gets time stamp.
Failure otherwise.
rTimeStamp | Time stamp. |
common::ErrorCodeType Query | ( | const std::string & | rQuery, | |
std::string & | rResult | |||
) | [private] |
Executes query.
Failure otherwise.
rQuery | Query to be executed. |
rResult | Result of query. |
std::string EscapeString | ( | const std::string & | rString | ) | [private] |
Sanitizes string.
MYSQL* m_pDatabase [private] |
Pointer to private MySQL structure.
SDL_mutex* m_pQueryMutex [private] |
Pointer to query mutex.
Navigation
Home Page
Screen Shots
Developers
Documentation
Doxygen
Namespace List
Class List
Class Hierarchy
File List
Todo List
Links
SDL Library
License
SourceForge Project
Forums
Download
Regimental Command
Copyright © 2008
Randi J. Relander