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

📄 hfile.h

📁 枚举主机网络设备
💻 H
字号:
// HFile.h: interface for the CHFile class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HFILE_H__15DB0702_30E7_4139_B22B_655C13170DA9__INCLUDED_)
#define AFX_HFILE_H__15DB0702_30E7_4139_B22B_655C13170DA9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "HString.h"

struct AFX_EXT_CLASS CHFileStatus
{
	LONG m_size;            // logical size of file in bytes
	BYTE m_attribute;       // logical OR of CFile::Attribute enum values
	BYTE m_padding;        // pad the structure to a WORD
	TCHAR m_szFullName[MAX_PATH]; // absolute path name
};

class AFX_EXT_CLASS CHFile  
{
public:
// Flag values
	enum OpenFlags {
		modeRead =          0x0000,
		modeWrite =         0x0001,
		modeReadWrite =     0x0002,
		shareCompat =       0x0000,
		shareExclusive =    0x0010,
		shareDenyWrite =    0x0020,
		shareDenyRead =     0x0030,
		shareDenyNone =     0x0040,
		modeNoInherit =     0x0080,
		modeCreate =        0x1000,
		modeNoTruncate =    0x2000,
		typeText =          0x4000, // typeText and typeBinary are used in
		typeBinary =   (int)0x8000 // derived classes only
		};

	enum Attribute {
		normal =    0x00,
		readOnly =  0x01,
		hidden =    0x02,
		system =    0x04,
		volume =    0x08,
		directory = 0x10,
		archive =   0x20
		};

	enum SeekPosition { begin = 0x0, current = 0x1, end = 0x2 };
public:
	CHFile();
	CHFile(CHString strFileName, UINT nOpenFlags);
	CHFile(char *szFileName, UINT nOpenFlags);
	virtual ~CHFile();
public:
	DWORD SeekToEnd();
	DWORD SeekToBegin();
	void SetLength(DWORD dwNewLen);
	DWORD GetPosition();
	LONG Seek( LONG lOff, UINT nFrom );
	DWORD ReadHuge( void* lpBuffer, DWORD dwCount );
	LONG Write( const void* lpBuf, UINT nCount );
	LONG WriteHuge(const void *lpBuf, DWORD nCount);
	BOOL Close();
	UINT Read( void* lpBuf, UINT nCount );
	INT64 GetLength();
	BOOL Open(CHString strFileName, UINT nOpenFlags);
	BOOL Open(char *szFileName, UINT nOpenFlags);
	static BOOL Remove(char *szFileName );
	static BOOL Remove(CHString strFileName );
	static BOOL GetStatus( char *szFileName, CHFileStatus& rStatus );
	static BOOL GetStatus(CHString strFileName, CHFileStatus& rStatus );

protected:
	HANDLE m_hFile;
	CHString m_strFileName;
	BOOL m_bCloseOnDelete;
};

#endif // !defined(AFX_HFILE_H__15DB0702_30E7_4139_B22B_655C13170DA9__INCLUDED_)

⌨️ 快捷键说明

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