- std::string val=value.c_str();
- std::string sVal=searchValue.c_str();
- CleanName(val);
- CleanName(sVal);
- std::string sql = "UPDATE ";
- sql+=table;
- sql+=" SET ";
- sql += attribute;
- sql += " = '";
- sql += val;
- sql += "' WHERE ";
- sql += searchParam;
- sql += " = '";
- sql += sVal;
- if(table.compare("ADD_OPS")==0)
+ std::string val=value.c_str();
+ std::string sVal=searchValue.c_str();
+ CleanName(val);
+ CleanName(sVal);
+ std::string sql = "UPDATE ";
+ sql+=table;
+ sql+=" SET ";
+ sql += attribute;
+ sql += " = '";
+ sql += val;
+ sql += "' WHERE ";
+ sql += searchParam;
+ sql += " = '";
+ sql += sVal;
+ if(table.compare("ADD_OPS")==0)
+ {
+ sql += "' AND REFERENCEDDB = '";
+ sql += refdb;
+ }
+ sql += "';";
+ UPDATESYNCDB(sql);
+ }
+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+ // get the files name to ignore for a add operation synchronization
+ // @param : the add key
+ //@result : list (path) of ignore files
+ /////////////////////////////////////////////////////////////////////////////////////////////////
+ void Synchronizer::GetList()
+ {
+ mList.clear();
+ std::vector<std::string> i_names;
+ std::string query = "SELECT PATH, REMOVE FROM IGNORED_FILES";
+ CppSQLite3Query res;
+ QUERYSYNCDB(query, res);
+ while (!res.eof())
+ {
+ std::string file(res.getStringField(0));
+ std::string ignore(res.getStringField(1));
+ mList[file] = ignore == "0"? true : false;
+ res.nextRow();
+ }
+ }
+
+ bool Synchronizer::isIndexed(const std::string filename)
+ {
+ bool valid = true;
+ std::string name(filename);
+ boost::algorithm::replace_all( name,"\\" , "/");
+ std::map <std::string, bool>::iterator it_list = mList.begin();
+ for(;it_list != mList.end(); it_list++)