1 #include <stdio.h> 2 #include <covstream.h> 3 4 typedef CovStream::iterator cs_iterator; 5 typedef CovStream::token token; 6 main()7int main() 8 { 9 CovStream s(stdin); 10 11 fprintf(stderr, "file size is %ld\n", s.file_size()); 12 13 cs_iterator scan = s.begin(); 14 cs_iterator end = s.end(); 15 16 while(scan != end) 17 { 18 token tok = CovStream::parse_token(scan,end); 19 20 scan = tok.second; 21 22 for(iterator i = tok.first; i != tok.second; ++i) 23 { 24 char c = *i; 25 26 if(c == '\n') 27 printf("\\n"); 28 else 29 printf("%c", c); 30 } 31 32 printf("\n"); 33 34 } 35 36 37 38 39 } 40