
27 May
2011
27 May
'11
5:57 p.m.
On 05/27/2011 10:06 AM, Stewart, Robert wrote:
Andrzej Krzemienski wrote:
I want to parse numbers separated by "new-lines", however, on my windows system, a "new-line" is represented by two consecutive characters: 13, 10 (or in other words by string "\n\r"). So, only if I encounter a sequence of these two chars do I want to cut the token.
Spirit.Qi would do that handily. Something like this should work:
namespace qi = boost::spirit::qi; std::vector<int> data; qi::phrase_parse(input.begin(), input.end(), qi::int_, qi::eol, data);
_____
Small correction (missing the kleen): qi::phrase_parse(input.begin(), input.end(), *qi::int_, qi::eol, data); -- Michael Caisse Object Modeling Designs www.objectmodelingdesigns.com