开发者

INFO Format reference from (boost property tree)

I'm searching for a way to write complex data configurations for my application. I don't really like xml or json for that job for different reasons.

But I found a format that is kind of perfect for the job, it's implemented in boost property tree library and is referenced as "INFO" format( http://www.boost.org/doc/libs/1_46_1/doc/html/boost_propertytree/parsers.html#boost_propertytree.parsers.info_parser ).

The problem is I can't find a proper format description/reference because of the same named "info" file format for text info.

Can some one share a link to a proper documentation or at least more exaples?

开发者_如何学运维


Did you look at the Boost docs on this? I doubt there's a better reference. As noted in the doc:

It provides a simple, efficient format that can be used to serialize property trees that are otherwise only stored in memory. It can also be used for any other purpose, although the lack of widespread existing use may prove to be an impediment.

Generally I bemoan the overuse of XML but in this case, going that route (XML) is just as functional and a lot less controversial. You get third-party parsing, transform (XSLT) and editing tools that you won't have with INFO.


Look at Boost's property_tree/examples/info_grammar_spirit.cpp.

/* This is grammar of INFO file format written in form of boost::spirit rules. For simplicity, it does not parse #include directive. Note that INFO parser included in property_tree library does not use Spirit. */

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