PlotterHMI/datafile/dxf/dxflib/PDSMath/ZUBaseFile_Memory.h

63 lines
1.5 KiB
C
Raw Permalink Normal View History

// ZUBaseFile_Memory.h: interface for the CZUBaseFile_Memory class.
//
// Copyright (C) 2000 Tadeusz Dracz
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ZUBASEFILE_MEMORY_H__AEA985C0_D813_11D3_B7C7_8E2FB86D3347__INCLUDED_)
#define AFX_ZUBASEFILE_MEMORY_H__AEA985C0_D813_11D3_B7C7_8E2FB86D3347__INCLUDED_
#include "zlib.h"
#include "ZipException.h"
class CPtrList;
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// base class for CUnzipFile_Memory and CZipFile_Memory
class CZUBaseFile_Memory
{
public:
CZUBaseFile_Memory();
virtual ~CZUBaseFile_Memory();
// specify whether to control memory allocation and freeing by zlib library
// strongly suggested to set it to true (default)
bool m_bDetectZlibMemoryLeaks;
//<2F><><EFBFBD><EFBFBD><EFBFBD>ڴ濪ʼ<E6BFAA><CABC><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
void Seek(LONG lOff);
//<2F><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>
UINT Read(void* lpBuf, UINT nCount);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>ڴ<EFBFBD>
void Write(const void* lpBuf, UINT nCount);
//ƫ<><C6AB><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ڴ<EFBFBD>β<EFBFBD><CEB2>
void SeekToEnd();
//<2F>õ<EFBFBD><C3B5><EFBFBD>ǰƫ<C7B0><C6AB>λ<EFBFBD>õ<EFBFBD>λ<EFBFBD><CEBB>
DWORD GetPosition();
//<2F><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>
// <20>ڴ<EFBFBD><DAB4><EFBFBD>С
LONG WriteCloseMemory();
protected:
CPtrList m_list;
void CheckForError(int err);
void ThrowError(int err);
static void myfree(void* opaque, void* address);
static void* myalloc(void* opaque, UINT items, UINT size);
bool IsClosed();
//CFile* m_pFile;
bool m_bZipFile;
char *m_pBufferData;
LONG m_lDataOffset;
LONG m_lDataCount;
};
#endif // !defined(AFX_ZUBASEFILE_MEMORY_H__AEA985C0_D813_11D3_B7C7_8E2FB86D3347__INCLUDED_)