Browse Source

- init store()

master
Andreas Romeyke 3 years ago
parent
commit
32989b7e2c
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      src/lib/payload.cpp

+ 17
- 0
src/lib/payload.cpp View File

@ -59,6 +59,23 @@ bool Payload::validate( list<string> & log ) {
bool Payload::store( string basedir ) {
string newbasedir = basedir + "data/";
fs::path p{ newbasedir };
fs::file_status s = fs::status( p );
if (fs::is_directory( s)) {
// TODO: Payload::log << "directory '" << newbasedir << "'already exists" << endl;
cout << "directory '" << newbasedir << "'already exists" << endl;
return false;
}
fs::create_directory(p);
list<string> paths = Payload::get_all_relative_paths();
for (string relpath : paths) {
string sourcepath = Payload::basedir + relpath;
string targetpath = newbasedir + relpath;
cout << "map '" << sourcepath << "' to '" << targetpath << "'" <<endl;
}
return false;
}
// vim: set tabstop=4

Loading…
Cancel
Save