Skip to content
Permalink
Browse files

Added progress for loading yaml databases (#4441)

  • Loading branch information...
Lemongrass3110 committed Nov 5, 2019
1 parent 159ce4e commit 2cc4402b49f3351342508740dae69cd59b74a465
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/common/database.cpp
@@ -132,11 +132,18 @@ void YamlDatabase::parse( const YAML::Node& rootNode ){
uint64 count = 0;

if( this->nodeExists( rootNode, "Body" ) ){
for( const YAML::Node &node : rootNode["Body"] ){
const YAML::Node& bodyNode = rootNode["Body"];
size_t childNodesCount = bodyNode.size();
size_t childNodesProgressed = 0;
const char* fileName = this->currentFile.c_str();

for( const YAML::Node &node : bodyNode ){
count += this->parseBodyNode( node );

ShowStatus( "Loading [%zd/%zd] entries from '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\r", ++childNodesProgressed, childNodesCount, fileName );
}

ShowStatus("Done reading '" CL_WHITE "%" PRIu64 CL_RESET "' entries in '" CL_WHITE "%s" CL_RESET "'\n", count, this->currentFile.c_str());
ShowStatus( "Done reading '" CL_WHITE "%" PRIu64 CL_RESET "' entries in '" CL_WHITE "%s" CL_RESET "'" CL_CLL "\n", count, fileName );
}
}

0 comments on commit 2cc4402

Please sign in to comment.
You can’t perform that action at this time.