@@ -1680,24 +1680,28 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
16801680 return SEVERITY_INPUT_ERROR;
16811681 }
16821682
1683- cout << " Reading Data from " << ( ( FileName ().compare ( " -" ) == 0 ) ? " standard input" : FileName ().c_str () ) << " ...\n " ;
1683+ if ( _verbose || _errorCount || _warningCount ) {
1684+ cout << " Reading Data from " << ( ( FileName ().compare ( " -" ) == 0 ) ? " standard input" : FileName ().c_str () ) << " ...\n " ;
1685+ }
16841686
16851687 // Read header
16861688 rval = ReadHeader ( *in );
1687- cout << " \n HEADER read:" ;
1688- if ( rval < SEVERITY_WARNING ) {
1689- sprintf ( errbuf,
1690- " Error: non-recoverable error in reading header section. "
1691- " There were %d errors encountered. Rest of file is ignored.\n " ,
1692- _errorCount );
1693- _error.AppendToUserMsg ( errbuf );
1694- return rval;
1695- } else if ( rval != SEVERITY_NULL ) {
1696- sprintf ( errbuf, " %d ERRORS\t %d WARNINGS\n\n " ,
1697- _errorCount, _warningCount );
1698- cout << errbuf;
1699- } else {
1700- cout << endl;
1689+ if ( _verbose || _errorCount || _warningCount ) {
1690+ cout << " \n HEADER read:" ;
1691+ if ( rval < SEVERITY_WARNING ) {
1692+ sprintf ( errbuf,
1693+ " Error: non-recoverable error in reading header section. "
1694+ " There were %d errors encountered. Rest of file is ignored.\n " ,
1695+ _errorCount );
1696+ _error.AppendToUserMsg ( errbuf );
1697+ return rval;
1698+ } else if ( rval != SEVERITY_NULL ) {
1699+ sprintf ( errbuf, " %d ERRORS\t %d WARNINGS\n\n " ,
1700+ _errorCount, _warningCount );
1701+ cout << errbuf;
1702+ } else {
1703+ cout << endl;
1704+ }
17011705 }
17021706
17031707 if ( !FindDataSection ( *in ) ) {
@@ -1709,12 +1713,14 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
17091713 _errorCount = 0 ;
17101714 total_insts = ReadData1 ( *in );
17111715
1712- cout << " \n FIRST PASS complete: " << total_insts
1716+ if ( _verbose || _errorCount || _warningCount ) {
1717+ cout << " \n FIRST PASS complete: " << total_insts
17131718 << " instances created.\n " ;
1714- sprintf ( errbuf,
1715- " %d ERRORS\t %d WARNINGS\n\n " ,
1716- _errorCount, _warningCount );
1717- cout << errbuf;
1719+ sprintf ( errbuf,
1720+ " %d ERRORS\t %d WARNINGS\n\n " ,
1721+ _errorCount, _warningCount );
1722+ cout << errbuf;
1723+ }
17181724
17191725 // PASS 2
17201726 // This would be nicer if you didn't actually have to close the
@@ -1762,13 +1768,15 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
17621768 return _error.GreaterSeverity ( SEVERITY_WARNING );
17631769 }
17641770
1765- cout << " \n SECOND PASS complete: " << valid_insts
1771+ if ( _verbose || _errorCount || _warningCount ) {
1772+ cout << " \n SECOND PASS complete: " << valid_insts
17661773 << " instances valid.\n " ;
1767- sprintf ( errbuf,
1768- " %d ERRORS\t %d WARNINGS\n\n " ,
1769- _errorCount, _warningCount );
1770- _error.AppendToUserMsg ( errbuf );
1771- cout << errbuf;
1774+ sprintf ( errbuf,
1775+ " %d ERRORS\t %d WARNINGS\n\n " ,
1776+ _errorCount, _warningCount );
1777+ _error.AppendToUserMsg ( errbuf );
1778+ cout << errbuf;
1779+ }
17721780
17731781
17741782 // check for "ENDSTEP;" || "END-ISO-10303-21;"
@@ -1796,7 +1804,9 @@ Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
17961804 return _error.GreaterSeverity ( SEVERITY_WARNING );
17971805 }
17981806 CloseInputFile ( in2 );
1799- cout << " Finished reading file.\n\n " ;
1807+ if ( _verbose || _errorCount || _warningCount ) {
1808+ cout << " Finished reading file.\n\n " ;
1809+ }
18001810 return SEVERITY_NULL;
18011811}
18021812
0 commit comments