logic: source groups for project settings
* project can not have multiple source groups with different types * language of a project is now inferred from source groups * setting global NameHierarchy delimiter of first sourceGroup in project * added project settings migrations for source groups * Add Settings Migration classes (MoveKey, DeleteKey, Lambda) * Update sample projects with migrations * added method to config to retrieve sublevel key names * implemented recursive removing of keys in settings * moved project files out of top level * removed solution parsing code as it is not used anymore fortune cookie message = The secret of getting ahead is getting started.
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#include "project/SourceGroupFactory.h"
|
||||
|
||||
#include "project/SourceGroup.h"
|
||||
#include "project/SourceGroupFactoryModule.h"
|
||||
#include "settings/SourceGroupSettings.h"
|
||||
|
||||
std::shared_ptr<SourceGroupFactory> SourceGroupFactory::getInstance()
|
||||
{
|
||||
if (!s_instance)
|
||||
{
|
||||
s_instance = std::shared_ptr<SourceGroupFactory>(new SourceGroupFactory());
|
||||
}
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
void SourceGroupFactory::addModule(std::shared_ptr<SourceGroupFactoryModule> module)
|
||||
{
|
||||
m_modules.push_back(module);
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<SourceGroup>> SourceGroupFactory::createSourceGroups(std::vector<std::shared_ptr<SourceGroupSettings>> allSourceGroupSettings)
|
||||
{
|
||||
std::vector<std::shared_ptr<SourceGroup>> sourceGroups;
|
||||
for (std::shared_ptr<SourceGroupSettings> sourceGroupSettings: allSourceGroupSettings)
|
||||
{
|
||||
std::shared_ptr<SourceGroup> sourceGroup = createSourceGroup(sourceGroupSettings);
|
||||
if (sourceGroup)
|
||||
{
|
||||
sourceGroups.push_back(sourceGroup);
|
||||
}
|
||||
}
|
||||
return sourceGroups;
|
||||
}
|
||||
|
||||
std::shared_ptr<SourceGroup> SourceGroupFactory::createSourceGroup(std::shared_ptr<SourceGroupSettings> settings)
|
||||
{
|
||||
std::shared_ptr<SourceGroup> sourceGroup;
|
||||
|
||||
for (std::shared_ptr<SourceGroupFactoryModule> module: m_modules)
|
||||
{
|
||||
if (module->supports(settings->getType()))
|
||||
{
|
||||
sourceGroup = module->createSourceGroup(settings);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return sourceGroup;
|
||||
}
|
||||
|
||||
std::shared_ptr<SourceGroupFactory> SourceGroupFactory::s_instance;
|
||||
|
||||
SourceGroupFactory::SourceGroupFactory()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user