nomlib
Loading...
Searching...
No Matches
nom::WindowsConsoleOutput Class Reference

#include <WindowsConsoleOutput.hpp>

Inheritance diagram for nom::WindowsConsoleOutput:
[legend]

Public Member Functions

virtual ~WindowsConsoleOutput ()
 Destructor; if a console is detected, an attempt to reset the colors will be made.
void set_color (ConsoleOutput::Color color)
 Implements ConsoleOutput::set_color.
void set_style (uint32 style)
 Implements ConsoleOutput::set_style.
void endl ()
 Implements ConsoleOutput::reset_colors.
Public Member Functions inherited from nom::ConsoleOutput
 ConsoleOutput ()
 Default constructor; initializes the output stream to use std::cerr (the standard error stream).
 ConsoleOutput (std::ostream &os)
 Construct a console output object with a custom output stream.
ConsoleOutput::Color color () const
 Get the last color that was set.
bool use_color () const
 Get the current use state of colored output logging.

Private Attributes

HANDLE console_
 Resource handle for access into console API.
WORD color_attrs_
 Store the screen buffer state before we modify it, so we can.
CONSOLE_SCREEN_BUFFER_INFO buffer_info_
WORD fg_white_ = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
 White foreground color for cmd.exe.
WORD fg_red_ = FOREGROUND_RED | FOREGROUND_INTENSITY
 Bold red foreground color for cmd.exe.
WORD fg_green_ = FOREGROUND_GREEN | FOREGROUND_INTENSITY
 Bold green foreground color for cmd.exe.
WORD fg_blue_ = FOREGROUND_BLUE | FOREGROUND_INTENSITY
 Bold blue foreground color for cmd.exe.
WORD fg_magenta_ = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY
 Bold magenta foreground color for cmd.exe.
WORD fg_yellow_ = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
 Bold yellow foreground color for cmd.exe.

Additional Inherited Members

Public Types inherited from nom::ConsoleOutput
enum  Color {
  FG_WHITE , FG_RED , FG_GREEN , FG_BLUE ,
  FG_MAGENTA , FG_YELLOW , FG_ORANGE , FG_PURPLE
}
enum  : uint32 { STYLE_NONE = 0 , STYLE_BOLD = 0x1 , STYLE_UNDERLINED = 0x2 }
Protected Attributes inherited from nom::ConsoleOutput
std::ostream & out_
 The output stream to use; i.e.: std::cout or std::cerr.
ConsoleOutput::Color lcolor_
 The last color used.

Detailed Description

Member Function Documentation

◆ endl()

void nom::WindowsConsoleOutput::endl ( )
virtual

Implements ConsoleOutput::reset_colors.

Reimplemented from nom::ConsoleOutput.

◆ set_color()

void nom::WindowsConsoleOutput::set_color ( ConsoleOutput::Color color)
virtual

Implements ConsoleOutput::set_color.

Reimplemented from nom::ConsoleOutput.

◆ set_style()

void nom::WindowsConsoleOutput::set_style ( uint32 style)
virtual

Implements ConsoleOutput::set_style.

Remarks
Only ConsoleOutput::STYLE_NONE is implemented.
Todo
Implement styles by adding FOREGROUND_INTENSITY mask onto the current color?

Reimplemented from nom::ConsoleOutput.

Member Data Documentation

◆ buffer_info_

CONSOLE_SCREEN_BUFFER_INFO nom::WindowsConsoleOutput::buffer_info_
private

Definition at line 77 of file WindowsConsoleOutput.hpp.

◆ color_attrs_

WORD nom::WindowsConsoleOutput::color_attrs_
private

Store the screen buffer state before we modify it, so we can.

Definition at line 75 of file WindowsConsoleOutput.hpp.

◆ console_

HANDLE nom::WindowsConsoleOutput::console_
private

Resource handle for access into console API.

Definition at line 71 of file WindowsConsoleOutput.hpp.

◆ fg_blue_

WORD nom::WindowsConsoleOutput::fg_blue_ = FOREGROUND_BLUE | FOREGROUND_INTENSITY
private

Bold blue foreground color for cmd.exe.

Definition at line 89 of file WindowsConsoleOutput.hpp.

◆ fg_green_

WORD nom::WindowsConsoleOutput::fg_green_ = FOREGROUND_GREEN | FOREGROUND_INTENSITY
private

Bold green foreground color for cmd.exe.

Definition at line 86 of file WindowsConsoleOutput.hpp.

◆ fg_magenta_

WORD nom::WindowsConsoleOutput::fg_magenta_ = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY
private

Bold magenta foreground color for cmd.exe.

Definition at line 92 of file WindowsConsoleOutput.hpp.

◆ fg_red_

WORD nom::WindowsConsoleOutput::fg_red_ = FOREGROUND_RED | FOREGROUND_INTENSITY
private

Bold red foreground color for cmd.exe.

Definition at line 83 of file WindowsConsoleOutput.hpp.

◆ fg_white_

WORD nom::WindowsConsoleOutput::fg_white_ = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
private

White foreground color for cmd.exe.

Definition at line 80 of file WindowsConsoleOutput.hpp.

◆ fg_yellow_

WORD nom::WindowsConsoleOutput::fg_yellow_ = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
private

Bold yellow foreground color for cmd.exe.

Definition at line 95 of file WindowsConsoleOutput.hpp.


The documentation for this class was generated from the following file: