Foreground, Background and Attributes.
More...
#include <door.h>
|
| ANSIColor () |
|
| ANSIColor (ATTR a) |
|
| ANSIColor (COLOR f) |
|
| ANSIColor (COLOR f, ATTR a) |
|
| ANSIColor (COLOR f, ATTR a1, ATTR a2) |
|
| ANSIColor (COLOR f, COLOR b) |
|
| ANSIColor (COLOR f, COLOR b, ATTR a) |
|
| ANSIColor (COLOR f, COLOR b, ATTR a1, ATTR a2) |
|
ANSIColor & | Attr (ATTR a) |
|
bool | operator== (const ANSIColor &c) const |
|
bool | operator!= (const ANSIColor &c) const |
|
void | setFg (COLOR f) |
|
void | setFg (COLOR f, ATTR a) |
|
void | setBg (COLOR b) |
|
COLOR | getFg () |
|
COLOR | getBg () |
|
void | attr (ATTR a) |
|
std::string | output (void) const |
|
std::string | debug (void) |
|
std::string | output (ANSIColor &previous) const |
|
|
COLOR | fg |
| Foreground color.
|
|
COLOR | bg |
| Background color.
|
|
unsigned int | reset: 1 |
| reset flag / always send color and attributes
|
|
unsigned int | bold: 1 |
| bold / bright flag
|
|
unsigned int | blink: 1 |
| blink slow blinking text
|
|
unsigned int | inverse: 1 |
| inverse
|
|
Foreground, Background and Attributes.
This holds foreground, background and ANSI-BBS attribute information. The special attribute RESET forces attribute and color output always.
- Examples
- door-example.cpp, and menu-example.cpp.
◆ ANSIColor() [1/8]
door::ANSIColor::ANSIColor |
( |
| ) |
|
◆ ANSIColor() [2/8]
door::ANSIColor::ANSIColor |
( |
ATTR |
a | ) |
|
◆ ANSIColor() [3/8]
door::ANSIColor::ANSIColor |
( |
COLOR |
f | ) |
|
◆ ANSIColor() [4/8]
door::ANSIColor::ANSIColor |
( |
COLOR |
f, |
|
|
ATTR |
a |
|
) |
| |
◆ ANSIColor() [5/8]
◆ ANSIColor() [6/8]
◆ ANSIColor() [7/8]
Construct a new ANSIColor::ANSIColor object with a foreground color, background color, and attribute.
- Parameters
-
◆ ANSIColor() [8/8]
Construct a new ANSIColor::ANSIColor object with foreground, background color and attributes.
- Parameters
-
f | COLOR |
b | COLOR |
a1 | ATTR |
a2 | ATTR |
◆ Attr()
Set attribute. We return the object so calls can be chained.
- Parameters
-
- Returns
- ANSIColor&
◆ operator!=()
bool door::ANSIColor::operator!= |
( |
const ANSIColor & |
c | ) |
const |
Not-equal operator.
This compares colors and attributes, but ignores reset.
- Parameters
-
- Returns
- bool
◆ operator==()
bool door::ANSIColor::operator== |
( |
const ANSIColor & |
c | ) |
const |
Equal operator.
This compares colors and attributes, but ignores reset.
- Parameters
-
- Returns
- bool
◆ output() [1/2]
std::string door::ANSIColor::output |
( |
ANSIColor & |
previous | ) |
const |
- Parameters
-
previous | the previous attributes and colors |
- Returns
- std::string
Output only what ANSI attributes and colors have changed. This uses the previous ANSIColor value to determine what has changed.
This sets previous to the current upon completion.
◆ output() [2/2]
std::string door::ANSIColor::output |
( |
void |
| ) |
const |
- Returns
- std::string
Output the full ANSI codes for attributes and color. This does not look at the previous values.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const ANSIColor & |
c |
|
) |
| |
|
friend |
- Parameters
-
- Returns
- std::ostream&
This converts ANSI COLOR and ATTR to ANSI codes understood by the Door output class.
The documentation for this class was generated from the following files: