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

Feature: Add support for std::array parameters (Addresses issue #236) #244

Merged
merged 9 commits into from
Oct 2, 2023

Conversation

AyanRoy16
Copy link
Collaborator

Adding array as a return type at JParameter.h .

[X] Passing existing test cases
[X] New test cases added

@AyanRoy16 AyanRoy16 changed the title Ayan roy16 issue 236 adding array in jparameter issue 236 adding array in jparameter Oct 2, 2023
inline void JParameterManager::Parse(const std::string& value, bool& val) {
if (value == "0" || value =="false" || value == "off") val = false;
else if (value == "1" || value == "true" || value == "on") val = true;
else throw JException("'%s' not parseable as bool", value.c_str());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably fine here, but in general I'd advise against rearranging ugly logic unless it is truly necessary, particularly when parsing is involved. It's just so easy to introduce bugs or activate bugs that have been lying dormant. Particularly when our test cases are this light.

@nathanwbrei nathanwbrei changed the title issue 236 adding array in jparameter Fix for issue #236: Add support for std::array parameters Oct 2, 2023
@nathanwbrei nathanwbrei changed the title Fix for issue #236: Add support for std::array parameters Feature: Add support for std::array parameters (Addresses issue #236) Oct 2, 2023
@nathanwbrei nathanwbrei merged commit 5c77f52 into master Oct 2, 2023
3 checks passed
@nathanwbrei nathanwbrei deleted the AyanRoy16-issue-236-Adding-array-in-Jparameter branch October 2, 2023 19:50
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.

2 participants