Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 3bd4d0e6 authored by vlad_burin's avatar vlad_burin
Browse files

The directory for the library folders (RTlibs and MockLibs folders)

now is set via the .ini file

--HG--
branch : MockCompsTest
parent 73e15b92c16f
......@@ -141,6 +141,8 @@ int UAppCore<ApplicationT, EngineControlT, ProjectT, ServerControlT, TestManager
useNewXmlFormatProjectFile=atoi(projectIniFile("General","UseNewXmlFormatProjectFile","0"));
useNewProjectFilesStructure=atoi(projectIniFile("General","UseNewProjectFilesStructure","0"));
std::string librariesPath=projectIniFile("General", "LibrariesPath", "../../../");
databaseMainPath=projectIniFile("General","DatabaseMainPath","");
remoteFtpDatabasePath=projectIniFile("General","RemoteFtpDatabasePath","");
......@@ -171,6 +173,7 @@ int UAppCore<ApplicationT, EngineControlT, ProjectT, ServerControlT, TestManager
application.SetDebugMode(logDebugMode);
application.SetLibrariesPath(librariesPath);
application.SetConfigsMainPath(configsMainPath);
application.ChangeUseNewXmlFormatProjectFile(useNewXmlFormatProjectFile);
application.ChangeUseNewProjectFilesStructure(useNewProjectFilesStructure);
......
......@@ -105,6 +105,20 @@ bool UApplication::SetConfigsMainPath(const std::string &value)
return true;
}
/// ( - MockLibs, RTlibs)
const std::string& UApplication::GetLibrariesPath(void) const
{
return LibrariesPath;
}
bool UApplication::SetLibrariesPath(const std::string &value)
{
if(LibrariesPath == value)
return true;
LibrariesPath=value;
return true;
}
/// ( /Bin/Configs)
const std::string& UApplication::GetDatabaseMainPath(void) const
{
......@@ -540,6 +554,7 @@ bool UApplication::Init(void)
Core_LoadFonts();
EngineControl->Init();
RDK::GetCoreLock()->SetLibrariesPath(LibrariesPath);
UApplication::SetNumChannels(1);
// MCore_ChannelInit(0,0,(void*)ExceptionHandler);
......@@ -556,8 +571,6 @@ bool UApplication::Init(void)
}*/
SetStandartXMLInCatalog();
AppIsInit = true;
return true;
}
......
......@@ -50,6 +50,9 @@ std::string WorkDirectory;
/// ( /Bin/Configs)
std::string ConfigsMainPath;
/// ( - MockLibs, RTlibs)
std::string LibrariesPath;
/// ( /Database)
std::string DatabaseMainPath;
......@@ -159,6 +162,10 @@ bool SetConfigsMainPath(const std::string &value);
const std::string& GetDatabaseMainPath(void) const;
bool SetDatabaseMainPath(const std::string &value);
/// ( - MockLibs, RTLibs)
const std::string& GetLibrariesPath(void) const;
bool SetLibrariesPath(const std::string &value);
/// ( /Bin/Models)
const std::string& GetModelsMainPath(void) const;
bool SetModelsMainPath(const std::string &value);
......
......@@ -1122,7 +1122,7 @@ bool UStorage::CreateRuntimeCollection(const std::string &lib_name)
}
//
std::string lib_path = "../../../RTlibs/" + lib_name;
std::string lib_path = LibrariesPath + "RTlibs/" + lib_name;
URuntimeLibrary* lib=new URuntimeLibrary(lib_name,"", lib_path);
......@@ -1212,15 +1212,27 @@ bool UStorage::DeleteRuntimeCollection(const std::string &lib_name)
}
}
//
void UStorage::SetLibrariesPath(const std::string& value)
{
LibrariesPath = value;
}
//
const std::string UStorage::GetLibrariesPath() const
{
return LibrariesPath;
}
///
/// Engine
void UStorage::InitRTlibs(void)
{
// RTlibs
std::string lib_path = "../../../RTlibs";
std::string lib_path = LibrariesPath + "RTlibs";
// ,
if(RDK::CreateNewDirectory("../../../RTlibs/"))
if(RDK::CreateNewDirectory(lib_path.c_str()))
return;
// xml
......@@ -1256,7 +1268,7 @@ bool UStorage::LoadRuntimeCollection(const std::string &lib_name)
}
//
std::string lib_path = "../../../RTlibs/" + lib_name;
std::string lib_path = LibrariesPath + "RTlibs/" + lib_name;
URuntimeLibrary* lib = new URuntimeLibrary(lib_name,"",lib_path);
......@@ -1330,8 +1342,8 @@ bool UStorage::DelCollection(int index)
bool UStorage::InitMockLibs(void)
{
// -
std::string lib_path = "../../../MockLibs/";
std::string lib_list_file = "../../../MockLibs/0_LibList.xml";
std::string lib_path = LibrariesPath + "/MockLibs/";
std::string lib_list_file = lib_path + "0_LibList.xml";
USerStorageXML LibList;
if(!LibList.LoadFromFile(lib_list_file,"LibraryList"))
......@@ -1390,7 +1402,7 @@ bool UStorage::CreateMockLibs(void)
if(lib && lib->GetType()==0)
{
// ,
std::string lib_path = "../../../MockLibs/";
std::string lib_path = LibrariesPath + "MockLibs/";
if(RDK::CreateNewDirectory(lib_path.c_str()))
{
......@@ -1454,7 +1466,7 @@ bool UStorage::SaveMockLibs(void)
}
}
std::string file_name = "../../../MockLibs/0_LibList.xml";
std::string file_name = LibrariesPath + "MockLibs/0_LibList.xml";
LibList.SaveToFile(file_name);
return true;
}
......
......@@ -147,6 +147,9 @@ int BuildMode;
// - Property MockUNet
std::list<funcCrPropMock> FunctionsCrPropMock;
// ( MockLibs RTlibs)
std::string LibrariesPath;
protected: //
......@@ -331,6 +334,12 @@ void GetLibsNameListByType(std::string &buffer, int type) const;
//
//virtual bool AddClass(UContainer *newclass);
//
void SetLibrariesPath(const std::string& value);
//
const std::string GetLibrariesPath() const;
// RT-
///
/// Engine . CollectionList ( )
......
......@@ -66,6 +66,18 @@ int URdkCoreManager::GetStorageBuildMode()
return StorageBuildMode;
}
//
void URdkCoreManager::SetLibrariesPath(const std::string& value)
{
LibrariesPath = value;
}
//
const std::string URdkCoreManager::GetLibrariesPath(void) const
{
return LibrariesPath;
}
//
const char* URdkCoreManager::GetSystemDir(void)
{
......@@ -633,6 +645,7 @@ int URdkCoreManager::ChannelCreate(int index)
}
//
StorageList[index]->SetBuildMode(StorageBuildMode);
StorageList[index]->SetLibrariesPath(LibrariesPath);
EnvironmentList[index]=FuncCreateNewEnvironment();
if(!EnvironmentList[index])
......
......@@ -80,6 +80,15 @@ void SetStorageBuildMode(int mode);
//
int GetStorageBuildMode();
//
std::string LibrariesPath;
//
void SetLibrariesPath(const std::string& value);
//
const std::string GetLibrariesPath() const;
// ----------------------------------------------------------
//
// ----------------------------------------------------------
......
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