Commit 076e7b23 authored by Aleksandr Bakhshiev's avatar Aleksandr Bakhshiev
Browse files

Build compatibility fixes.

--HG--
branch : RunTimeLibsTest
parent 15a26476d5b1
......@@ -491,7 +491,7 @@ bool URuntimeLibrary::DelClass(const std::string &class_name)
Storage->DelClass(Storage->FindClassId(class_name));
}
for(auto it = ClassesStructures.begin(); it != ClassesStructures.end(); ++it)
for(vector<string>::iterator it = ClassesStructures.begin(); it != ClassesStructures.end(); ++it)
{
CurrentComponentStruct.Load(*it,"");
std::string search_name = CurrentComponentStruct.GetNodeAttribute("RTname");
......@@ -499,7 +499,7 @@ bool URuntimeLibrary::DelClass(const std::string &class_name)
{
ClassesStructures.erase(it);
std::string xml_path = LibPath +"/" + search_name + ".xml";
RDK::DeleteFile(xml_path.c_str());
RDK::RemoveFile(xml_path.c_str());
break;
}
}
......
......@@ -908,7 +908,7 @@ bool UStorage::AddClassToCollection(const std::string &new_class_name, const std
{
//
URuntimeLibrary *library = nullptr;
URuntimeLibrary *library = 0;
for(size_t i=0;i<CollectionList.size();i++)
{
......@@ -957,7 +957,7 @@ bool UStorage::AddClassToCollection(const std::string &new_class_name, const std
/// RT
bool UStorage::DelClassFromCollection(const std::string &class_name, const std::string &lib_name)
{
URuntimeLibrary *library = nullptr;
URuntimeLibrary *library = 0;
for(size_t i=0;i<CollectionList.size();i++)
{
......@@ -978,7 +978,7 @@ bool UStorage::CreateRuntimeCollection(const std::string &lib_name)
if(lib_name.empty())
return false;
if(GetCollection(lib_name) != nullptr)
if(GetCollection(lib_name) != 0)
return false;
//
......@@ -1053,7 +1053,7 @@ void UStorage::InitRTlibs(void)
if(RDK::FindFilesList(lib_path,"*",false,lib_names))
return;
for(int i = 0 ; i < lib_names.size(); i++)
for(size_t i = 0 ; i < lib_names.size(); i++)
{
LoadRuntimeCollection(lib_names[i]);
}
......@@ -1067,7 +1067,7 @@ bool UStorage::LoadRuntimeCollection(const std::string &lib_name)
return false;
// ?
if(GetCollection(lib_name) != nullptr)
if(GetCollection(lib_name) != 0)
return false;
//
......
......@@ -102,6 +102,34 @@ int CreateNewDirectory(const char* path)
return 0;
}
//
// ,
int DeleteDirectory(const char* path)
{
std::vector<std::string> results;
if(FindFilesList(path, "*", true, results) != 0)
return 1;
for(size_t i=0;i<results.size();i++)
if(RemoveFile((std::string(path)+"\\"+results[i]).c_str()) != 0)
return 2;
BOOL res=::RemoveDirectory(path);
if(!res)
return 3;
return 0;
}
//
int RemoveFile(const char* path)
{
BOOL res=::DeleteFile(path);
if(res)
return 0;
return 1;
}
//---------------------------------------------------------------------------
......
......@@ -113,7 +113,7 @@ int DeleteDirectory(const char* path)
}
//
int DeleteFile(const char* path)
int RemoveFile(const char* path)
{
QFile file(path);
if(!file.exists())
......
......@@ -43,7 +43,7 @@ RDK_LIB_TYPE int CreateNewDirectory(const char* path);
RDK_LIB_TYPE int DeleteDirectory(const char* path);
///
RDK_LIB_TYPE int DeleteFile(const char* path);
RDK_LIB_TYPE int RemoveFile(const char* path);
///
RDK_LIB_TYPE int FindFilesList(const std::string &path, const std::string &mask, bool isfile, std::vector<std::string> &results);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment