-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLBPUnicodeTextFile.h
55 lines (39 loc) · 1017 Bytes
/
LBPUnicodeTextFile.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
#pragma once
#ifndef LBPEXPORT
#define LBPEXPORT
#endif
#include "LBPString.h"
class LBPEXPORT CLBPFile : public CFile
{
public:
CLBPFile();
CLBPFile(LPCTSTR lpszFileName, UINT nOpenFlags);
virtual ~CLBPFile();
public:
char putc(char c);
char getc();
short putshort(short s);
short getshort();
};
class LBPEXPORT CLBPUnicodeTextFile : public CFile
{
public:
CLBPUnicodeTextFile(bool bIsUTF8 = false);
CLBPUnicodeTextFile(LPCTSTR lpszFileName, UINT nOpenFlags, bool bIsUTF8 = false);
bool WriteLine(const CLBPString& sLine);
bool ReadEverything(CLBPString& sEverything);
public:
#ifdef _MFC42
virtual void SetLength(DWORD dwNewLen);
#else
virtual void SetLength(ULONGLONG dwNewLen);
#endif
virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL);
protected:
bool WriteOrReadHeader(UINT iFlags);
bool WriteUTF8Line(const CLBPString& sLine);
bool WriteUTF16Line(const CLBPString& sLine);
bool SkipOverBOM(bool& bIsUTF8);
protected:
bool m_bIsUTF8;
};