سؤال

I'm trying to read an INI file and write another INI file with the sections order changed.

Does Windows API have tools for this kind of INI file processing? Are there open-source solutions that are preferred? Or should I try to attempt to parse it manually?

هل كانت مفيدة؟

المحلول

As noted in the comment, you can use winapi functions to do this. GetPrivateProfileSectionNames returns the names of the sections in the .ini file. Which you can then iterate and call GetPrivateProfileSection() to get the content of each section.

نصائح أخرى

Windows has its own INI functions for C. But since you mentioned C++ try Feather INI. Program Options is another from Boost.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top