File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -183,3 +183,12 @@ void Hierarchy::print(bool full) const
183183 std::cout << c << " " ;
184184 std::cout << " \n " ;
185185}
186+
187+ void Hierarchy::print_root_with_parent_id (hindex parent_id) const
188+ {
189+ for (auto item : root_items ())
190+ {
191+ if (item->parent_id () == parent_id)
192+ item->print_item (0 );
193+ }
194+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class Hierarchy
3333 std::set<std::string> get_root_countries () const ;
3434
3535 void print (bool full = true ) const ;
36+ void print_root_with_parent_id (hindex parent_id) const ;
3637
3738private:
3839 std::deque<std::shared_ptr<HierarchyItem> > root_items () const ;
Original file line number Diff line number Diff line change @@ -208,8 +208,8 @@ int main(int argc, char *argv[])
208208
209209 if (!found)
210210 {
211- std::cerr << " Missing parent with ID " << parent << " . Stopping import\n " ;
212- hierarchy.print ( false );
211+ std::cerr << " Missing parent with ID " << parent << " . Stopping import\n " ;
212+ hierarchy.print_root_with_parent_id (parent );
213213 return -1 ;
214214 }
215215
You can’t perform that action at this time.
0 commit comments