Example #1
0
// Costruttore
File::File(string fullpath, Folder& folder, size_t size, time_t timestamp, string h) :
    base_path(folder) {

  string name(fullpath, folder.getPath().length() + 1, string::npos);

  filename = name;
  this->size = size;
  this->timestamp = timestamp;
  hash = h;
  complete = false;
}
Example #2
0
 Folder::Folder(std::string p, Folder appBase)
 {
     std::string ppath;
     if(p.substr(0, PATH_SLASH.size()+1) == "." + PATH_SLASH)
         ppath = APP.basePath + appBase.getPath() + p.substr(2);
     else if(p.substr(0, PATH_ROOT.size()) != PATH_ROOT)
         ppath = APP.basePath + PATH_SLASH + p;
     else
         ppath = p;
     init(ppath);
 }