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

📄 filesystem.h

📁 简单文件管理系统
💻 H
字号:


class FileSystem
{

public :
	   FileSystem();
	   ~FileSystem();
	   VRESULT run();

private :

   struct node
   {
	   char   filename[8];                  /*结点名字,即文件或目录名字*/
	   int    isdir;                        /*为文件或目录,0为文件,1为目录*/
	   struct node *child;                /*指向孩子结点的指针*/
	   struct node *sibling;              /*指向兄弟结点的指针*/
   } N;    /*二叉树节点结构体*/

private :

    struct node *newnode;                  /*创建结点时指针*/
    struct node *temp;                     /*活动的指针*/
    struct node *temp2;                    /*活动的指针*/
    struct node *temp3;                    /*活动的指针*/
    struct node *temp4;                    /*活动的指针*/
    struct node *root;                        /*指向根结点(hqy)的指针*/
    
	char currentpath[10][8];              /*当前路径*/
    char inputpath[10][8];                 /*输入的路径*/
    char stdorder[8][5];
                                       /*标准命令库*/
    char orderline[50];                    /*从键盘上获得命令行,包括命令和路径*/  
    char order[5];                         /*输入的命令*/
    char path[10][8];                      /*存放所有路径,为完全路径*/
    char newname[8];                       /*新文件或目录的名字*/
    int i,j;                               /*用作循环计数*/
    int orderflag;                         /*命令的标志,从0到6依次为cd,edit,del,dir,md,rd,exit*/
    int pathflag;                          /*路径的标志,分别用-2、-1、0、1、5表示
										  最后一个名字为新文件或目录、错误或无效的路径、
                                          正确的相对路径、正确的完全路径、没有输入路径*/
    FILE *pFile ;
	/********************************************************/
/*函数声明*/
   private :
      
	   VRESULT print_title();/*打印版本信息*/
       VRESULT getnewnode();/*申请新的节点空间*/
       VRESULT initialization();/*初始化*/
       VRESULT order_path_explain();/*命令和路径解释部分,将命令和路径分离出来*/
       VRESULT test();/*对路径进行分析,返回不同的PATHFLAG及path,如果有的话还有newname*/
       VRESULT error(int wrongnumber);/*错误情况报告*/
       VRESULT cdmodule();/*CD模块*/
       VRESULT editmodule();/*EDIT模块*/
       VRESULT delmodule();/*DEL模块*/
       VRESULT dirmodule();/*DIR模块*/
	   VRESULT mdmodule();/*MD模块*/
       VRESULT rdmodule();/*RD模块*/
	   VRESULT helpmodule();//帮助模块
       VRESULT print_currentpath();/*打印当前路径,附带打印'〉'*/
       VRESULT path_currentpath();/*path复制到当前路径中*/
       VRESULT currentpath_path();/*把当前目录存入PATH中*/
       VRESULT inputpath_path();/*把输入的路径存入path中*/
       VRESULT current_input_path();/*把当前路径和输入的路径连接起来存入path中*/
       VRESULT current_input_1_path();/*把当前路径和输入的路径(除掉最后一个)连接起来存入path中*/
       VRESULT find();/*查找路径在二叉树中的位置*/
       VRESULT set_into_table(int r);/*将新节点插入到目录树*/
       VRESULT del_from_table();/*将指定的节点从目录树中删除*/
       VRESULT print_table();/*打印指定的目录下的文件或目录*/
       VRESULT areyousure();/*确定删除目录及内容*/
       VRESULT reclaim();/*把指针temp,temp2复位,inputpath,newname,orderline,order,path清空*/
       VRESULT exit_command();
	   VRESULT printCurrentTime();
};

⌨️ 快捷键说明

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