-
Notifications
You must be signed in to change notification settings - Fork 0
/
CompareWDir.cpp
41 lines (41 loc) · 912 Bytes
/
CompareWDir.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
#include <iostream>
#include <fstream>
#include "wrs/WFolder/dirmanip"
using std::cout;
using std::cin;
using std::endl;
using std::string;
using wrs::WDir;
using wrs::getPath;
int main()
{
string x, y, line;
WDir dir1, dir2;
cout << "Folder 1: ";
cin >> x;
cout << "Folder 2: ";
cin >> y;
getDirContent(x, dir1);
getDirContent(y, dir2);
if (dir1 == dir2)
cout << "The two folders have the same names of files and folders.";
else
cout << "The folders have one, or more and/or all folders and files differents";
cout << endl;
#ifdef WIN32
#define PAUSE 1
#else
#define PAUSE 0
#endif
if(PAUSE==1)
system("pause");
else
system("read -p");
cout << endl << "Folder 1: " << endl << dir1 << endl << "Folder 2: " << endl << dir2 << endl;
cout << "Path: ";
cout << getPath(dir1) << endl;
for (int i = 0; i < dir2.size(); i++)
cout << getPath(dir2[i]) << endl;
cout << "Fim!\n";
return 0;
}