DDraceNetwork Docs
CSqliteConnection Class Reference
Inheritance diagram for CSqliteConnection:
[legend]
Collaboration diagram for CSqliteConnection:
[legend]

Public Member Functions

 CSqliteConnection (const char *pFilename, bool Setup)
 
 ~CSqliteConnection () override
 
void Print (IConsole *pConsole, const char *pMode) override
 
const char * BinaryCollate () const override
 
void ToUnixTimestamp (const char *pTimestamp, char *aBuf, unsigned int BufferSize) override
 
const char * InsertTimestampAsUtc () const override
 
const char * CollateNocase () const override
 
const char * InsertIgnore () const override
 
const char * Random () const override
 
const char * MedianMapTime (char *pBuffer, int BufferSize) const override
 
const char * False () const override
 
const char * True () const override
 
bool Connect (char *pError, int ErrorSize) override
 
void Disconnect () override
 
bool PrepareStatement (const char *pStmt, char *pError, int ErrorSize) override
 
void BindString (int Idx, const char *pString) override
 
void BindBlob (int Idx, unsigned char *pBlob, int Size) override
 
void BindInt (int Idx, int Value) override
 
void BindInt64 (int Idx, int64_t Value) override
 
void BindFloat (int Idx, float Value) override
 
void BindNull (int Idx) override
 
void Print () override
 
bool Step (bool *pEnd, char *pError, int ErrorSize) override
 
bool ExecuteUpdate (int *pNumUpdated, char *pError, int ErrorSize) override
 
bool IsNull (int Col) override
 
float GetFloat (int Col) override
 
int GetInt (int Col) override
 
int64_t GetInt64 (int Col) override
 
void GetString (int Col, char *pBuffer, int BufferSize) override
 
int GetBlob (int Col, unsigned char *pBuffer, int BufferSize) override
 
bool AddPoints (const char *pPlayer, int Points, char *pError, int ErrorSize) override
 
bool CreateFailsafeTables ()
 
- Public Member Functions inherited from IDbConnection
 IDbConnection (const char *pPrefix)
 
virtual ~IDbConnection ()
 
IDbConnectionoperator= (const IDbConnection &)=delete
 
virtual void Print (IConsole *pConsole, const char *pMode)=0
 
const char * GetPrefix () const
 
virtual const char * BinaryCollate () const =0
 
virtual void ToUnixTimestamp (const char *pTimestamp, char *aBuf, unsigned int BufferSize)=0
 
virtual const char * InsertTimestampAsUtc () const =0
 
virtual const char * CollateNocase () const =0
 
virtual const char * InsertIgnore () const =0
 
virtual const char * Random () const =0
 
virtual const char * MedianMapTime (char *pBuffer, int BufferSize) const =0
 
virtual const char * False () const =0
 
virtual const char * True () const =0
 
virtual bool Connect (char *pError, int ErrorSize)=0
 
virtual void Disconnect ()=0
 
virtual bool PrepareStatement (const char *pStmt, char *pError, int ErrorSize)=0
 
virtual void BindString (int Idx, const char *pString)=0
 
virtual void BindBlob (int Idx, unsigned char *pBlob, int Size)=0
 
virtual void BindInt (int Idx, int Value)=0
 
virtual void BindInt64 (int Idx, int64_t Value)=0
 
virtual void BindFloat (int Idx, float Value)=0
 
virtual void BindNull (int Idx)=0
 
virtual void Print ()=0
 
virtual bool Step (bool *pEnd, char *pError, int ErrorSize)=0
 
virtual bool ExecuteUpdate (int *pNumUpdated, char *pError, int ErrorSize)=0
 
virtual bool IsNull (int Col)=0
 
virtual float GetFloat (int Col)=0
 
virtual int GetInt (int Col)=0
 
virtual int64_t GetInt64 (int Col)=0
 
virtual void GetString (int Col, char *pBuffer, int BufferSize)=0
 
virtual int GetBlob (int Col, unsigned char *pBuffer, int BufferSize)=0
 
virtual bool AddPoints (const char *pPlayer, int Points, char *pError, int ErrorSize)=0
 

Private Member Functions

bool Execute (const char *pQuery, char *pError, int ErrorSize)
 
bool ConnectImpl (char *pError, int ErrorSize)
 
bool FormatError (int Result, char *pError, int ErrorSize)
 
void AssertNoError (int Result)
 

Private Attributes

char m_aFilename [IO_MAX_PATH_LENGTH]
 
bool m_Setup
 
sqlite3 * m_pDb
 
sqlite3_stmt * m_pStmt
 
bool m_Done
 
std::atomic_bool m_InUse
 

Additional Inherited Members

- Protected Member Functions inherited from IDbConnection
void FormatCreateRace (char *aBuf, unsigned int BufferSize, bool Backup) const
 
void FormatCreateTeamrace (char *aBuf, unsigned int BufferSize, const char *pIdType, bool Backup) const
 
void FormatCreateMaps (char *aBuf, unsigned int BufferSize) const
 
void FormatCreateSaves (char *aBuf, unsigned int BufferSize, bool Backup) const
 
void FormatCreatePoints (char *aBuf, unsigned int BufferSize) const
 

Constructor & Destructor Documentation

◆ CSqliteConnection()

CSqliteConnection::CSqliteConnection ( const char *  pFilename,
bool  Setup 
)

◆ ~CSqliteConnection()

