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

Convenience methods as discussed in #84 #86

Merged
merged 3 commits into from
Jul 13, 2015

Conversation

mbcrawfo
Copy link
Contributor

Adds convenience methods for accessing a key using a single string that has section and key name combined, eg "section:key". Separator char is defined in the parser configuration. Will close #84

@rickyah
Copy link
Owner

rickyah commented Jul 12, 2015

Sorry, it took me so long to answer due to a combination of holidays and a peak of really hard work.

I'll review this in no time, maybe I'll add a little change: change the section - key separator character to a dot and make it not customizable.

That character just don't belong on the parser configuration (that character is not used in the parsing) and I don't really see the need to customize it when is just a helper method to access keys inside a section in a easier way, but maybe I'm missing something.
Changing it to a dot is just because looks better IMHO; we are all used to reference inner properties/fields with a dot: data.GetKey("MySection.myKey") What do you think?

I'll try to merge it today, thank you very much @mbcrawfo!

@mbcrawfo
Copy link
Contributor Author

I would argue for keeping the separator character customizable in some way, since it's hard to predict what kind of crazy naming people might be using in their ini files. Maybe just make it a property of IniData? Otherwise sounds good to me!

@rickyah
Copy link
Owner

rickyah commented Jul 12, 2015

You are right, I did not take into account section names like [section.1] I'll put it in IniData then.

@rickyah rickyah merged commit 9d9f6cd into rickyah:development Jul 13, 2015
rickyah added a commit that referenced this pull request Jul 13, 2015
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.

Convenience methods for accessing keys
2 participants