Skip to content
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

Allows access to ini file elements using case insensitive names #78

Merged
merged 1 commit into from Apr 20, 2015

Conversation

rickyah
Copy link
Owner

@rickyah rickyah commented Apr 15, 2015

IIniParserConfiguration exposes a new boolean property: CaseInsensitive
When this property is true for a parser configuration instance
an IniDataParser instance parses a file ignoring case in section and
key names.

  • Implementation notes

A new class has been added: IniDataCaseInsensitive. This class derives
from IniData and shares its interface, so both are completely
interchangeable, ensuring backwards compatibility.

SectionDataCollection and KeyDataCollection classes now admit an
IEqualityComparer parameter that defines the comparer to use
when accessing the section and keydata elements inside this elements.
IniData classe uses IEqualityComparer.Default as a default value
for the comparer which mimics the previous behaviour.
IniDataCaseInsensitive uses StringComparer.OrdinalIgnoreCase to allow
case-insensitive search.

IIniParserConfiguration exposes a new boolean property: CaseInsensitive
When this property is true for a parser configuration instance
an IniDataParser instance parses a file ignoring case in section and
key names.

* Implementation notes

A new class has been added: IniDataCaseInsensitive. This class derives
from IniData and shares its interface, so both are completely
interchangeable, ensuring backwards compatibility.

SectionDataCollection and KeyDataCollection classes now admit an
IEqualityComparer<string> parameter that defines the comparer to use
when accessing the section and keydata elements inside this elements.
IniData classe uses IEqualityComparer<string>.Default as a default value
for the comparer which mimics the previous behaviour.
IniDataCaseInsensitive uses StringComparer.OrdinalIgnoreCase to allow
case-insensitive search.
@rickyah
Copy link
Owner Author

rickyah commented Apr 20, 2015

Seems that the PR is working correctly:
#76 (comment)

rickyah added a commit that referenced this pull request Apr 20, 2015
…cess

Allows access to ini file elements using case insensitive names
@rickyah rickyah merged commit dd86dbd into development Apr 20, 2015
@rickyah rickyah deleted the feature/allow-case-insensitive-access branch April 20, 2015 10:56
@rickyah rickyah modified the milestone: 2.2.0 May 31, 2015
@Ainschie
Copy link

Hi Ricardo,
I'm using Version 2.5.2 and it seems CaseInsensitive ist not working :-(
data[MySection][MyKey] is null if MyKey is mykey in ini-file.
Any suggestions?
Kind regards.
Angela

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants