#pragma once

//===========================================================================//
// File:	 Text Draw Buffer.h												 //
// Project:  gosGml				                                         //
// Contents: 																 //
//---------------------------------------------------------------------------//
// Date      Who    Modification                                             //
// 4/10/00   DP     Created													 //
//---------------------------------------------------------------------------//
// Copyright (C) 2000 Microsoft Corp.						                 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//

const int BufferLen=8192;

class TextDrawBuffer;
typedef void (TextDrawBufferAppendFailFunction)(TextDrawBuffer* Text);

class TextDrawBuffer{
	public:
		TextDrawBuffer(int BufferSize=BufferLen); //create buffer
		~TextDrawBuffer();
		void SetAppendFailFunction(TextDrawBufferAppendFailFunction*);
		int FreeSpace();
		int UsedSpace();
		char* ExportBuffer();//you must delete this ptr when you're done
		void Append(char*,int);
		void ClearBuffer();//redundant with constructor. If it breaks look here.
		void PreInsert(char* Text,int Len);

	private:
		//TextDrawBuffer();//call me not
		TextDrawBuffer(TextDrawBuffer&);//don't call this
		TextDrawBuffer& operator= (TextDrawBuffer const &); //don't call the assignment operator
		TextDrawBufferAppendFailFunction* AppendFailFunction;
		char* Buffer;//this is our buffer
		int BufferPos; //position in buffer
		int BufferMax;
};