00001 // $Id: nocomment.C,v 1.1 2001/08/07 09:15:59 dvermeir Exp $ 00002 #include "nocomment.h" 00003 00004 nocommentstream::nocommentstream(istream& is): filter_(is) { 00005 rdbuf(new FilterStreambuf<NoCommentFilter>(filter_)); 00006 } 00007 00008 int 00009 nocommentstream::NoCommentFilter::get() { 00010 if (is_) { 00011 int c = is_.get(); 00012 if (c=='#') { 00013 while ( (is_) && (c!='\n') && (c!=EOF) ) 00014 c = is_.get(); 00015 } 00016 if (!is_) 00017 c = EOF; 00018 return c; 00019 } 00020 else 00021 return EOF; 00022 } 00023