-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
ENH: Use a macro to print boolean objects #3908
base: master
Are you sure you want to change the base?
ENH: Use a macro to print boolean objects #3908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, the instances should be found and replaced 😄
f7200fb
to
7b29032
Compare
The expression
But I cannot figure out how to get the multi-line case using This one works for both cases without capturing works:
I could fix the multi-line ones manually, but I prefer to have a solution. Suggestions on the regex are welcome. Edit: OK, this seems to work for both cases:
Will use it in the script and see what happens when applying to the code. |
@jhlegarreta Is this ready to be pushed forward ? |
@hjmjohnson Will give it a try over the weekend. |
@hjmjohnson @seanm After all the no-op, semicolon, etc. discussions and changes lately, before I make the changes, is the macro correctly defined as is now? Is the ending semicolon after the macro correct in? |
@hjmjohnson I have the script working locally, tested on an example file. Please have a look at the questions in #3908 (comment) so that I can make the appropriate changes to the macro and the replacement statement if needed. Once those made, and #4763 merged, I will run the script and force push. |
7b29032
to
7ca2b7d
Compare
Went on and made the changes. If CIs come green this is ready to go. |
7ca2b7d
to
674a60b
Compare
Well, I included the file where the macro definition dwells just in case: But it does not solve the issue: Both ivars are declared in |
674a60b
to
b397b7e
Compare
Use a macro to print boolean objects. Avoids boilerplate code. Appearances of the form: ``` os << indent << "{name}: " << (m_{name} ? "On" : "Off") << std::endl; ``` and ``` os << indent << "{name}: " << (this->m_{name} ? "On" : "Off") << std::endl; ``` are substituted by `itkPrintBooleanMacro({name});. The cases where the statement is broken into multiple lines were also considered. Add the script used to perform automatically the substitution.
b397b7e
to
41a3798
Compare
Use a macro to print boolean objects. Avoids boilerplate code.
Appearances of the form:
and
are substituted by `itkPrintBooleanMacro({name});. The cases where the
statement is broken into multiple lines were also considered.
Add the script used to perform automatically the substitution.
PR Checklist