data: NameHierarchy class
* replaced vector of strings as name hierarchy by a new NameHierarchy class. * Adjusted code in ASTVisitor, Storage and various test cases.
This commit is contained in:
@@ -51,12 +51,12 @@ const std::string& SearchIndex::getWord(Id wordId) const
|
||||
return m_dictionary.getWord(wordId);
|
||||
}
|
||||
|
||||
SearchNode* SearchIndex::addNode(std::vector<std::string> nameHierarchy)
|
||||
SearchNode* SearchIndex::addNode(NameHierarchy nameHierarchy)
|
||||
{
|
||||
std::deque<Id> nameIds;
|
||||
for (const std::string& name: nameHierarchy)
|
||||
for (int i = 0; i < nameHierarchy.size(); i++)
|
||||
{
|
||||
nameIds.push_back(m_dictionary.getWordId(name));
|
||||
nameIds.push_back(m_dictionary.getWordId(nameHierarchy[i]->getFullName()));
|
||||
}
|
||||
if (nameIds.size())
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "utility/text/Dictionary.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
#include "data/name/NameHierarchy.h"
|
||||
#include "data/search/SearchNode.h"
|
||||
|
||||
class SearchIndex
|
||||
@@ -25,7 +26,7 @@ public:
|
||||
Id getWordId(const std::string& word);
|
||||
const std::string& getWord(Id wordId) const;
|
||||
|
||||
SearchNode* addNode(std::vector<std::string> nameHierarchy);
|
||||
SearchNode* addNode(NameHierarchy nameHierarchy);
|
||||
SearchNode* getNode(const std::string& fullName) const;
|
||||
SearchNode* getNode(const SearchNode* searchNode) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user