X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOSynchron.cpp;h=74e9e98ced8fc532e9c0843a593098db249dce02;hb=c75c580a44a73829a735cc5f7a7fdce84ae8bcac;hp=136c29e7fcd190756e4edb5eeb226b132c50d355;hpb=8b74b6a37dfc8b8a3ebb4f9f8e4b46429da0e4c7;p=creaImageIO.git diff --git a/src2/creaImageIOSynchron.cpp b/src2/creaImageIOSynchron.cpp index 136c29e..74e9e98 100644 --- a/src2/creaImageIOSynchron.cpp +++ b/src2/creaImageIOSynchron.cpp @@ -11,7 +11,7 @@ namespace creaImageIO { //===================================================================== - #define QUERYSYNCDB(QUER,RES) \ + #define QUERYSYNCDB(QUER,RES) \ try \ { \ RES = mDB->execQuery(QUER.c_str()); \ @@ -23,7 +23,7 @@ namespace creaImageIO << e.errorMessage() ); \ } //===================================================================== - #define UPDATESYNCDB(UP) \ + #define UPDATESYNCDB(UP) \ try \ { \ mDB->execDML(UP.c_str()); \ @@ -146,7 +146,7 @@ namespace creaImageIO ///////////////////////////////////////////////////////////////////////////////////////////////// // remove an entry of the DB - //@param i_table : table where do the remove + //@param i_table : table where to do the remove // @param i_key : the add_key reference (one entry to remove for ADD_OP table, many for IGNORED_FILES table //@result : - ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -156,6 +156,24 @@ namespace creaImageIO UPDATESYNCDB(query); } + ///////////////////////////////////////////////////////////////////////////////////////////////// + // remove several entries of the DB + // @param i_table : table where to do the remove + // @param i_attribute: attribute to match + // @param i_operand : operand to use + // @param i_val : the reference + //@result : - + ///////////////////////////////////////////////////////////////////////////////////////////////// + void Synchronizer::RemoveEntries(const std::string i_table, + const std::string i_attribute, + const std::string i_operand, + const std::string i_val) + { + std::stringstream query; + query<<"DELETE FROM "<