00001
00002
00003
00004
00005
00006 #include "mystreams.h"
00007 #include <strstream>
00008
00009 std::ostream& operator<<( std::ostream& os, char chars[] )
00010 {
00011 int i = 0 ;
00012 while( chars[ i ] != NULL )
00013 {
00014 os << chars[ i ] ;
00015 }
00016 return os ;
00017 }
00018
00019 void eatUntilClosing( istream& is, char opening, char closing )
00020 {
00021 int count = 1 ;
00022 while( count > 0 )
00023 {
00024 char character ;
00025 is >> character ;
00026 if( character == opening )
00027 {
00028 count++ ;
00029 }
00030 else if( character == closing )
00031 {
00032 count-- ;
00033 }
00034 }
00035 };
00036
00037 void eatwhite( std::istream& is )
00038 {
00039 static char white[] = "\r\n \t" ;
00040 char next = is.peek() ;
00041 while( strrchr( white, next ) != NULL )
00042 {
00043 is.get() ;
00044 next = is.peek() ;
00045 }
00046 };
00047