data: refreshing with DB
* database stores modification time of files. * FileManager updates internal state based on database info. * reimplemented FileManager's check if a file is in project. * implemented clearing data of updated or removed files before reparsing the updated and added files.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "data/graph/Node.h"
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
struct FileInfo;
|
||||
class Graph;
|
||||
class TokenLocation;
|
||||
class TokenLocationCollection;
|
||||
@@ -24,6 +25,8 @@ public:
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const = 0;
|
||||
virtual Id getIdForEdgeWithName(const std::string& name) const = 0;
|
||||
|
||||
virtual std::vector<FileInfo> getInfoOnAllFiles() const = 0;
|
||||
|
||||
virtual std::string getNameForNodeWithId(Id id) const = 0;
|
||||
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const = 0;
|
||||
virtual std::vector<SearchMatch> getAutocompletionMatches(
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "data/access/StorageAccessProxy.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
#include "data/graph/Graph.h"
|
||||
#include "data/location/TokenLocationCollection.h"
|
||||
#include "data/location/TokenLocationFile.h"
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/file/FileInfo.h"
|
||||
|
||||
StorageAccessProxy::StorageAccessProxy()
|
||||
: m_subject(nullptr)
|
||||
{
|
||||
@@ -51,6 +52,16 @@ Id StorageAccessProxy::getIdForEdgeWithName(const std::string& name) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<FileInfo> StorageAccessProxy::getInfoOnAllFiles() const
|
||||
{
|
||||
std::vector<FileInfo> fileInfos;
|
||||
if (hasSubject())
|
||||
{
|
||||
fileInfos = m_subject->getInfoOnAllFiles();
|
||||
}
|
||||
return fileInfos;
|
||||
}
|
||||
|
||||
Node::NodeType StorageAccessProxy::getNodeTypeForNodeWithId(Id id) const
|
||||
{
|
||||
if(hasSubject())
|
||||
|
||||
@@ -16,6 +16,8 @@ public:
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const;
|
||||
virtual Id getIdForEdgeWithName(const std::string& name) const;
|
||||
|
||||
virtual std::vector<FileInfo> getInfoOnAllFiles() const;
|
||||
|
||||
virtual std::string getNameForNodeWithId(Id id) const;
|
||||
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const;
|
||||
virtual std::vector<SearchMatch> getAutocompletionMatches(
|
||||
|
||||
Reference in New Issue
Block a user