-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Stream_support: add indenting and coloring stream wrappers #9115
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
base: main
Are you sure you want to change the base?
Stream_support: add indenting and coloring stream wrappers #9115
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
helped by Copilot
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.
Pull Request Overview
This PR adds new stream formatting capabilities to CGAL's Stream_support package, introducing automatic indentation and ANSI color support for output streams. The changes enhance debugging and logging functionality with RAII-based stream wrappers that automatically restore original state.
- Adds
Basic_indenting_streambufandBasic_color_streambufclasses that wrap existing streambufs to add indentation and color codes - Implements RAII guard classes for scoped stream formatting with automatic restoration
- Includes automatic color terminal detection respecting NO_COLOR and CLICOLOR_FORCE environment variables
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Stream_support/include/CGAL/IO/Indenting_ostream.h | New header implementing indenting streambuf wrapper and RAII guard class |
| Stream_support/include/CGAL/IO/Color_ostream.h | New header implementing color streambuf wrapper with ANSI color support and terminal detection |
| Stream_support/examples/Stream_support/indenting_ostream.cpp | Example demonstrating indenting stream functionality |
| Stream_support/examples/Stream_support/color_ostream.cpp | Example demonstrating color stream functionality |
| Stream_support/examples/Stream_support/CMakeLists.txt | Adds new example programs to build |
| Stream_support/doc/Stream_support/examples.txt | Registers new examples in documentation |
| Stream_support/doc/Stream_support/PackageDescription.txt | Documents new classes and functions in package reference |
| Installation/include/CGAL/config.h | Adds support for __STDC_WANT_LIB_EXT1__ for secure getenv_s |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/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 |
|
Is it necessary to document all classes? Isn't |
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. |
…d_indenting_streams-lrineau # Conflicts: # Installation/CHANGES.md
|
Successfully tested in CGAL-6.2-Ic-53 |
Summary of Changes
Stream_support: add indenting and coloring stream wrappers
See the test examples.
Indenting
Example:
Coloring
Example:

Todo
Release Management