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
+3 -3
View File
@@ -74,7 +74,7 @@ void SqliteIndexStorage::addFile(const int id, const std::string& filePath, cons
return;
}
std::shared_ptr<TextAccess> content = TextAccess::createFromFile(filePath);
std::shared_ptr<TextAccess> content = TextAccess::createFromFile(FilePath(filePath));
const size_t lineCount = content->getLineCount();
const bool success = executeStatement(
@@ -589,7 +589,7 @@ std::shared_ptr<TextAccess> SqliteIndexStorage::getFileContentByPath(const std::
LOG_ERROR(std::to_string(e.errorCode()) + ": " + e.errorMessage());
}
return TextAccess::createFromFile(filePath);
return TextAccess::createFromFile(FilePath(filePath));
}
void SqliteIndexStorage::setFileComplete(bool complete, Id fileId)
@@ -1176,7 +1176,7 @@ std::vector<StorageError> SqliteIndexStorage::doGetAll<StorageError>(const std::
if (lineNumber != -1 && columnNumber != -1)
{
errors.push_back(StorageError(id, message, filePath, lineNumber, columnNumber, fatal, indexed));
errors.push_back(StorageError(id, message, FilePath(filePath), lineNumber, columnNumber, fatal, indexed));
id++;
}