Rookfighter / inifile-cpp

A header-only and easy to use Ini file parser for C++.
MIT License
363 stars 68 forks source link

Disallow section duplication #15

Closed rjungheinrich closed 4 years ago

rjungheinrich commented 4 years ago

I think that INI files with duplicated sections are confusing and error prone. For example:

[Foo]
var1 = hi
[Bar]
var2 = 12
[Foo]
var3 = 14

[Foo] will end up having both variables var1 and var3. It is easy to spot this duplication in such a small example, but with bigger INI files this can be problematic.

I've made the pull request #14 to make the code throw an exception in this case.

rjungheinrich commented 4 years ago

I'm closing the request as it is not retro compatible and can cause problems. I will rethink the problem and reopen it if needed.