bool fileList::updatefile(file& oldFile, file& updFile) { for(list<fileList::entry>::iterator it=filelst.begin(); it!=filelst.end(); ++it) { if(it->getpath()==oldFile.getpath()) { it->setpath(updFile.getpath()); return true; } } return false; }
bool fileList::checkfile(file& chkFile) { fileList::entry e; e.setpath(chkFile.getpath()); for(list<fileList::entry>::iterator it=filelst.begin(); it!=filelst.end(); ++it) { if(it->getpath()==chkFile.getpath()) { return true; } } return false; }
bool fileList::addfile(file& newFile) { fileList::entry e; e.setpath(newFile.getpath()); filelst.push_back(e); return true; }
bool fileList::removefile(file& delFile) { for(list<fileList::entry>::iterator it=filelst.begin(); it!=filelst.end(); ++it) { if(it->getpath()==delFile.getpath()) { filelst.erase(it); return true; } } return false; }