| 172 | } |
| 173 | |
| 174 | uint8_t MetadataReader::GetNodeType(MetadataTreeNode *treeNode) { |
| 175 | if (treeNode->type == MetadataTreeNode::INVALID_TYPE) { |
| 176 | uint8_t nodeType; |
| 177 | |
| 178 | uint32_t offsetValue = treeNode->offsetValue; |
| 179 | |
| 180 | if (offsetValue == 0) { |
| 181 | nodeType = MetadataTreeNode::PACKAGE; |
| 182 | } else if ((0 < offsetValue) && (offsetValue < ARRAY_OFFSET)) { |
| 183 | nodeType = *(m_valueData + offsetValue); |
| 184 | } else if (offsetValue == ARRAY_OFFSET) { |
| 185 | nodeType = MetadataTreeNode::ARRAY; |
| 186 | } else { |
| 187 | uint16_t nodeId = offsetValue - ARRAY_OFFSET; |
| 188 | MetadataTreeNode * arrElemNode = GetNodeById(nodeId); |
| 189 | nodeType = *(m_valueData + arrElemNode->offsetValue); |
| 190 | } |
| 191 | |
| 192 | treeNode->type = nodeType; |
| 193 | } |
| 194 | |
| 195 | return treeNode->type; |
| 196 | } |
| 197 | |
| 198 | MetadataTreeNode *MetadataReader::GetOrCreateTreeNodeByName(const string &className) { |
| 199 | MetadataTreeNode * treeNode = GetRoot(); |
no outgoing calls
no test coverage detected