if (parent)
{
int nC = parent->RemoveChildrenFromList(node);
- if(nC>0)
+ if(nC>0 && parent->GetLevel()>0)
{
std::stringstream out;
out <<nC;
// std::cout << "DELETE OK"<<std::endl;
return true;
}
-
- //========================================================================
-
-
//=====================================================================
command = "create table LEVELS\n";
command += "( Name text )\n";
UPDATEDB(command);
-
+ int l;
// Iterate the Levels
- for (int l=0; l<GetTree().GetNumberOfLevels(); ++l)
+ for (l=0; l<GetTree().GetNumberOfLevels(); l++)
{
command = "INSERT INTO LEVELS (Name) VALUES ('";
command += GetTree().GetLevelDescriptor(l).GetName();
sql += " = '";
sql += searchVal;
sql += "'";
+ std::cout<<sql<<std::endl;
UPDATEDB(sql);
}
//=====================================================================
}
+ //=====================================================================
+ 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,