📄 edit.h
字号:
#ifndef EDIT_H
#define EDIT_H
void Edit()
{
Print();
history=0;
while(1)
{
system("cls");
cout<<"历史操作记录:"<<endl;//显示历史记录,最多显示最近的10次
if(!history)
cout<<"无"<<endl<<endl;
else
{
int t=history;
fstream fhis("history.his",ios::in);
for(int i=0;i<history;i++)
{
if(history-i==10)
{
t=i;
break;
}
else if(t<10)
break;
fhis>>historyStr;
}
t=history;
while(t>0)
{
fhis>>historyStr;
cout<<historyStr<<endl;
t--;
}
cout<<endl;
fhis.close();
}
cout<<"请操作:";
string temp;
cin>>temp;
if(temp=="ins"||temp=="i"||temp=="-ins"||temp=="-i")//对帮助菜单中的同一个功能给了多种命令形式
Insert();
else if(temp=="del"||temp=="d"||temp=="-del"||temp=="-d")
Delete();
else if(temp=="pos"||temp=="p"||temp=="-pos"||temp=="-p")
Position();
else if(temp=="rep"||temp=="r"||temp=="-rep"||temp=="-r")
Replace();
else if(temp=="tot"||temp=="t"||temp=="-tot"||temp=="-t")
Total();
else if(temp=="save"||temp=="s"||temp=="-save"||temp=="-s")
SaveFile();
else if(temp=="print"||temp=="pt"||temp=="v"||temp=="-print"||temp=="-pt"||temp=="-v")
Print();
else if(temp=="exit"||temp=="e"||temp=="-exit"||temp=="-e")
return;
else //错误处理
{
cout<<"操作有误!"<<endl;
system("pause");
}
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -