logic: Retrieving StorageNodes for Autocompletion and FileInfos for modification time at once
Had only a small impact on performance unfortunately.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "utility/types.h"
|
||||
#include "utility/file/FileInfo.h"
|
||||
#include "utility/file/FilePath.h"
|
||||
|
||||
#include "data/graph/Node.h"
|
||||
@@ -14,7 +15,6 @@
|
||||
#include "data/ErrorInfo.h"
|
||||
#include "data/StorageStats.h"
|
||||
|
||||
struct FileInfo;
|
||||
class Graph;
|
||||
class TextAccess;
|
||||
class TokenLocation;
|
||||
@@ -61,7 +61,9 @@ public:
|
||||
virtual std::shared_ptr<TokenLocationFile> getCommentLocationsInFile(const FilePath& filePath) const = 0;
|
||||
|
||||
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const = 0;
|
||||
virtual TimePoint getFileModificationTime(const FilePath& filePath) const = 0;
|
||||
|
||||
virtual FileInfo getFileInfoForFilePath(const FilePath& filePath) const = 0;
|
||||
virtual std::vector<FileInfo> getFileInfosForFilePaths(const std::vector<FilePath>& filePaths) const = 0;
|
||||
|
||||
virtual ErrorCountInfo getErrorCount() const = 0;
|
||||
virtual StorageStats getStorageStats() const = 0;
|
||||
|
||||
@@ -255,14 +255,24 @@ std::shared_ptr<TextAccess> StorageAccessProxy::getFileContent(const FilePath& f
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TimePoint StorageAccessProxy::getFileModificationTime(const FilePath& filePath) const
|
||||
FileInfo StorageAccessProxy::getFileInfoForFilePath(const FilePath& filePath) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getFileModificationTime(filePath);
|
||||
return m_subject->getFileInfoForFilePath(filePath);
|
||||
}
|
||||
|
||||
return TimePoint(boost::posix_time::not_a_date_time);
|
||||
return FileInfo();
|
||||
}
|
||||
|
||||
std::vector<FileInfo> StorageAccessProxy::getFileInfosForFilePaths(const std::vector<FilePath>& filePaths) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getFileInfosForFilePaths(filePaths);
|
||||
}
|
||||
|
||||
return std::vector<FileInfo>();
|
||||
}
|
||||
|
||||
ErrorCountInfo StorageAccessProxy::getErrorCount() const
|
||||
|
||||
@@ -48,7 +48,9 @@ public:
|
||||
virtual std::shared_ptr<TokenLocationFile> getCommentLocationsInFile(const FilePath& filePath) const;
|
||||
|
||||
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const;
|
||||
virtual TimePoint getFileModificationTime(const FilePath& filePath) const;
|
||||
|
||||
virtual FileInfo getFileInfoForFilePath(const FilePath& filePath) const;
|
||||
virtual std::vector<FileInfo> getFileInfosForFilePaths(const std::vector<FilePath>& filePaths) const;
|
||||
|
||||
virtual ErrorCountInfo getErrorCount() const;
|
||||
virtual StorageStats getStorageStats() const;
|
||||
|
||||
Reference in New Issue
Block a user