⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memfile.h

📁 fax engine 传真引擎 relay fax 的开源项目 商业软件使用 高质量 高可靠
💻 H
字号:
/*****************************************************************************
* RelayFax Open Source Project
* Copyright 1996-2004 Alt-N Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the RelayFax Open 
* Source License.  A copy of this license is available in file LICENSE 
* in the top-level directory of the distribution.
*
* RelayFax is a registered trademark of Alt-N Technologies, Ltd.
*
* Individual files and/or contributed packages may be copyright by
* other parties and subject to additional restrictions.
*****************************************************************************/

#ifndef MEMFILE_H
#define MEMFILE_H

// CMemFile - unnamed memory mapped file implementation

class CMemFile
{
public:
	CMemFile();
	~CMemFile();

	enum CMemFileContants {MaxSize = 1000000};

	void MarkDataPtr( bool bStart ) { if(bStart) {m_dataPtr = 0; m_dataLen = 0;} m_dataMark = bStart; };
	int ReadPage( TIFF* in, int nEncodeType );
	unsigned char* GetData( unsigned int nOffset ) { return m_buf + m_dataPtr + nOffset; };
	unsigned int GetDataLen( void ) { return m_dataLen; };
	void Clear() { m_off = 0; m_size = 0; m_dataPtr = 0; m_dataLen = 0; };
	void AddDataByte( unsigned char b);

	unsigned int Seek( unsigned int offset, int whence );
	int Read( void *buf, int size );
	int Write( void* buf, int size );
	unsigned int Size(void) { return m_size; };

	int Close(void);

protected:
	unsigned char *m_buf;        /* Memory for each open buf */
	unsigned int m_off;    /* File pointer for each buf */
	unsigned int m_size;   /* Count of bytes allocated for each buf */
	HANDLE m_hMapping;
	unsigned int m_dataPtr;
	unsigned int m_dataLen;
	bool m_dataMark;

};


#endif //MEMFILE_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -