-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.cpp
More file actions
35 lines (31 loc) · 759 Bytes
/
process.cpp
File metadata and controls
35 lines (31 loc) · 759 Bytes
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
#include <iostream>
#include <string>
#include <filesystem>
#include "manager.h"
using namespace std;
namespace fs = filesystem;
void Processor::settings(string type, string name)
{
this->type = type;
this->name = name;
}
bool Processor::matcher(string filename)
{
if (type == "Type")
{
size_t dotPos = filename.find_last_of('.');
string item = filename.substr(dotPos + 1);
return (item == name);
}
else if (type == "Alphabets")
{
return (filename[0] == name[0]);
}
return -1;
}
void Processor::relocator(string curDir, string filename)
{
string currentPath = curDir + "/" + filename;
string newPath = curDir + "/" + name + "/" + filename;
fs::rename(currentPath, newPath);
}