9#ifndef __DECORATOR_CLASSES_H__
10#define __DECORATOR_CLASSES_H__
16#include "helpers/formatstring.h"
71 "The element being decorated cannot be null.");
Implementation of the argumentnull_error exception.
Represents the base class of all decorators and is responsible for handling the wrapped element being...
std::string Render()
Render the wrapped element.
IRenderElement::shared_ptr_t _wrappedElement
Decorator(IRenderElement::shared_ptr_t element)
Constructor.
Represents the RedForeground decorator, which renders the wrapped content as red text.
RedForegroundDecorator(IRenderElement::shared_ptr_t element)
Constructor that wraps the specified element.
std::string Render()
Render the wrapped element with decorations.
Represents the core element that can be decorated. Note that this class implements the IRenderElement...
std::string _elementText
The raw text at the center of all decorators.
TextElement(std::string element)
Constructor.
std::string Render()
Render this element as a string.
Represents the Underline decorator, which underlines the wrapped content.
UnderlineDecorator(IRenderElement::shared_ptr_t element)
Constructor that wraps the specified element.
std::string Render()
Render the wrapped element with decorations.
Represents the WhiteBackground decorator, which changes the background color of the wrapped element t...
std::string Render()
Render the wrapped element with decorations.
WhiteBackgroundDecorator(IRenderElement::shared_ptr_t element)
Constructor that wraps the specified element.
Exception for arguments that are null.
The namespace containing all Design Pattern Examples implemented in C++.
std::string formatstring(const char *fmt,...)
Use the given string and arguments to return a buffer containing the formatted string....
Represents an element that can be rendered in text. All decorators and the core element class impleme...
std::shared_ptr< IRenderElement > shared_ptr_t
An alias to simplify syntax for this shared pointer.
virtual std::string Render()=0
Render this element as a string.
virtual ~IRenderElement()