WIP: Resolve "Rework Problem::{check,print} into a recursive approach"
Closes #296 (closed)
Merge request reports
Activity
Filter activity
added 70 commits
-
23572ae6...2e497182 - 69 commits from branch
devel
- 0e21160a - Added option to layout stablocks in a more readable fashion if _metric and...
-
23572ae6...2e497182 - 69 commits from branch
added 2 commits
OK, but the indentation param
_tabs
should be the last one, with a default equal to""
so that I can print specific nodes and their children, and they appear flush to the left.What I was imagining was something like
Parent::printHeader(params, string _tabs = "") const { stream << _tabs << bla bla << endl; } Parent::print(params, string _tabs = "") const { print Header(params, _tabs); for (const auto& child : clildrenList()) child.print(params, _tabs + " "); // SEE THAT WE ADD INDENTATION HERE } Problem::print(params) const; // NO TABS HERE!
Now you can do
problem.print(params)
, like always. But you can also doCapture.print(params without the _tabs specified)
and thenCaptures
will have no indent,Features
will indent two spaces, andFactors
will indent 4 spaces.Edited by Joan Solà Ortega@jsola The
stream
object should have a.c_str()
function to transform its contents into astd::string
.
Please register or sign in to reply