diff options
author | leak <none@none> | 2010-12-19 17:06:33 +0100 |
---|---|---|
committer | leak <none@none> | 2010-12-19 17:06:33 +0100 |
commit | fd694cd2324a7e2d61d833a78024b68fd3605053 (patch) | |
tree | 2fb48411eb25ff627b56786b66c96dd646a30651 /src/server/shared/Utilities/ProgressBar.cpp | |
parent | 9c35e10444b24848e0a909c46727ac2a312ab5de (diff) |
Streamlining loading functions for server startup
- Added a couple of timer outputs
- Improved code consistency between loading functions
- Progess bars should look and behave similar on all OS now (sLog.outString() is not needed anymore to replace the progress bar in log files)
--HG--
branch : trunk
Diffstat (limited to 'src/server/shared/Utilities/ProgressBar.cpp')
-rwxr-xr-x | src/server/shared/Utilities/ProgressBar.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/server/shared/Utilities/ProgressBar.cpp b/src/server/shared/Utilities/ProgressBar.cpp index 6d6cdf893d1..01f467b798f 100755 --- a/src/server/shared/Utilities/ProgressBar.cpp +++ b/src/server/shared/Utilities/ProgressBar.cpp @@ -21,17 +21,7 @@ #include "ProgressBar.h" char const* const barGoLink::empty = " "; -#ifdef _WIN32 -char const* const barGoLink::full = "\x3D"; -#else char const* const barGoLink::full = "*"; -#endif - -barGoLink::~barGoLink() -{ - printf( "\n" ); - fflush(stdout); -} barGoLink::barGoLink( uint64 row_count ) { @@ -39,17 +29,9 @@ barGoLink::barGoLink( uint64 row_count ) rec_pos = 0; indic_len = 50; num_rec = row_count; - #ifdef _WIN32 - printf( "\x3D" ); - #else printf( "[" ); - #endif for (uint64 i = 0; i < indic_len; ++i) printf( empty ); - #ifdef _WIN32 - printf( "\x3D 0%%\r\x3D" ); - #else printf( "] 0%%\r[" ); - #endif fflush(stdout); } @@ -62,22 +44,20 @@ void barGoLink::step( void ) n = rec_no * indic_len / num_rec; if ( n != rec_pos ) { - #ifdef _WIN32 - printf( "\r\x3D" ); - #else printf( "\r[" ); - #endif for (i = 0; i < n; i++ ) printf( full ); for (; i < indic_len; i++ ) printf( empty ); float percent = (((float)n/(float)indic_len)*100); - #ifdef _WIN32 - printf( "\x3D %i%% \r\x3D", (int)percent); - #else printf( "] %i%% \r[", (int)percent); - #endif fflush(stdout); rec_pos = n; } + + if( num_rec == rec_no) + { + printf( "\n" ); + fflush(stdout); + } } |