src: file extension for header and source in config
header and source extensions are now in the projectsettings
This commit is contained in:
@@ -24,5 +24,11 @@
|
|||||||
<FrameworkSearchPaths>
|
<FrameworkSearchPaths>
|
||||||
<FrameworkSearchPath><!-- STRING: framework search path --></FrameworkSearchPath>
|
<FrameworkSearchPath><!-- STRING: framework search path --></FrameworkSearchPath>
|
||||||
</FrameworkSearchPaths>
|
</FrameworkSearchPaths>
|
||||||
|
|
||||||
|
<Extensions>
|
||||||
|
<HeaderExtensions><!-- STRING: extension for header/include e.g. .h --></HeaderExtensions>
|
||||||
|
<SourceExtensions><!-- STRING: extension for source e.g. .cpp --></SourceExtensions>
|
||||||
|
</Extensions>
|
||||||
|
|
||||||
</source>
|
</source>
|
||||||
</config>
|
</config>
|
||||||
|
|||||||
+2
-7
@@ -86,13 +86,8 @@ void Project::parseCode()
|
|||||||
// TODO: move this creation to another place (after projectsettings have been loaded)
|
// TODO: move this creation to another place (after projectsettings have been loaded)
|
||||||
if (!m_fileManager)
|
if (!m_fileManager)
|
||||||
{
|
{
|
||||||
std::vector<std::string> sourceExtensions;
|
std::vector<std::string> sourceExtensions = ProjectSettings::getInstance()->getSourceExtensions();
|
||||||
sourceExtensions.push_back(".cpp");
|
std::vector<std::string> includeExtensions = ProjectSettings::getInstance()->getHeaderExtensions();
|
||||||
sourceExtensions.push_back(".cc");
|
|
||||||
|
|
||||||
std::vector<std::string> includeExtensions;
|
|
||||||
includeExtensions.push_back(".h");
|
|
||||||
includeExtensions.push_back(".hpp");
|
|
||||||
|
|
||||||
m_fileManager = std::make_shared<FileManager>(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
m_fileManager = std::make_shared<FileManager>(sourcePaths, includePaths, sourceExtensions, includeExtensions);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "component/controller/SearchController.h"
|
#include "component/controller/SearchController.h"
|
||||||
|
|
||||||
#include "component/view/SearchView.h"
|
#include "component/view/SearchView.h"
|
||||||
#include "data/access/storageAccess.h"
|
#include "data/access/StorageAccess.h"
|
||||||
|
|
||||||
SearchController::SearchController(StorageAccess* storageAccess)
|
SearchController::SearchController(StorageAccess* storageAccess)
|
||||||
: m_storageAccess(storageAccess)
|
: m_storageAccess(storageAccess)
|
||||||
|
|||||||
@@ -30,3 +30,15 @@ bool ProjectSettings::setSourcePaths(const std::vector<std::string>& sourcePaths
|
|||||||
{
|
{
|
||||||
return setValues("source/SourcePaths/SourcePath", 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);
|
||||||
|
}
|
||||||
@@ -17,6 +17,10 @@ public:
|
|||||||
std::vector<std::string> getSourcePaths() const;
|
std::vector<std::string> getSourcePaths() const;
|
||||||
bool setSourcePaths(const std::vector<std::string>& sourcePaths);
|
bool setSourcePaths(const std::vector<std::string>& sourcePaths);
|
||||||
|
|
||||||
|
// extensions
|
||||||
|
std::vector<std::string> getHeaderExtensions() const;
|
||||||
|
std::vector<std::string> getSourceExtensions() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectSettings();
|
ProjectSettings();
|
||||||
ProjectSettings(const ProjectSettings&);
|
ProjectSettings(const ProjectSettings&);
|
||||||
|
|||||||
Reference in New Issue
Block a user