-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgamerecord.h
68 lines (55 loc) · 1.16 KB
/
gamerecord.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef GAMERECORD_H
#define GAMERECORD_H
// File must include
#include <QString>
/**
* @brief A class to deal with the files.
*/
class GameRecord
{
public:
/**
* @brief Constructor.
*/
GameRecord();
/**
* @brief Create a file.
*/
bool createFile(const QString &filename, int intCount);
/**
* @brief Resize a file.
*/
bool resizeFile(const QString &filename, int intCount);
/**
* @brief Whether a file exists.
*/
bool exists(const QString &filename);
/**
* @brief Remove a file.
*/
bool remove(const QString &filename);
/**
* @brief Count of integer in the file.
*/
int sizeOfInt(const QString &filename);
/**
* @brief Write data.
*/
bool writeData(const QString &filename, int pos, int data);
/**
* @brief Read data.
*/
int readData(const QString &filename, int pos);
/**
* @brief Write data in an array.
*/
bool writeDataArr(const QString &filename, int *dataArr, int size);
/**
* @brief Read data into an array.
*/
bool readDataArr(const QString &filename, int *&dataArr, int &size);
private:
// The path if the record
QString recordPath;
};
#endif // GAMERECORD_H