std::vector<std::string>::const_iterator i;
for (i=filenames.begin();i!=filenames.end();++i)
{
- mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0));
+ mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0),mCurrentDB);
mProgress.IncNumberScannedFiles();
if (IsHandledFile(*i))
{
mProgress.IncNumberHandledFiles();
- mSynchronizer->InsertAddOp((*i),"0","1");
- std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",(*i));
+ mSynchronizer->InsertAddOp((*i),"0","1",mCurrentDB);
+ std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",(*i),mCurrentDB);
std::stringstream removedOn;
removedOn<<time(0);
- mSynchronizer->InsertIgnoreFile(addKey,(*i),"0",removedOn.str());
+ mSynchronizer->InsertIgnoreFile(addKey,(*i),"0",removedOn.str(),mCurrentDB);
AddFile(*i);
}
mProgressSignal(mProgress);
std::stringstream rec;
rec<<recurse;
- mSynchronizer->InsertAddOp(directory,rec.str(),"0");
- std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",directory);
+ mSynchronizer->InsertAddOp(directory,rec.str(),"0",mCurrentDB);
+ std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",directory,mCurrentDB);
AddDirectoryRecursor( directory, recurse, addKey );
int nFiles=GetProgress().GetNumberAddedFiles();
files<<nFiles;
- mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",files.str(),"ADD_KEY",addKey);
+ mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",files.str(),"ADD_KEY",addKey,mCurrentDB);
GimmickDebugMessage(3,mProgress<<std::endl);
}
{
std::string path=node->GetAttribute("FullFileName");
//Gets the add key
- std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path);
+ std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
//Gets the number of files added
- int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey)).c_str());
+ int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey,mCurrentDB)).c_str());
files=files-1;
std::stringstream out;
out<<files;
//Sets the new number of files
- mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey);
+ mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
//Sets the file as removed
- mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH",path);
+ mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
}
}
{
std::string path=(*it)->GetAttribute("FullFileName");
//Gets the add key
- std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path);
+ std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
//Gets the number of files added
- int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey)).c_str());
+ int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey,mCurrentDB)).c_str());
files=files-1;
std::stringstream out;
out<<files;
//Sets the new number of files
- mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey);
+ mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
//Sets the file as removed
- mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH",path);
+ mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
}
}
else
{
std::string parent_id;
- bool valid=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0));
+ bool valid=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
if(valid)
{
mProgress.IncNumberScannedFiles();
mTimestampHandler->SetAttribute("TopLevelNodeId",parent_id,"PATH",itr->string());
std::stringstream removedOn;
removedOn<<time(0);
- mSynchronizer->InsertIgnoreFile(addKey, itr->string(),"0",removedOn.str());
+ mSynchronizer->InsertIgnoreFile(addKey, itr->string(),"0",removedOn.str(),mCurrentDB);
}
mProgressSignal(mProgress);
if (mProgress.GetStop())
std::vector<AddList>::iterator iter;
//Gets the list of added files
- mSynchronizer->GetFileList(fileList);
+ mSynchronizer->GetFileList(fileList,mCurrentDB);
std::vector<std::string>::iterator i;
//Actions to take if the user doesn't want to repair
//For the new files, add them
for (i=newFiles.begin();i!=newFiles.end();++i)
{
- mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0));
+ mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0),mCurrentDB);
if (IsHandledFile(*i))
{
std::stringstream removedOn;
removedOn<<time(0);
- mSynchronizer->InsertIgnoreFile((*iter).key,(*i),"0",removedOn.str());
+ mSynchronizer->InsertIgnoreFile((*iter).key,(*i),"0",removedOn.str(),mCurrentDB);
//Gets the number of files added
- int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",(*iter).key)).c_str());
+ int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",(*iter).key,mCurrentDB)).c_str());
files=files+1;
std::stringstream out;
out<<files;
//Sets the new number of files
- mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",(*iter).key);
+ mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",(*iter).key,mCurrentDB);
AddFile(*i);
}
}