src: file extension for header and source in config

header and source extensions are now in the projectsettings
This commit is contained in:
Andreas Stallinger
2015-03-18 15:48:59 +01:00
parent e3f1f004a0
commit 69ea6adddd
5 changed files with 25 additions and 8 deletions
@@ -24,5 +24,11 @@
<FrameworkSearchPaths>
<FrameworkSearchPath><!-- STRING: framework search path --></FrameworkSearchPath>
</FrameworkSearchPaths>
<Extensions>
<HeaderExtensions><!-- STRING: extension for header/include e.g. .h --></HeaderExtensions>
<SourceExtensions><!-- STRING: extension for source e.g. .cpp --></SourceExtensions>
</Extensions>
</source>
</config>
+2 -7
View File
@@ -86,13 +86,8 @@ void Project::parseCode()
// TODO: move this creation to another place (after projectsettings have been loaded)
if (!m_fileManager)
{
std::vector<std::string> sourceExtensions;
sourceExtensions.push_back(".cpp");
sourceExtensions.push_back(".cc");
std::vector<std::string> includeExtensions;
includeExtensions.push_back(".h");
includeExtensions.push_back(".hpp");
std::vector<std::string> sourceExtensions = ProjectSettings::getInstance()->getSourceExtensions();
std::vector<std::string> includeExtensions = ProjectSettings::getInstance()->getHeaderExtensions();
m_fileManager = std::make_shared<FileManager>(sourcePaths, includePaths, sourceExtensions, includeExtensions);
}
@@ -1,7 +1,7 @@
#include "component/controller/SearchController.h"
#include "component/view/SearchView.h"
#include "data/access/storageAccess.h"
#include "data/access/StorageAccess.h"
SearchController::SearchController(StorageAccess* storageAccess)
: m_storageAccess(storageAccess)
+12
View File
@@ -30,3 +30,15 @@ bool ProjectSettings::setSourcePaths(const std::vector<std::string>& sourcePaths
{
return setValues("source/SourcePaths/SourcePath", sourcePaths);
}
std::vector<std::string> ProjectSettings::getHeaderExtensions() const
{
std::vector<std::string> defaultValues;
return getValues("source/Extensions/HeaderExtensions", defaultValues);
}
std::vector<std::string> ProjectSettings::getSourceExtensions() const
{
std::vector<std::string> defaultValues;
return getValues("source/Extensions/SourceExtensions", defaultValues);
}
+4
View File
@@ -17,6 +17,10 @@ public:
std::vector<std::string> getSourcePaths() const;
bool setSourcePaths(const std::vector<std::string>& sourcePaths);
// extensions
std::vector<std::string> getHeaderExtensions() const;
std::vector<std::string> getSourceExtensions() const;
private:
ProjectSettings();
ProjectSettings(const ProjectSettings&);