/** * @brief From root, build tree, return lowest level node creating * @param aBase Where to start building from. * @param aStringHierarchy */ Root* Parser::SetUpTree(Root* aBase, std::vector<HashString> const &aStringHierarchy) { Root* current = aBase; Root* ret = nullptr; for(unsigned i = 0; i < aStringHierarchy.size(); ++i) { Root* next = current->Find(aStringHierarchy[i]); if(!next) { next = new Root(); current->Insert(next); next->SetParent(current); next->SetName(aStringHierarchy[i]); } ret = next; current = next; } return ret; }