需要有关INI解析器的最佳方法的帮助 [英] Need help with best method for INI parser
问题描述
大家好,我正在尝试创建一个ini解析器,如果它不存在则创建一个文件,如果它存在,它将检查选项是否设置为true或false。我正在制作的项目是xex格式。
示例我想要它做什么
if(blablabla == true)
{
// on
}
else
{
//关闭
}
我想让它检查如果从ini文件设置为true或false,则用户可以启用或禁用这些选项。
我通常使用C#所以C ++对我来说是新手,所以如果语法错误,我很抱歉。
如果你能指出我最好的文章或方法你认为我应该考虑哪个最适合我的计划。
感谢您的帮助:)
我的尝试:
没什么可抱的,只是寻找最好的方法。
Hello all, I am trying to make a ini parser that's creates a file if it does not exist and if it does it will check if an options is set to true or false. The project I am making it for is an xex format.
Example what I want it to do
if(blablabla == true)
{
//on
}
else
{
//off
}
I want it to check if it set to true or false from an ini file so users can enable or disable the options.
I normally work with C# so C++ is new to me, so if the syntax is wrong above i'm sorry about that.
If you could point me to the best article or method you think I should look into which would be best for my plan.
Thanks for the help :)
What I have tried:
Nothing yet sorry, just looking for best method.
推荐答案
参见 GetProfileSection函数(Windows) [ ^ ],但请参见开头的注释。
See GetProfileSection function (Windows)[^], but see the Note at the beginning.
你可以也可以尝试使用库,例如,在 config4star.org:Home [ ^ ]。
You could also try a library, have a look , for instance, at config4star.org: Home[^].
这篇关于需要有关INI解析器的最佳方法的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!