-
Notifications
You must be signed in to change notification settings - Fork 16
/
FileManager.cpp
52 lines (50 loc) · 973 Bytes
/
FileManager.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* FileManager.cpp
*
* Created on: 2018Äê1ÔÂ4ÈÕ
* Author: Administrator
*/
#include<direct.h>
#include"FileManager.h"
#include<windows.h>
string operinfo;
string fileManager::getPWD(){
char cPATH[1000];
GetCurrentDirectory(1000,cPATH);
curPATH.assign(cPATH);
return "true";
}
void fileManager::fixDirName(string& s){
for(string::iterator it = s.begin() ; it != s.end() ; ++it ){
if(*it == '/'){
*it = '\\';
}
if(*it == '\\'){
if(*(it+1)=='/'){
*(it+1)='\\';
}
if(*(it+1)!='\\'){
s.insert(it,'\\');
}
}
}
}
fileManager::fileManager(){
}
bool fileManager::open(string&name,ios_base::openmode opmode,string& info){
fstream of;
of.open(name,opmode);
return true;
}
bool fileManager::cd(string&,string& info){
return true;
}
string fileManager::mkdir(string&, string&info){
return "pwd";
}
string fileManager::ls()const{
return "pwd";
}
string pwd(){
return "pwd";
}