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,104 @@
|
||||
#include "settings/SourceGroupSettings.h"
|
||||
|
||||
#include "utility/utility.h"
|
||||
|
||||
SourceGroupSettings::SourceGroupSettings(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings)
|
||||
: m_id(id)
|
||||
, m_type(type)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
SourceGroupSettings::~SourceGroupSettings()
|
||||
{
|
||||
}
|
||||
|
||||
bool SourceGroupSettings::equals(std::shared_ptr<SourceGroupSettings> other) const
|
||||
{
|
||||
return (
|
||||
m_id == other->m_id &&
|
||||
m_type == other->m_type &&
|
||||
m_standard == other->m_standard &&
|
||||
utility::isPermutation(m_sourcePaths, other->m_sourcePaths) &&
|
||||
utility::isPermutation(m_excludePaths, other->m_excludePaths) &&
|
||||
utility::isPermutation(m_sourceExtensions, other->m_sourceExtensions)
|
||||
);
|
||||
}
|
||||
|
||||
std::string SourceGroupSettings::getId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
FilePath SourceGroupSettings::getProjectFileLocation() const
|
||||
{
|
||||
return m_projectSettings->getProjectFileLocation();
|
||||
}
|
||||
|
||||
FilePath SourceGroupSettings::makePathAbsolute(const FilePath& path) const
|
||||
{
|
||||
return m_projectSettings->makePathAbsolute(path);
|
||||
}
|
||||
|
||||
SourceGroupType SourceGroupSettings::getType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettings::getStandard() const
|
||||
{
|
||||
if (m_standard.empty())
|
||||
{
|
||||
return getDefaultStandard();
|
||||
}
|
||||
return m_standard;
|
||||
}
|
||||
|
||||
void SourceGroupSettings::setStandard(const std::string& standard)
|
||||
{
|
||||
m_standard = standard;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupSettings::getSourcePaths() const
|
||||
{
|
||||
return m_sourcePaths;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupSettings::getAbsoluteSourcePaths() const
|
||||
{
|
||||
return m_projectSettings->makePathsAbsolute(getSourcePaths());
|
||||
}
|
||||
|
||||
void SourceGroupSettings::setSourcePaths(const std::vector<FilePath>& sourcePaths)
|
||||
{
|
||||
m_sourcePaths = sourcePaths;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupSettings::getExcludePaths() const
|
||||
{
|
||||
return m_excludePaths;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupSettings::getAbsoluteExcludePaths() const
|
||||
{
|
||||
return m_projectSettings->makePathsAbsolute(getExcludePaths());
|
||||
}
|
||||
|
||||
void SourceGroupSettings::setExcludePaths(const std::vector<FilePath>& excludePaths)
|
||||
{
|
||||
m_excludePaths = excludePaths;
|
||||
}
|
||||
|
||||
std::vector<std::string> SourceGroupSettings::getSourceExtensions() const
|
||||
{
|
||||
if (m_sourceExtensions.empty())
|
||||
{
|
||||
return getDefaultSourceExtensions();
|
||||
}
|
||||
return m_sourceExtensions;
|
||||
}
|
||||
|
||||
void SourceGroupSettings::setSourceExtensions(const std::vector<std::string>& sourceExtensions)
|
||||
{
|
||||
m_sourceExtensions = sourceExtensions;
|
||||
}
|
||||
Reference in New Issue
Block a user