예제 #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;
}
예제 #2
0
파일: Folder.cpp 프로젝트: Scindix/Litheora
 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);
 }