Added progress for loading yaml databases (#4441)

This commit is contained in:
Lemongrass3110 2019-11-05 17:10:17 +01:00 committed by GitHub
parent 159ce4e3cd
commit 2cc4402b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 );
}
}