|
libzypp 17.38.1
|
Colored string if do_colors. More...
#include <zypp-tui/utils/ansi.h>

Public Member Functions | |
| ColorString () | |
| ColorString (Color color_r) | |
| Ctor from color. | |
| ColorString (const std::string &str_r) | |
| Ctor from string. | |
| ColorString (std::string &&str_r) | |
| ColorString (const std::string &str_r, Color color_r) | |
| Ctor from string and color. | |
| ColorString (std::string &&str_r, Color color_r) | |
| ColorString (Color color_r, const std::string &str_r) | |
| Ctor from color and string. | |
| ColorString (Color color_r, std::string &&str_r) | |
| ColorString & | operator= (const std::string &str_r) |
| Assign new string. | |
| ColorString & | operator= (std::string &&str_r) |
| ColorString & | operator<< (const ColorString &rhs) |
| Append a \Ref ColorString. | |
| ColorString & | operator<< (const std::string &str_r) |
| Append a string. | |
| ColorString & | operator= (Color color_r) |
| Assign Color. | |
| ColorString & | operator<= (Color color_r) |
| Update Color. | |
| ColorString | operator() (Color color_r) const |
| Return a copy with different color. | |
| Color | color () const |
| Return strings Color. | |
| bool | empty () const |
| Whether the underlying string is empty. | |
| std::string::size_type | size () const |
| Size of the underlying string. | |
| std::string | str () const |
| Return the colored string if do_colors. | |
| std::string | asString () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::string | str (Color color_r) const |
| Return the string rendered in a differernt color if do_colors. | |
| const std::string & | plainstr () const |
| Return the underlying plain string. | |
| std::string & | plainstr () |
| Return the underlying plain string. | |
| const std::string & | operator* () const |
Access the underlying plain string via operator*. | |
| std::string & | operator* () |
Access the underlying plain string via operator*. | |
Private Attributes | |
| std::string | _str |
| Color | _color |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &str, const ColorString &obj) |
| Print colored on ostream. | |
Colored string if do_colors.
Stores a plain std::string (which may have color codes embedded) along with a Color. Retrieving the string will render all uncolored (Color::nololor) parts of the string in the Color.
In contrary to a ColorStream you can change the basic color of the string without losing embedded highlights.
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Append a \Ref ColorString.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
|
private |
|
private |