-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cache.hpp
98 lines (85 loc) · 1.87 KB
/
Cache.hpp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: CACHE.HPP
** COMPONENT: The Application.
** DESCRIPTION: The CCache class declaration.
**
*******************************************************************************
*/
// Check for previous inclusion
#ifndef CACHE_HPP
#define CACHE_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <MDBL/Table.hpp>
/******************************************************************************
**
** Constants.
**
*******************************************************************************
*/
// File types.
const tchar UNKNOWN_FILE = 0;
const tchar SYSTEM_FILE = 'U';
const tchar MAP_FILE = 'P';
const tchar TEXTURE_FILE = 'T';
const tchar SOUND_FILE = 'A';
const tchar MUSIC_FILE = 'M';
const tchar MESH_FILE = 'S';
const tchar ANIM_FILE = 'K';
const tchar KARMA_FILE = 'D';
// File status.
const tchar NEW_FILE = 'N';
const tchar OLD_FILE = 'O';
const tchar PIN_FILE = 'P';
/******************************************************************************
**
** The table used to store the cached files details.
**
*******************************************************************************
*/
class CCache : public CTable
{
public:
//
// Constructors/Destructor.
//
CCache();
~CCache();
//
// Column indices.
//
enum
{
ID,
CACHE_FILENAME,
INDEX_KEY,
REAL_FILENAME,
FILE_TYPE,
FILE_DATE,
FILE_SIZE,
STATUS,
};
//
// Column lengths.
//
enum
{
CACHE_FILENAME_LEN = MAX_PATH,
INDEX_KEY_LEN = MAX_PATH,
REAL_FILENAME_LEN = MAX_PATH,
};
//
// Methods (overriden).
//
virtual CRow& CreateRow();
};
/******************************************************************************
**
** Implementation of inline functions.
**
*******************************************************************************
*/
#endif //CACHE_HPP