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

📄 clsfile.h

📁 My (so called) HiP compression algorithm as console mode utility. It s a hybrid of Lempel-Ziv 77 a
💻 H
字号:
/*****************************************************************************

  clsFILE
  -------

  This is a class for handling files and memory maps of them.

  by yoda

  WWW:      y0da.cjb.net
  E-mail:   LordPE@gmx.net

  You are allowed to use this source code in your own projects if you mention
  my name.

*****************************************************************************/

#ifndef __File_h__
#define __File_h__

#include <windows.h>

//
// constants
//
// modes for GetFileHandle
#define F_OPENEXISTING_R     0
#define F_OPENEXISTING_RW    1
#define F_CREATENEW          2
#define F_TRUNCATE           3

//
// clsFILE class
//
class clsFILE
{
public:
	clsFILE();
	~clsFILE();
	BOOL          GetFileHandle(char *szFilePath, DWORD dwMode);
	BOOL          GetFileHandleWithMaxAccess(char* szFilePath);
	BOOL          Destroy();
	void          InitVars();
	HANDLE        GetHandle();
	BOOL          IsFileReadOnly();
	BOOL          MapFile();
	void*         GetMapPtr();
	BOOL          UnmapFile();
	BOOL          ReMapFile(DWORD dwNewSize);
	DWORD         GetMapSize();
	BOOL          IsMapped();
	DWORD         GetFSize();
	BOOL          FlushFileMap();
	static BOOL   FileExists(char* szFilePath);
	char*         GetFilePath();
	BOOL          Write(void* pBuff, DWORD dwc);
	BOOL          Read(void* pBuff, DWORD dwc);
	BOOL          SetFPointer(DWORD dwOff);
	BOOL          Truncate();
	void          SetMapPtrSize(void* ptr, DWORD dwSize);

private:
	DWORD         dwMapSize;
	void          *pMap;
	BOOL          bReadOnly;
	HANDLE        hFile;
	char          cFilePath[MAX_PATH];
};

#endif

⌨️ 快捷键说明

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