From b72584559cb360f7a66009819327f6dbf7366f39 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 1 Jul 2014 11:13:27 +0200 Subject: [PATCH] data: Renamed Global to GlobalVariable in Graph --- src/lib/data/Storage.cpp | 2 +- src/lib/data/graph/Node.cpp | 6 +++--- src/lib/data/graph/Node.h | 2 +- src/test/CxxParserTestSuite.h | 18 +++++++++--------- src/test/GraphTestSuite.h | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/data/Storage.cpp b/src/lib/data/Storage.cpp index 7e3bdf3e..32d21924 100644 --- a/src/lib/data/Storage.cpp +++ b/src/lib/data/Storage.cpp @@ -50,7 +50,7 @@ void Storage::onGlobalVariableParsed(const ParseLocation& location, const ParseV log("global", variable.fullName, location); Node* node = m_graph.createNodeHierarchy(variable.fullName); - node->setType(Node::NODE_GLOBAL); + node->setType(Node::NODE_GLOBAL_VARIABLE); node->setConst(variable.isConst); node->setStatic(variable.isStatic); diff --git a/src/lib/data/graph/Node.cpp b/src/lib/data/graph/Node.cpp index 57f8f062..00ab9850 100644 --- a/src/lib/data/graph/Node.cpp +++ b/src/lib/data/graph/Node.cpp @@ -163,7 +163,7 @@ bool Node::isConst() const void Node::setConst(bool isConst) { - if (isConst && m_type != NODE_GLOBAL && m_type != NODE_FIELD && m_type != NODE_METHOD) + if (isConst && m_type != NODE_GLOBAL_VARIABLE && m_type != NODE_FIELD && m_type != NODE_METHOD) { LOG_ERROR("Setting const on wrong node of type " + getTypeString(m_type)); return; @@ -179,7 +179,7 @@ bool Node::isStatic() const void Node::setStatic(bool isStatic) { - if (isStatic && m_type != NODE_GLOBAL && m_type != NODE_FIELD && m_type != NODE_METHOD) + if (isStatic && m_type != NODE_GLOBAL_VARIABLE && m_type != NODE_FIELD && m_type != NODE_METHOD) { LOG_ERROR("Setting static on wrong node of type " + getTypeString(m_type)); return; @@ -198,7 +198,7 @@ std::string Node::getTypeString(NodeType type) const return "class"; case NODE_STRUCT: return "struct"; - case NODE_GLOBAL: + case NODE_GLOBAL_VARIABLE: return "global"; case NODE_FIELD: return "field"; diff --git a/src/lib/data/graph/Node.h b/src/lib/data/graph/Node.h index c7e76f39..dc2b471d 100644 --- a/src/lib/data/graph/Node.h +++ b/src/lib/data/graph/Node.h @@ -17,7 +17,7 @@ public: NODE_UNDEFINED, NODE_CLASS, NODE_STRUCT, - NODE_GLOBAL, + NODE_GLOBAL_VARIABLE, NODE_FIELD, NODE_FUNCTION, NODE_METHOD, diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index 271de2ea..16c440f4 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -148,9 +148,9 @@ public: parser.parseFile(TextAccess::createFromString(text)); - TS_ASSERT_EQUALS(client->globals.size(), 2); - TS_ASSERT_EQUALS(client->globals[0], "int x <1:1 1:5>"); - TS_ASSERT_EQUALS(client->globals[1], "A * b <3:1 3:4>"); + TS_ASSERT_EQUALS(client->globalVariables.size(), 2); + TS_ASSERT_EQUALS(client->globalVariables[0], "int x <1:1 1:5>"); + TS_ASSERT_EQUALS(client->globalVariables[1], "A * b <3:1 3:4>"); } void test_cxx_parser_finds_variable_definitions_in_namespace_scope() @@ -167,9 +167,9 @@ public: parser.parseFile(TextAccess::createFromString(text)); - TS_ASSERT_EQUALS(client->globals.size(), 2); - TS_ASSERT_EQUALS(client->globals[0], "int n::x <2:2 2:6>"); - TS_ASSERT_EQUALS(client->globals[1], "n::A * n::b <4:2 4:5>"); + TS_ASSERT_EQUALS(client->globalVariables.size(), 2); + TS_ASSERT_EQUALS(client->globalVariables[0], "int n::x <2:2 2:6>"); + TS_ASSERT_EQUALS(client->globalVariables[1], "n::A * n::b <4:2 4:5>"); } void test_cxx_parser_finds_field_in_nested_class() @@ -493,7 +493,7 @@ public: TS_ASSERT_EQUALS(client->enumFields.size(), 2); TS_ASSERT_EQUALS(client->functions.size(), 2); TS_ASSERT_EQUALS(client->fields.size(), 4); - TS_ASSERT_EQUALS(client->globals.size(), 2); + TS_ASSERT_EQUALS(client->globalVariables.size(), 2); TS_ASSERT_EQUALS(client->methods.size(), 5); TS_ASSERT_EQUALS(client->namespaces.size(), 2); TS_ASSERT_EQUALS(client->structs.size(), 1); @@ -524,7 +524,7 @@ private: virtual void onGlobalVariableParsed(const ParseLocation& location, const ParseVariable& variable) { - globals.push_back(addLocationSuffix(variableStr(variable), location)); + globalVariables.push_back(addLocationSuffix(variableStr(variable), location)); } virtual void onFieldParsed(const ParseLocation& location, const ParseVariable& variable, AccessType access) @@ -575,7 +575,7 @@ private: std::vector enumFields; std::vector functions; std::vector fields; - std::vector globals; + std::vector globalVariables; std::vector methods; std::vector namespaces; std::vector structs; diff --git a/src/test/GraphTestSuite.h b/src/test/GraphTestSuite.h index dffd6816..fe4d280f 100644 --- a/src/test/GraphTestSuite.h +++ b/src/test/GraphTestSuite.h @@ -36,7 +36,7 @@ public: void test_get_and_set_const_and_static_of_nodes() { - Node n(Node::NODE_GLOBAL, "A"); + Node n(Node::NODE_GLOBAL_VARIABLE, "A"); TS_ASSERT(!n.isConst()); TS_ASSERT(!n.isStatic());