logic: reduce access to filesystem while indexing

* use canonical filepath cache in cxx indexer
* made constructors of FilePath explicit
* use FilePath at more places instead of string
* forward declares FilePath wherever possible
This commit is contained in:
malte_langkabel
2017-05-04 10:55:16 +02:00
parent 55d3f9c189
commit 054b8fab17
156 changed files with 656 additions and 444 deletions
+6 -5
View File
@@ -4,8 +4,9 @@
#include "data/location/SourceLocationCollection.h"
#include "data/location/SourceLocationFile.h"
#include "utility/logging/logging.h"
#include "utility/file/FileInfo.h"
#include "utility/file/FilePath.h"
#include "utility/logging/logging.h"
#include "utility/messaging/type/MessageShowErrors.h"
#include "utility/TimePoint.h"
@@ -224,11 +225,11 @@ std::shared_ptr<SourceLocationFile> StorageAccessProxy::getSourceLocationsForFil
return m_subject->getSourceLocationsForFile(filePath);
}
return std::make_shared<SourceLocationFile>("", false, false);
return std::make_shared<SourceLocationFile>(FilePath(), false, false);
}
std::shared_ptr<SourceLocationFile> StorageAccessProxy::getSourceLocationsForLinesInFile(
const std::string& filePath, uint firstLineNumber, uint lastLineNumber
const FilePath& filePath, uint firstLineNumber, uint lastLineNumber
) const
{
if (hasSubject())
@@ -236,7 +237,7 @@ std::shared_ptr<SourceLocationFile> StorageAccessProxy::getSourceLocationsForLin
return m_subject->getSourceLocationsForLinesInFile(filePath, firstLineNumber, lastLineNumber);
}
return std::make_shared<SourceLocationFile>("", false, false);
return std::make_shared<SourceLocationFile>(FilePath(), false, false);
}
std::shared_ptr<SourceLocationFile> StorageAccessProxy::getCommentLocationsInFile(const FilePath& filePath) const
@@ -246,7 +247,7 @@ std::shared_ptr<SourceLocationFile> StorageAccessProxy::getCommentLocationsInFil
return m_subject->getCommentLocationsInFile(filePath);
}
return std::make_shared<SourceLocationFile>("", false, false);
return std::make_shared<SourceLocationFile>(FilePath(), false, false);
}
std::shared_ptr<TextAccess> StorageAccessProxy::getFileContent(const FilePath& filePath) const