-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiledata.cpp
41 lines (40 loc) · 954 Bytes
/
filedata.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 "filedata.h"
#include <algorithm>
#include <iostream>
// get file paths
std::vector<File> FileData::getPaths()
{
return paths;
}
// set paths as one list at a time
void FileData::setPaths(std::vector<File> paths)
{
this->paths = paths;
}
// add a single path to list
void FileData::addPath(File path)
{
paths.push_back(path);
}
// reset paths to fix a problem
void FileData::pathReset()
{
this->paths.clear();
}
// get size of list aka number of paths
size_t FileData::getNumberOfPaths()
{
return paths.size();
}
// sort paths by timr
// this is needed for later when renaming
// the paths must be in order of time stamp
// since files can be read in any order
// the names won't be correct unless sorted
// by propery thing your renaming by
void FileData::sortByTime()
{
// using std sort, pass in start and end of vector
// and method to tell how to sort it
std::sort(paths.begin(), paths.end(), FileCMP());
}