+
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+ // get the files name to ignore for a add operation synchronization
+ // @param : the add key
+ //@result : list (path) of ignore files
+ /////////////////////////////////////////////////////////////////////////////////////////////////
+ void Synchronizer::GetList(const std::string i_db)
+ {
+ mList.clear();
+ std::vector<std::string> i_names;
+ std::vector<std::string> keys;
+ CppSQLite3Query res;
+ std::string query ="SELECT ADD_KEY, REFERENCEDDB FROM ADD_OPS";
+ QUERYSYNCDB(query, res);
+ keys.clear();
+ while (!res.eof())
+ {
+ std::string key(res.getStringField(0));
+ std::string db(res.getStringField(1));
+ if (db == i_db)
+ {
+ keys.push_back(key);
+ }
+ res.nextRow();
+ }
+ query = "SELECT PATH, REMOVE FROM IGNORED_FILES WHERE";
+ if(keys.size() > 0)
+ {
+ for (int i=0; i < keys.size(); i++)
+ {
+ query += " ADD_KEY = " + keys[i];
+ query += " AND";
+ }
+ query = query.substr(0,query.size() - 4);
+ }
+ else
+ {
+ query += " ADD_KEY = -1";
+ }
+ 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++)
+ {
+ if(it_list->first == name)
+ {
+ valid = false;
+ break;
+ }
+ }
+ return valid;
+ }
+}
+
+