10 while (is.good() && !is.eof())
12 const int bufferSize = 10240;
13 char buffer[bufferSize];
14 is.read(buffer,bufferSize);
15 const int size = is.gcount();
17 dest.insert(dest.end(),buffer,buffer+size);
24int main(
int argc,
char* argv[])
26 std::vector<std::string> files;
28 po::options_description desc(
"Usage");
30 (
"help,h",
"Display this help message")
31 (
"input-file", po::value< std::vector<std::string> >(&files),
"Set a text file to analyze");
33 po::positional_options_description p;
34 p.add(
"input-file", -1);
37 po::store(po::command_line_parser(argc, argv).
38 options(desc).positional(p).
run(), vm);
43 std::cout << desc << std::endl;
47 namespace qi = boost::spirit::qi;
48 namespace ascii = boost::spirit::ascii;
50 typedef std::string::const_iterator iterator_type;
55 for (std::vector<std::string>::iterator fileItr=files.begin(); fileItr!=files.end(); fileItr++)
58 std::ifstream file(fileItr->c_str(), std::ifstream::binary);
61 std::string::const_iterator iter = str.begin();
62 std::string::const_iterator end = str.end();
74 std::string rest(iter, end);
75 std::cout <<
"Parsing failed. Stopped at: \": " << rest <<
"\"\n";