40 lines
850 B
C++
40 lines
850 B
C++
// Buffer.h: interface for the CBuffer class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_)
|
|
#define AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
#include <windows.h>
|
|
class CBuffer
|
|
{
|
|
// Attributes
|
|
protected:
|
|
PBYTE m_pBase;
|
|
PBYTE m_pPtr;
|
|
UINT m_nSize;
|
|
|
|
|
|
// Methods
|
|
protected:
|
|
UINT ReAllocateBuffer(UINT nRequestedSize);
|
|
UINT DeAllocateBuffer(UINT nRequestedSize);
|
|
UINT GetMemSize();
|
|
public:
|
|
void ClearBuffer();
|
|
|
|
UINT Read(PBYTE pData, UINT nSize);
|
|
BOOL Write(PBYTE pData, UINT nSize);
|
|
UINT GetBufferLen();
|
|
|
|
PBYTE GetBuffer(UINT nPos=0);
|
|
|
|
CBuffer();
|
|
virtual ~CBuffer();
|
|
};
|
|
|
|
#endif // !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_)
|