-
Notifications
You must be signed in to change notification settings - Fork 1
/
FileOrganizer.h
70 lines (58 loc) · 1.53 KB
/
FileOrganizer.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// FileOrganizer.cpp : Defines the entry point for the console application.
//
#ifndef FILEORGANIZER_H
#define FILEORGANIZER_H
#include <string>
#include <iostream>
#include <vector>
#include "WindowsVer.h"
#include "LinuxVer.h"
#ifdef _WIN32
#define PLATFORM_NAME "Windows 32-bit"
#elif defined __unix || __unix__
#define PLATFORM_NAME "Unix"
#elif defined __APPLE__ || __MACH__
#define PLATFORM_NAME "Mac OSX"
#elif defined __linux__
#define PLATFORM_NAME "Linux"
#elif defined __FreeBSD__
#define PLATFORM_NAME "FreeBSD"
#else
#define PLATFORM_NAME "Other"
#endif
using namespace std;
string getSystemType() {
return (PLATFORM_NAME == NULL) ? "" : PLATFORM_NAME;
}
int mainFunc(bool permission, string * currStringArr, int sizeOfArr)
{
if (permission) {
try {
//cout << "currStringArr: " << currStringArr[0] << endl;
}
catch (exception except) {
cout << except.what() << endl;
}
vector<string> currentLocations;
for (int loc = 0; loc < sizeOfArr; loc++) {
currentLocations.push_back(currStringArr[loc]);
}
for (int loc = 0; loc < currentLocations.size(); loc++) {
cout << currentLocations.at(loc) << endl;
}
cout << getSystemType() << endl;
if (getSystemType().find("Windows") != string::npos) {
#ifdef _WIN32
mainWindowFunc(getSystemType(), currentLocations);
#endif
}
else if (getSystemType().find("Unix") != string::npos) {
#ifdef __unix
mainLinuxFunc(getSystemType());
#endif
}
}
return 0;
}
#else
#endif