00001 00011 #include "coutUtils.h" 00012 00013 void coutUtils::flush() { 00014 fflush( stdout ); 00015 } 00016 00017 void coutUtils::newline() { 00018 cout << endl; 00019 flush(); 00020 } 00021 00022 void coutUtils::newline( int x ) { 00023 for (int i=0; i<x; i++) 00024 newline(); 00025 flush(); 00026 } 00027 00028 void coutUtils::printUnderline( string x ) { 00029 int len = x.length(); 00030 string sub( len, '=' ); 00031 cout << x << endl << sub << endl; 00032 flush(); 00033 } 00034 00035 void coutUtils::print( string x ) { 00036 cout << x << endl; 00037 flush(); 00038 } 00039 00040 void coutUtils::printInt( string x, int y ) { 00041 cout << x << "\t" << y << endl; 00042 flush(); 00043 } 00044 00045 void coutUtils::printDouble( string x, double y ) { 00046 cout << x << "\t" << y << endl; 00047 flush(); 00048 }