A nocommentstream is an istream that strips '#' comments. More...
#include <nocomment.h>
Classes | |
class | NoCommentFilter |
Implements Filter interface for filterstreambuf. More... | |
Public Member Functions | |
nocommentstream (std::istream &is) | |
Constructor. | |
~nocommentstream () | |
Destructor. | |
Private Attributes | |
NoCommentFilter | filter_ |
Filter. |
A nocommentstream is an istream that strips '#' comments.
All characters following (and including) a '#' are ignored up to (but not including) the next newline character.
Example usage:
std::ifstream ifs("config.txt"); if (!ifs) throw std::runtime_error("config.txt: cannot open"); Dv::Util::nocommentstream nocifs(ifs); std::string line; while ( std::getline(nocifs, line) ) { // line does not contain comments }
Definition at line 34 of file nocomment.h.
Dv::Util::nocommentstream::nocommentstream | ( | std::istream & | is | ) |
Constructor.
is | open stream from which original input is taken |
Dv::Util::nocommentstream::~nocommentstream | ( | ) |
Destructor.
Filter.
Definition at line 59 of file nocomment.h.
dvutil-1.0.10 | [ 5 December, 2009] |