📄 disk.h
字号:
// Disk.h: interface for the CDisk class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DISK_H__DFCA2BAF_C95D_46F7_ADBE_1D2E6BCE7AA0__INCLUDED_)
#define AFX_DISK_H__DFCA2BAF_C95D_46F7_ADBE_1D2E6BCE7AA0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TypeDlg.h"
#include "EditDlg.h"
typedef struct List{ //目录 共8个字节
char name[3]; //名字 3个字节
char postfix; //后缀 1个字节
byte type; //类型,1:根目录,2:目录、3:文件 1个字节
byte start; //文件开始逻辑地址,起始盘号 1字节
short int ilength; //存放文件长度 2个字节
}List;
class CDisk
{
public:
CDisk();
virtual ~CDisk();
private:
bool Seekroom(char name,int L_address[3],int big=2);
//寻找空间,在指定的盘 name 找指定的空间 big,L_address[3]为返回空闲地址
int LtoP(byte L_address); //逻辑地址转换成物理地址
public:
bool Fdisk(int num,char name[8],int big[8]); //初始化模拟硬盘
bool Create(char name[3],CString * strError,char potfix='e'); //创建文件.strError为传送错误信息
bool Makdir(char name[3],CString * strError); //创建文件夹.strError为传送错误信息
bool CD(char name[3],CString * strError); //进入下一层目录
bool Delete(char name[6],CString * strError); //删除文件
bool Rdir(char name[3],CString * strError); //删除空目录
bool Deldir(byte index,CString *strError); //删除非空或空目录的递归函数
bool Deldir(char name[3],CString * strError); //删除非空或空目录
bool Type(char name[6],CString str,CString * strError); //显示文件
bool Edit(char name[6],CString * strError); //编辑文件
bool Find(char name[6],CString *str,CString * strError);//查找文件
public:
CFile file; //文件指针
CByteArray load; //当前路径,第一个存盘号的索引(0-8)
byte byinfo[128]; //分配表信息
byte byRootnum; //根目录数,盘数
List Rootlist[8]; //根目录
List list; //目录
CTypeDlg tydlg; //显示文件对话框
CEditDlg eddlg; //编辑文件对话框
};
#endif // !defined(AFX_DISK_H__DFCA2BAF_C95D_46F7_ADBE_1D2E6BCE7AA0__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -