-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathLibraryFile.h
More file actions
56 lines (41 loc) · 1.19 KB
/
Copy pathLibraryFile.h
File metadata and controls
56 lines (41 loc) · 1.19 KB
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
// LibraryFile.h: interface for the LibraryFile class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LIBRARYFILE_H__D04656A2_2118_11D5_92A3_A76A2BB73024__INCLUDED_)
#define AFX_LIBRARYFILE_H__D04656A2_2118_11D5_92A3_A76A2BB73024__INCLUDED_
#include "MoveNode.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class LibraryFile
{
public:
LibraryFile();
virtual ~LibraryFile();
bool OpenRead(const CString& fileName);
bool OpenWrite(const CString& fileName);
bool Get(BYTE& data1, BYTE& data2);
bool Get(MoveNode& node);
void Put(BYTE data1, BYTE data2);
void Put(const MoveNode& node);
void Put(const CString& str);
CString GetFilePath() const;
bool CheckVersion();
void WriteHeader(bool isOldFormat);
void Close();
CString GetVersion() const;
private:
bool Open(const CString& fileName, UINT mode);
void Write();
private:
enum { BUFFERSIZE = 1024 };
CFile m_file;
BYTE m_buffer[BUFFERSIZE];
int m_indexStart;
int m_indexEnd;
UINT m_mode;
CString m_Version;
BYTE m_MajorFileVersion;
BYTE m_MinorFileVersion;
};
#endif // !defined(AFX_LIBRARYFILE_H__D04656A2_2118_11D5_92A3_A76A2BB73024__INCLUDED_)