diff --git a/script/download_python_indexer.sh b/script/download_python_indexer.sh index 16e3be56..6a07e7c1 100755 --- a/script/download_python_indexer.sh +++ b/script/download_python_indexer.sh @@ -1,6 +1,6 @@ #!/bin/bash -SOURCETRAIL_PYTHON_INDEXER_VERSION="v1_db25_p5" +SOURCETRAIL_PYTHON_INDEXER_VERSION="v1_db25_p6" # Determine current platform PLATFORM='unknown' diff --git a/src/lib/data/indexer/TaskExecuteCustomCommands.cpp b/src/lib/data/indexer/TaskExecuteCustomCommands.cpp index 7ca9356e..dddafab3 100644 --- a/src/lib/data/indexer/TaskExecuteCustomCommands.cpp +++ b/src/lib/data/indexer/TaskExecuteCustomCommands.cpp @@ -73,7 +73,7 @@ void TaskExecuteCustomCommands::runPythonPostProcessing(PersistentStorage& stora return; } - std::shared_ptr textAccess = TextAccess::createFromFile(filePath); + std::shared_ptr textAccess = storage.getFileContent(filePath, false); if (textAccess) { std::map> childToParentNodesMap; diff --git a/src/lib/utility/text/TextAccess.cpp b/src/lib/utility/text/TextAccess.cpp index 92f686ed..d7f64de1 100644 --- a/src/lib/utility/text/TextAccess.cpp +++ b/src/lib/utility/text/TextAccess.cpp @@ -21,7 +21,7 @@ std::istream& safeGetline(std::istream& is, std::string& t) while (true) { - int c = sb->sbumpc(); + const int c = sb->sbumpc(); switch (c) { case '\n': @@ -77,8 +77,6 @@ std::shared_ptr TextAccess::createFromLines( return result; } -TextAccess::~TextAccess() {} - unsigned int TextAccess::getLineCount() const { return static_cast(m_lines.size()); @@ -142,7 +140,7 @@ std::vector TextAccess::readFile(const FilePath& filePath) try { std::ifstream srcFile; - srcFile.open(filePath.str()); + srcFile.open(filePath.str(), std::ios::binary | std::ios::in); if (srcFile.fail()) { diff --git a/src/lib/utility/text/TextAccess.h b/src/lib/utility/text/TextAccess.h index 1b3dbf78..0f7dc4e3 100644 --- a/src/lib/utility/text/TextAccess.h +++ b/src/lib/utility/text/TextAccess.h @@ -16,7 +16,7 @@ public: static std::shared_ptr createFromLines( const std::vector& lines, const FilePath& filePath = FilePath()); - virtual ~TextAccess(); + virtual ~TextAccess() = default; unsigned int getLineCount() const; bool isEmpty() const;