-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcpps_buffer.h
More file actions
48 lines (45 loc) · 1.14 KB
/
cpps_buffer.h
File metadata and controls
48 lines (45 loc) · 1.14 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
#ifndef CPPSBUFFER_CPPS_HEAD_
#define CPPSBUFFER_CPPS_HEAD_
//===================================
//@Author : Johnson
//@QQ : 88481106
//@Email : 88481106@qq.com
//@Date : 2015/11/18 (yy/mm/dd)
//@Module : CPPSBUFFER
//@Description : ×Ö½ÚÁ÷IO
//@website : http://cppscript.org
//==================================
namespace cpps
{
struct cppsbuffer_file
{
cppsbuffer_file();
std::string filename;
int32 begin;
int32 end;
int32 line;
};
class cppsbuffer
{
public:
cppsbuffer(const char *_filename,const char* _buffer, int32 _buffersize);
char pop();
char realpop();
char cur();
char realcur();
char at(int32 off);
int32 offset();
std::string substr(int32 off, int32 len);
void seek(int32 off);
bool isend();
int32 line();
void append(std::string _filename, const char* _buffer, int32 _buffersize);
cppsbuffer_file& getcurfile();
public:
std::vector< cppsbuffer_file > files;
std::string buffer;
int32 buffersize;
int32 bufferoffset;
};
}
#endif // CPPSBUFFER_CPPS_HEAD_