5
我有一個程序,使用boost :: program_options從配置文件中讀取大量變量。配置文件正在運行並讀取值,但由於文件中有很多選項,我想將它們記錄在適當位置。例如,我想配置文件看起來像:Boost Program_options配置文件註釋
# Here is a description of flag1
# flag1 = true means blah blah blah
# flag1 = false means ...
flag1=true
# Here is a description of flag 2
.
.
.
的問題是,我找不到任何地方文檔描述的方式來做到這一點。我相當肯定,我可以使用諸如a=
的評論分隔符,並將所有評論簡單地分配給std::vector<string>
以在解析後被丟棄,但是我想知道是否有更合適的方式來處理註釋行在配置文件中。
這就是我想聽到的,但是如果他們把它寫在某個地方會很好。 – 2013-03-19 14:39:22
@GodricSeer http://www.boost.org/doc/html/program_options/overview.html#idp120049504 – 2013-03-19 15:16:44
我想那是我的疏忽。謝謝。 – 2013-03-19 15:17:56