CSqliteConnection::~CSqliteConnection ( )
override

Member Function Documentation

◆ AddPoints()

bool CSqliteConnection::AddPoints ( const char *  pPlayer,
int  Points,
char *  pError,
int  ErrorSize 
)
overridevirtual

Implements IDbConnection.

◆ AssertNoError()

void CSqliteConnection::AssertNoError ( int  Result)
private

◆ BinaryCollate()

const char * CSqliteConnection::BinaryCollate ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ BindBlob()

void CSqliteConnection::BindBlob ( int  Idx,
unsigned char *  pBlob,
int  Size 
)
overridevirtual

Implements IDbConnection.

◆ BindFloat()

void CSqliteConnection::BindFloat ( int  Idx,
float  Value 
)
overridevirtual

Implements IDbConnection.

◆ BindInt()

void CSqliteConnection::BindInt ( int  Idx,
int  Value 
)
overridevirtual

Implements IDbConnection.

◆ BindInt64()

void CSqliteConnection::BindInt64 ( int  Idx,
int64_t  Value 
)
overridevirtual

Implements IDbConnection.

◆ BindNull()

void CSqliteConnection::BindNull ( int  Idx)
overridevirtual

Implements IDbConnection.

◆ BindString()

void CSqliteConnection::BindString ( int  Idx,
const char *  pString 
)
overridevirtual

Implements IDbConnection.

◆ CollateNocase()

const char * CSqliteConnection::CollateNocase ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ Connect()

bool CSqliteConnection::Connect ( char *  pError,
int  ErrorSize 
)
overridevirtual

Implements IDbConnection.

◆ ConnectImpl()

bool CSqliteConnection::ConnectImpl ( char *  pError,
int  ErrorSize 
)
private

◆ CreateFailsafeTables()

bool CSqliteConnection::CreateFailsafeTables ( )

◆ Disconnect()

void CSqliteConnection::Disconnect ( )
overridevirtual

Implements IDbConnection.

◆ Execute()

bool CSqliteConnection::Execute ( const char *  pQuery,
char *  pError,
int  ErrorSize 
)
private

◆ ExecuteUpdate()

bool CSqliteConnection::ExecuteUpdate ( int *  pNumUpdated,
char *  pError,
int  ErrorSize 
)
overridevirtual

Implements IDbConnection.

◆ False()

const char * CSqliteConnection::False ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ FormatError()

bool CSqliteConnection::FormatError ( int  Result,
char *  pError,
int  ErrorSize 
)
private

◆ GetBlob()

int CSqliteConnection::GetBlob ( int  Col,
unsigned char *  pBuffer,
int  BufferSize 
)
overridevirtual

Implements IDbConnection.

◆ GetFloat()

float CSqliteConnection::GetFloat ( int  Col)
overridevirtual

Implements IDbConnection.

◆ GetInt()

int CSqliteConnection::GetInt ( int  Col)
overridevirtual

Implements IDbConnection.

◆ GetInt64()

int64_t CSqliteConnection::GetInt64 ( int  Col)
overridevirtual

Implements IDbConnection.

◆ GetString()

void CSqliteConnection::GetString ( int  Col,
char *  pBuffer,
int  BufferSize 
)
overridevirtual

Implements IDbConnection.

◆ InsertIgnore()

const char * CSqliteConnection::InsertIgnore ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ InsertTimestampAsUtc()

const char * CSqliteConnection::InsertTimestampAsUtc ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ IsNull()

bool CSqliteConnection::IsNull ( int  Col)
overridevirtual

Implements IDbConnection.

◆ MedianMapTime()

const char * CSqliteConnection::MedianMapTime ( char *  pBuffer,
int  BufferSize 
) const
overridevirtual

Implements IDbConnection.

◆ PrepareStatement()

bool CSqliteConnection::PrepareStatement ( const char *  pStmt,
char *  pError,
int  ErrorSize 
)
overridevirtual

Implements IDbConnection.

◆ Print() [1/2]

void CSqliteConnection::Print ( )
overridevirtual

Implements IDbConnection.

◆ Print() [2/2]

void CSqliteConnection::Print ( IConsole pConsole,
const char *  pMode 
)
overridevirtual

Implements IDbConnection.

◆ Random()

const char * CSqliteConnection::Random ( ) const
inlineoverridevirtual

Implements IDbConnection.

◆ Step()

bool CSqliteConnection::Step ( bool *  pEnd,
char *  pError,
int  ErrorSize 
)
overridevirtual

Implements IDbConnection.

◆ ToUnixTimestamp()

void CSqliteConnection::ToUnixTimestamp ( const char *  pTimestamp,
char *  aBuf,
unsigned int  BufferSize 
)
overridevirtual

Implements IDbConnection.

◆ True()

const char * CSqliteConnection::True ( ) const
inlineoverridevirtual

Implements IDbConnection.

Member Data Documentation

◆ m_aFilename

char CSqliteConnection::m_aFilename[IO_MAX_PATH_LENGTH]
private

◆ m_Done

bool CSqliteConnection::m_Done
private

◆ m_InUse

std::atomic_bool CSqliteConnection::m_InUse
private

◆ m_pDb

sqlite3* CSqliteConnection::m_pDb
private

◆ m_pStmt

sqlite3_stmt* CSqliteConnection::m_pStmt
private

◆ m_Setup

bool CSqliteConnection::m_Setup
private

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