data: Added getName() method to Edge

format = EdgeType:fromNode->toNode
This commit is contained in:
Eberhard Graether
2014-07-27 02:22:45 +02:00
parent 473e26f072
commit b0e3cda41e
5 changed files with 56 additions and 17 deletions
+15 -2
View File
@@ -246,8 +246,21 @@ Id Storage::getIdForNodeWithName(const std::string& fullName) const
std::string Storage::getNameForNodeWithId(Id id) const
{
Node* node = m_graph.getNodeById(id);
return (node ? node->getFullName() : "");
Token* token = m_graph.getTokenById(id);
if (!token)
{
return "";
}
if (token->isEdge())
{
return dynamic_cast<Edge*>(token)->getName();
}
else
{
return dynamic_cast<Node*>(token)->getFullName();
}
}
std::vector<std::string> Storage::getNamesForNodesWithNamePrefix(const std::string& prefix) const