command += ",\nPATH text";
command += ",\nLastModified datetext";
command += ",\nLastRead datetext";
+ command += ",\nTopLevelNodeId text";
command += ",\nconstraint FK_PARENT foreign key (PARENT_ID) references ";
command += "FILES";
command += "(ID) on delete restrict on update restrict";
do
{
pos = str.find('\\');
- if (pos!=-1)
+ if ((int)pos!=-1)
{
str.replace(pos, 1, "/");
}
}
- while (pos!=-1);
+ while ((int)pos!=-1);
}
const std::string& searchParam,
const std::string& searchValue)
{
+ std::string av=attValue.c_str();
+ std::string sv=searchValue.c_str();
+ CleanName(av);
+ CleanName(sv);
+
std::string sql = "UPDATE FILES SET ";
sql += attName;
sql += " = '";
- sql += attValue;
+ sql += av;
sql += "' WHERE ";
sql += searchParam;
sql += " = '";
- sql += searchValue;
+ sql += sv;
sql += "'";
UPDATETIMESTAMPDB(sql);
}
//=====================================================================
- void TimestampDatabaseHandler::RemoveNode(const std::string& searchAtt, tree::Node* node)
+ void TimestampDatabaseHandler::RemoveNode(const std::string& searchAtt, const tree::Node* node)
{
int n=node->GetNumberOfChildren();
if(n>0)
{
RemoveFile(searchAtt,node->GetAttribute("FullFileName"));
}
+ else
+ {
+ DBRemove("TopLevelNodeId",node->GetAttribute("ID"));
+ }
}