forked from derandark/PhatAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatabase.h
50 lines (35 loc) · 929 Bytes
/
Database.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <sql.h>
#include <sqlext.h>
class CAccountDatabase;
class CCharacterDatabase;
class CDatabase : public CKillable
{
friend class CAccountDatabase;
friend class CCharacterDatabase;
public:
CDatabase();
~CDatabase();
FILE *DataFileOpen(const char*, const char* mode = "rb");
FILE *DataFileCreate(const char*, const char* mode = "wb");
BOOL DataFileFindFirst(const char* filemask, WIN32_FIND_DATA* data);
BOOL DataFileFindNext(WIN32_FIND_DATA* data);
void DataFileFindClose();
CAccountDatabase *AccountDB();
CCharacterDatabase *CharDB();
private:
void FatalError(SQLSMALLINT type, SQLHANDLE *handle);
//Startup and shutdown routines.
void Initialize();
void Shutdown();
void StartSQL();
void EndSQL();
std::string m_database;
HENV m_hENV;
HDBC m_hDBC;
HSTMT m_hSTMT;
int m_column;
CAccountDatabase *m_pAccountDB;
CCharacterDatabase *m_pCharDB;
HANDLE m_hSearchHandle;
};