AppendBuffer.h
1.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**************************************************************************
* file: AppendBuffer.h
* Author: qingxiongf
* Date: 2021-12-12 23:00:46
* Email: qingxiongf@chinadci.com
* copyright: 广州城市信息研究所有限公司
***************************************************************************/
#ifndef __AppendBuffer_h__
#define __AppendBuffer_h__
#include "dmap_core.h"
#include "stdio.h"
#include <string>
#define APPEND_BUFFER_SIZE 200000
namespace DmapCore_30
{
class CORE_EXPORT AppendBuffer
{
public:
struct Buffer
{
Buffer *next;
char *buffer;
int bufferNowCount;
};
private:
FILE *f;
public:
int allSize;
AppendBuffer(void);
char *GetString();
std::string content_type;
public:
~AppendBuffer(void);
AppendBuffer(const char *fileName);
Buffer *head;
Buffer *now;
// char *bufferNow;
// char *bufferNowCount;
AppendBuffer::Buffer *NewABuffer(void);
public:
void SetBuffer(AppendBuffer::Buffer *buf, const char *str, int len);
void AppendString(const char *str, int len);
/* int GetSize();*/
public:
int AppendString(const char *str);
int AddABuffer(void);
//int AppendString(const char * str);
//int AppendString(const char * str);
public:
int AppendOtherOne(AppendBuffer *other);
public:
void Reset(void);
};
} // namespace DmapCore_30
#endif // __AppendBuffer_h__