AppendBuffer.h 1.4 KB
/**************************************************************************
* 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__