00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00012
00013
00014
00016
00023 #if !defined(AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_)
00024 #define AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_
00025
00026 #if _MSC_VER > 1000
00027 #pragma once
00028 #endif // _MSC_VER > 1000
00029
00030 #include "ZipExport.h"
00034 class ZIP_API CZipAutoBuffer
00035 {
00036 public:
00037 operator char*()
00038 {
00039 return m_pBuffer;
00040 }
00041 #ifndef __BORLANDC__
00042 operator const char*() const
00043 {
00044 return m_pBuffer;
00045 }
00046 #endif
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 const char* GetBuffer() const {return m_pBuffer;}
00058 char* Allocate(DWORD iSize, bool bZeroMemory = false);
00059 void Release();
00060 DWORD GetSize() const
00061 {
00062 return m_iSize;
00063 }
00064 bool IsAllocated() const
00065 {
00066 return (m_pBuffer != NULL);
00067 }
00068 CZipAutoBuffer(DWORD iSize, bool bZeroMemory = false);
00069 CZipAutoBuffer();
00070 CZipAutoBuffer(const CZipAutoBuffer& buffer);
00071 virtual ~CZipAutoBuffer();
00072 CZipAutoBuffer& operator=(const CZipAutoBuffer& buffer);
00073 protected:
00074 char* m_pBuffer;
00075 DWORD m_iSize;
00076 };
00077
00078 #endif // !defined(AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_)
00079