
#ifndef __CSTREAM_H__
#define __CSTREAM_H__

#include "exception.h"
#include "cstring.h"


class V2_CLASS_API CStream
{
public:
	CStream(int p_iBufSize=0, int p_iGrowBy=512);
	~CStream();

	void Clear(void);
	int AppendData(const char *p_pData, int p_iSize);
	int AppendData(const CString &p_sStr);
	int AppendLine(const CString &p_sStr);
	char *GetData(void) { return m_pData; }
	int GetSize(void) { return m_iSize; }
	char *GetBuffer(int p_iBufSize);
	void ReleaseBuffer(int p_iSize=-1);

private:
	int m_iSize;
	int m_iBufSize;
	int m_iGrowBy;
	char *m_pData;
};

#endif	// __CSTREAM_H__
