]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOSQLiteTreeHandler.cpp
Added attribute selection functionality.
[creaImageIO.git] / src2 / creaImageIOSQLiteTreeHandler.cpp
index 14bb3db2476d9f31ce80372afbe1993b2b21eb3d..596a92a17492e963abea3cabcd061ccb084549e4 100644 (file)
@@ -149,7 +149,7 @@ namespace creaImageIO
     if (parent)
       {
        int nC = parent->RemoveChildrenFromList(node);
-       if(nC>0)
+       if(nC>0 && parent->GetLevel()>0)
        {       
                std::stringstream out;
                out <<nC;
@@ -892,6 +892,7 @@ namespace creaImageIO
        sql += " = '";
     sql += searchVal;
        sql += "'";
+       std::cout<<sql<<std::endl;
     UPDATEDB(sql);
   }
    //=====================================================================
@@ -1080,6 +1081,33 @@ namespace creaImageIO
 
   }
 
+  //=====================================================================
+  void SQLiteTreeHandler::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 "<<i_table<<" WHERE "<<i_attribute<<" "<<i_operand<<" '"<<i_val<<"'";
+        UPDATEDB(query.str());
+       }
+
+       //=====================================================================
+  void SQLiteTreeHandler::BeginTransaction()
+    {
+               std::stringstream out;
+               out<<"begin transaction;";
+        UPDATEDB(out.str());
+       }
+
+       //=====================================================================
+  void SQLiteTreeHandler::EndTransaction()
+    {
+       std::stringstream out;
+               out<<"commit transaction;";
+        UPDATEDB(out.str());
+       }
+
   /*
   //=====================================================================
   bool SQLiteTreeHandler::DBInsert(Node* alien_node,