#include "SourceGroupSettingsCxx.h" #include "ProjectSettings.h" #include "ConfigManager.h" #include "utility.h" SourceGroupSettingsCxx::SourceGroupSettingsCxx(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings) : SourceGroupSettings(id, type, projectSettings) , m_headerSearchPaths(std::vector()) , m_frameworkSearchPaths(std::vector()) , m_compilerFlags(std::vector()) { } void SourceGroupSettingsCxx::load(std::shared_ptr config) { SourceGroupSettings::load(config); const std::string key = s_keyPrefix + getId(); setHeaderSearchPaths(config->getValuesOrDefaults(key + "/header_search_paths/header_search_path", std::vector())); setFrameworkSearchPaths(config->getValuesOrDefaults(key + "/framework_search_paths/framework_search_path", std::vector())); setCompilerFlags(config->getValuesOrDefaults(key + "/compiler_flags/compiler_flag", std::vector())); } void SourceGroupSettingsCxx::save(std::shared_ptr config) { SourceGroupSettings::save(config); const std::string key = s_keyPrefix + getId(); config->setValues(key + "/header_search_paths/header_search_path", getHeaderSearchPaths()); config->setValues(key + "/framework_search_paths/framework_search_path", getFrameworkSearchPaths()); config->setValues(key + "/compiler_flags/compiler_flag", getCompilerFlags()); } bool SourceGroupSettingsCxx::equals(std::shared_ptr other) const { std::shared_ptr otherCxx = std::dynamic_pointer_cast(other); return ( otherCxx && SourceGroupSettings::equals(other) && utility::isPermutation(m_headerSearchPaths, otherCxx->m_headerSearchPaths) && utility::isPermutation(m_frameworkSearchPaths, otherCxx->m_frameworkSearchPaths) && utility::isPermutation(m_compilerFlags, otherCxx->m_compilerFlags) ); } std::vector SourceGroupSettingsCxx::getHeaderSearchPaths() const { return m_headerSearchPaths; } std::vector SourceGroupSettingsCxx::getHeaderSearchPathsExpandedAndAbsolute() const { return m_projectSettings->makePathsExpandedAndAbsolute(getHeaderSearchPaths()); } void SourceGroupSettingsCxx::setHeaderSearchPaths(const std::vector& headerSearchPaths) { m_headerSearchPaths = headerSearchPaths; } std::vector SourceGroupSettingsCxx::getFrameworkSearchPaths() const { return m_frameworkSearchPaths; } std::vector SourceGroupSettingsCxx::getFrameworkSearchPathsExpandedAndAbsolute() const { return m_projectSettings->makePathsExpandedAndAbsolute(getFrameworkSearchPaths()); } void SourceGroupSettingsCxx::setFrameworkSearchPaths(const std::vector& frameworkSearchPaths) { m_frameworkSearchPaths = frameworkSearchPaths; } std::vector SourceGroupSettingsCxx::getCompilerFlags() const { return m_compilerFlags; } void SourceGroupSettingsCxx::setCompilerFlags(const std::vector& compilerFlags) { m_compilerFlags = compilerFlags; }