|
|
@ -19,7 +19,8 @@ Payload::Payload( string basedir ) { |
|
|
|
}; |
|
|
|
|
|
|
|
void Payload::scan_dir_recursively( const fs::path& directory, list<fs::path> &paths) { |
|
|
|
fs::recursive_directory_iterator iter(directory), end; |
|
|
|
fs::recursive_directory_iterator iter(directory); |
|
|
|
fs::recursive_directory_iterator end; |
|
|
|
for (; iter != end; ++iter) { |
|
|
|
fs::path subdir = iter->path(); |
|
|
|
paths.push_back( subdir ); |
|
|
@ -32,10 +33,9 @@ list<string> Payload::get_all_relative_paths() { |
|
|
|
list<string> strpaths; |
|
|
|
fs::path directory(this->basedir + "/data"); |
|
|
|
Payload::scan_dir_recursively( directory, paths); |
|
|
|
list<fs::path>::iterator i; |
|
|
|
for (i=paths.begin(); i!= paths.end(); i++) { |
|
|
|
if (fs::is_regular_file( *i )) { |
|
|
|
fs::path relpath = fs::relative((*i), this->basedir); |
|
|
|
for (auto & path : paths) { |
|
|
|
if (fs::is_regular_file( path )) { |
|
|
|
fs::path relpath = fs::relative(path, this->basedir); |
|
|
|
strpaths.push_back( relpath.string() ); |
|
|
|
} |
|
|
|
} |
|
|
@ -47,10 +47,9 @@ list<string> Payload::get_all_absolute_paths() { |
|
|
|
list<string> strpaths; |
|
|
|
fs::path directory(this->basedir + "/data"); |
|
|
|
Payload::scan_dir_recursively( directory, paths); |
|
|
|
list<fs::path>::iterator i; |
|
|
|
for (i=paths.begin(); i!= paths.end(); i++) { |
|
|
|
if (fs::is_regular_file( *i )) { |
|
|
|
strpaths.push_back( (*i).string() ); |
|
|
|
for (auto & path : paths) { |
|
|
|
if (fs::is_regular_file( path )) { |
|
|
|
strpaths.push_back( path.string() ); |
|
|
|
} |
|
|
|
} |
|
|
|
return strpaths; |
|
|
|