From d0aecf4df652a75e754d8db482b1910f05b6b9eb Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 23 Dec 2011 13:01:58 +0100 Subject: [PATCH] adding some comments --- begin.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/begin.cxx b/begin.cxx index 285693a..f3b0aa0 100644 --- a/begin.cxx +++ b/begin.cxx @@ -29,14 +29,14 @@ using namespace std; void begin(string needle, istream &in) { - string input; - boost::xpressive::sregex regex = boost::xpressive::sregex::compile( needle, boost::xpressive::regex_constants::icase ); + string input; //This is where we keep our input, line by line + boost::xpressive::sregex regex = boost::xpressive::sregex::compile( needle, boost::xpressive::regex_constants::icase ); //this is what we search for - while(in) { + while(in) { //loop through input line by line getline(in, input); - if ( boost::xpressive::regex_search(input, regex) ) { - cout << input << endl; - while(in) { + if ( boost::xpressive::regex_search(input, regex) ) { //if we find a match + cout << input << endl; //start printing to std out + while(in) { //and print what remains as well getline(in,input); cout << input << endl; }