13 #include <boost/mpl/assert.hpp>
14 #include <boost/mpl/int.hpp>
35 static const unsigned tmpBuffLen = 1024;
36 static char tmpBuff[tmpBuffLen];
40 str.getline( tmpBuff, tmpBuffLen );
42 }
while( str.rdstate() == std::ios::failbit );
100 int forEachLine( std::istream & str_r,
function<
bool(
int, std::string)> consume_r )
105 std::string line(
getline( str_r ) );
106 if ( ! (str_r.fail() || str_r.bad()) )
110 if ( consume_r && ! consume_r( lineno, line ) )
124 int simpleParseFile( std::istream & str_r, ParseFlags flags_r,
function<
bool(
int, std::string)> consume_r )
127 [&](
int num_r, std::string line_r )->
bool
137 if ( flags_r & ~PF_TRIM )
139 const char* firstNW = line_r.c_str();
140 while ( *firstNW ==
' ' || *firstNW ==
'\t' )
144 case '\0':
if ( flags_r &
PF_SKIP_EMPTY )
return true;
break;
149 return consume_r( num_r, line_r );