-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements a parser that concatenates duplicated keys in a section #79
Conversation
bc1ce2c
to
7cd0815
Compare
7cd0815
to
1f06bb7
Compare
@xtu could you please check that this implementation works for you. I still need to change the interface so the parser accepts a configuration object, but it is functional |
Wow, that's great news! For example, Subgit uses duplicate keys to store SVN→Git branch mappings and I recently had to parse its ini file. Example:
I look forward for this feature to be finished, so I can update my PowerShell module. |
1f06bb7
to
75a67d9
Compare
Just updated the PR, now the new parser accepts a configuration object that allows setting the string used to concatenate the duplicated keys instead of passing that data in the constructor. That's similar as the way the normal parser works. This led to a simplification of the API, the I've also used the tests provided by @xtu in his original PR, there are implemented in the class @beatcracker glad this feature is also useful to you! :) Take a look to the commit message for detailed info: (75a67d9804a7132876d5725433b92be48d11282a] BTW if anyone has a better and shorter name for the new parser class ( |
Tomorrow I'l create a new package for NuGet, it is 1am here and I need to 😴 |
Now when creating an instance of a ConcatenateDuplicatedKeysIniDataParser you can pass a configuration file that allows changing the string used to concatenate the duplicated keys. Configuration.ConcatenateString = ";" // Default value The configuration AllowDuplicatedKeys is considered as always true, and changing its value has no effect for the ConcatenateDuplicatedKeysIniDataParser
fc73b75
to
9f16cff
Compare
Implements a parser that concatenates duplicated keys in a section
@xtu @beatcracker I've merged this PR released version 2.2.0. You can grab the source code or update your packages if you are using NuGet. |
Great job! Thanks @rickyah |
Instead of just ignoring or throwing errors when the parser founds a duplicated
key, this parser merges the key values using an specified string
This is a new implementation requested by user @xtu and references PR #70
e.g. this ini file
is equivalent to this one: