Simple string parsing with C++

前端 未结 6 1085
感情败类
感情败类 2020-12-04 10:22

I\'ve been using C++ for quite a long time now but nevertheless I tend to fall back on scanf when I have to parse simple text files. For example given a config

6条回答
  •  我在风中等你
    2020-12-04 10:51

    I think Boost.Spirit is a good way to describe a grammar right in your C++ code. It takes some time to get used to Boost.Spirit but after it is quite easy to use it. It might not be as concise as probably you want but I think it is a handy way of handling simple grammars.Its performance might be a problem so it is likely that in situations where you need speed it might be not a good choice.

提交回复
热议问题