Stream_support: add indenting and coloring stream wrappers
Summary of Changes
Stream_support: add indenting and coloring stream wrappers
See the test examples.
Indenting
Example:
=== Basic Indenting Usage ===
1. Basic indentation with std::cout:
This line is indented
So is this one
Multi-line output:
Line 1
Line 2
Line 3
Back to normal indentation
2. Nested indentation levels:
| Level 1 indentation
| | Level 2 indentation
| | | Level 3 indentation
| | Back to level 2
| Back to level 1
Back to normal
3. Custom indentation string:
>>> Custom prefix on each line
>>> Works with multiple lines too
Normal output again
Coloring
Example:
Todo
- [ ] Write a paragraph in the User Manual
Release Management
- Affected package(s): Stream_support
- Feature/Small Feature (if any): TODO
- Link to compiled documentation (obligatory for small feature) wrong link name to be changed
- License and copyright ownership: unchanged
/build:v1
There was an error while building the doc:
/home/runner/work/cgal/cgal/Stream_support/include/CGAL/IO/Color_ostream.h:298: warning: argument 'string' of command @param is not found in the argument list of CGAL::IO::Basic_color_streambuf< CharT, Traits >::set_color_code(const string &color_code)
/home/runner/work/cgal/cgal/Stream_support/include/CGAL/IO/Color_ostream.h:298: warning: The following parameter of CGAL::IO::Basic_color_streambuf::set_color_code(const string &color_code) is not documented:
parameter 'color_code'
https://github.com/CGAL/cgal/actions/runs/18909983163
/force-build:v1
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/9115/v1/Manual/index.html
/force-build:v1
The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/9115/v1/Manual/index.html
Maybe even manipulators would be practical, but one then has the problem to distinguish from a color information to write.
Warning in testsuite CGAL-6.2-Ic-48CGAL-6.2-Ic-48
Color_ostream.h(149,30): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
Is it necessary to document all classes? Isn't Basic_indenting_streambuf juxst an implementation detail?
Is it necessary to document all classes? Isn't
Basic_indenting_streambufjuxst an implementation detail?
That is right. I documented as the STL documented the stream classes. Should I hide the streambuf?
I would document what is needed from a user perspective, and I think as a user I would not need the stream buffer class.
Successfully tested in CGAL-6.2-Ic-53