我在 Boost.Spirit 解析字符串时遇到问题。
字符串看起来像
name1 has this and that.\n
name 2 has this and that.\n
na me has this and that.\n
我必须提取名称。文本“有这个和那个”总是相同的,但名称可以包含空格,因此我不能使用 graph_p。
1)如何解析这样的字符串?
由于字符串有几行这种格式,我必须将名称存储在一个向量中。
我用过类似的东西
std::string name;
rule<> r = *graph_p[append(name)];
为了保存一个名字,但
2)在向量中保存多个名称的最佳方法是什么?
提前致谢
康拉德