HowTo parse numbers from string with BOOST methods?

Posted by mosg on Stack Overflow See other posts from Stack Overflow or by mosg
Published on 2011-06-22T08:06:04Z Indexed on 2011/06/22 8:22 UTC
Read the original article Hit count: 187

Filed under:
|
|

Problem: Visual C++ 10 project (using MFC and Boost libraries). In one of my methods I'm reading simple test.txt file.

Here is what inside of the file (std::string):

12 asdf789, 54,19 1000 nsfewer:22!13

Then I'm reading it and I have to convert all digits to int only with boost methods. For example, I have a list of different characters which I have to parse:

( ’ ' )
( [ ], ( ), { }, ? ? )
( : )
( , )
( ! )
( . )
( - )
( ? )
( ‘ ’, “ ”, « » )
( ; )
( / )

And after conversation I must have some kind of a massive of int's values, like this one:

12,789,54,19,1000,22,13

Maybe some one already did this job?

PS. I'm new for boost.

Thanks!

© Stack Overflow or respective owner

Related posts about parsing

Related posts about boost