Class used to decorate an output stream. Each setting is set permanently on the chosen output stream until the destructor is met or one of the reset functions is called.
More...
#include <decorator.hpp>
Class used to decorate an output stream. Each setting is set permanently on the chosen output stream until the destructor is met or one of the reset functions is called.
◆ Decorator()
osm::Decorator::Decorator |
( |
| ) |
|
◆ ~Decorator()
osm::Decorator::~Decorator |
( |
| ) |
|
◆ getColor()
std::string osm::Decorator::getColor |
( |
std::ostream & |
os = osm::cout | ) |
|
Method used to return the selected color of a stream.
- Parameters
-
os | The stream which color is returned. Default is osm::cout. |
- Returns
- std::string The current color of the stream.
◆ getColorList()
std::unordered_map< std::ostream *, std::string > osm::Decorator::getColorList |
( |
| ) |
|
Method used to return the map of streams with the respective color.
- Returns
- std::map <std::ostream*, std::string> The stream-color map.
◆ getCurrentStream()
std::ostream & osm::Decorator::getCurrentStream |
( |
| ) |
|
Method used to return the stream that is used to output stuff.
- Returns
- std::ostream& The used stream to output stuff.
◆ getStyle()
std::string osm::Decorator::getStyle |
( |
std::ostream & |
os = osm::cout | ) |
|
Method used to return the selected style of a stream.
- Parameters
-
os | The stream which style is returned. Default is osm::cout. |
- Returns
- std::string The current style of the stream.
◆ getStyleList()
std::unordered_map< std::ostream *, std::string > osm::Decorator::getStyleList |
( |
| ) |
|
Method used to return the map of streams with the respective style.
- Returns
- std::map <std::ostream*, std::string> The stream-color map.
◆ operator()()
Operator overload to assign the value into parentheses to the "current_stream" variable.
- Parameters
-
os | Input value, i.e. the stream put into parentheses. |
- Returns
- const Decorator& The class pointer.
◆ removeStyle()
void osm::Decorator::removeStyle |
( |
std::string_view |
style, |
|
|
std::ostream & |
os = osm::cout |
|
) |
| |
Method used to remove one of the set styles (useful in case they are more than one).
- Parameters
-
color | The style to be reset for the stream. |
os | The stream to be modified. Default is osm::cout. |
◆ resetColor()
void osm::Decorator::resetColor |
( |
std::ostream & |
os = osm::cout | ) |
|
Method used to reset the color of a stream.
- Parameters
-
color | The color to be reset for the stream. |
os | The stream to be modified. Default is osm::cout. |
◆ resetFeatures()
void osm::Decorator::resetFeatures |
( |
std::ostream & |
os = osm::cout | ) |
|
Method used to reset all the features of a stream.
- Parameters
-
os | The stream to be modified. Default is osm::cout. |
◆ resetStyle()
void osm::Decorator::resetStyle |
( |
std::ostream & |
os = osm::cout | ) |
|
Method used to reset the style or of a stream.
- Parameters
-
color | The style to be reset for the stream. |
os | The stream to be modified. Default is osm::cout. |
◆ setColor()
void osm::Decorator::setColor |
( |
const std::string & |
color, |
|
|
std::ostream & |
os = osm::cout |
|
) |
| |
Method used to set the color of a stream.
- Parameters
-
color | The color to be set for the stream. |
os | The stream to be modified. Default is osm::cout. |
◆ setStyle()
void osm::Decorator::setStyle |
( |
const std::string & |
style, |
|
|
std::ostream & |
os = osm::cout |
|
) |
| |
Method used to set the style of a stream.
- Parameters
-
color | The style to be set for the stream. |
os | The stream to be modified. Default is osm::cout. |
The documentation for this class was generated from the following files: