data: refactored file clearing on reparse to use TaskClearStorage
This commit is contained in:
@@ -23,12 +23,13 @@ class StorageAccess
|
||||
public:
|
||||
virtual ~StorageAccess();
|
||||
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const = 0;
|
||||
virtual Id getIdForEdgeWithName(const std::string& name) const = 0;
|
||||
virtual Id getIdForNodeWithNameHierarchy(const NameHierarchy& nameHierarchy) const = 0;
|
||||
virtual Id getIdForEdge(
|
||||
Edge::EdgeType type, const NameHierarchy& fromNameHierarchy, const NameHierarchy& toNameHierarchy) const = 0;
|
||||
|
||||
virtual std::vector<FileInfo> getInfoOnAllFiles() const = 0;
|
||||
|
||||
virtual std::string getNameForNodeWithId(Id id) const = 0;
|
||||
virtual NameHierarchy getNameHierarchyForNodeWithId(Id id) const = 0;
|
||||
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const = 0;
|
||||
virtual std::vector<SearchMatch> getAutocompletionMatches(
|
||||
const std::string& query, const std::string& word) const = 0;
|
||||
|
||||
@@ -32,21 +32,22 @@ void StorageAccessProxy::setSubject(StorageAccess* subject)
|
||||
m_subject = subject;
|
||||
}
|
||||
|
||||
Id StorageAccessProxy::getIdForNodeWithName(const std::string& name) const
|
||||
Id StorageAccessProxy::getIdForNodeWithNameHierarchy(const NameHierarchy& nameHierarchy) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getIdForNodeWithName(name);
|
||||
return m_subject->getIdForNodeWithNameHierarchy(nameHierarchy);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Id StorageAccessProxy::getIdForEdgeWithName(const std::string& name) const
|
||||
{
|
||||
Id StorageAccessProxy::getIdForEdge(
|
||||
Edge::EdgeType type, const NameHierarchy& fromNameHierarchy, const NameHierarchy& toNameHierarchy
|
||||
) const {
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getIdForEdgeWithName(name);
|
||||
return m_subject->getIdForEdge(type, fromNameHierarchy, toNameHierarchy);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -71,14 +72,14 @@ Node::NodeType StorageAccessProxy::getNodeTypeForNodeWithId(Id id) const
|
||||
return Node::NODE_UNDEFINED;
|
||||
}
|
||||
|
||||
std::string StorageAccessProxy::getNameForNodeWithId(Id id) const
|
||||
NameHierarchy StorageAccessProxy::getNameHierarchyForNodeWithId(Id id) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getNameForNodeWithId(id);
|
||||
return m_subject->getNameHierarchyForNodeWithId(id);
|
||||
}
|
||||
|
||||
return "";
|
||||
return NameHierarchy();
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> StorageAccessProxy::getAutocompletionMatches(
|
||||
|
||||
@@ -13,12 +13,13 @@ public:
|
||||
void setSubject(StorageAccess* subject);
|
||||
|
||||
// StorageAccess implementation
|
||||
virtual Id getIdForNodeWithName(const std::string& name) const;
|
||||
virtual Id getIdForEdgeWithName(const std::string& name) const;
|
||||
virtual Id getIdForNodeWithNameHierarchy(const NameHierarchy& nameHierarchy) const;
|
||||
virtual Id getIdForEdge(
|
||||
Edge::EdgeType type, const NameHierarchy& fromNameHierarchy, const NameHierarchy& toNameHierarchy) const;
|
||||
|
||||
virtual std::vector<FileInfo> getInfoOnAllFiles() const;
|
||||
|
||||
virtual std::string getNameForNodeWithId(Id id) const;
|
||||
virtual NameHierarchy getNameHierarchyForNodeWithId(Id id) const;
|
||||
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const;
|
||||
virtual std::vector<SearchMatch> getAutocompletionMatches(
|
||||
const std::string& query, const std::string& word) const;
|
||||
|
||||
Reference in New Issue
Block a user