The ini file:
user = abc
user = def
user = ghi
user = xyz
开发者_开发技巧
The code:
CSimpleIniCaseW ini;
ini.SetUnicode();
ini.LoadFile("myapp.ini");
CSimpleIniCaseW::TNamesDepend values;
ini.GetAllValues(L"", L"user", values);
values.sort(CSimpleIniCaseW::Entry::LoadOrder());
CSimpleIniCaseW::TNamesDepend::const_iterator i;
for (i = values.begin(); i != values.end(); ++i)
std::wcout << i->pItem << L"\n";
It prints only xyz. How do I get the other values? I need to insert them into a vector before passing it to another function.
You have to enable multi-key first.
http://code.jellycan.com/simpleini-doc/html/class_c_simple_ini_templ.html#c3cfaf072a64f960bdcb7ddf2edc52b6
CSimpleIniCaseW ini;
ini.SetUnicode();
ini.SetMultiKey()
...
精彩评论