console_colour_scope Class Reference
[Windows Window Library]

#include <winstl/system/console_colour_scope.hpp>

List of all members.


Detailed Description

Provides scoping of the colour (and intensity) of the console.

This class provides scoping of the colour (and intensity) of the console via the API functions GetConsoleScreenBufferInfo() and SetConsoleTextAttribute().

Public Types

typedef console_colour_scope class_type
 This type.

Public Member Functions

 console_colour_scope (HANDLE hBuffer, WORD textAttributes)
 Sets the console text attribute(s), remembering the current state so it can be reset in the destructor.
 ~console_colour_scope () throw ()
 Resets the console text attribute(s) to the original form.


Member Typedef Documentation

This type.


Constructor & Destructor Documentation

console_colour_scope ( HANDLE  hBuffer,
WORD  textAttributes 
) [inline, explicit]

Sets the console text attribute(s), remembering the current state so it can be reset in the destructor.

The constructor applies the given text attributes to the given console screen buffer, after first recording the current state so that they can be reset when the instance is destroyed.

Exceptions:
winstl::windows_exception If exception handling is enabled, an instance of windows_exception will be thrown if the console text attributes cannot be elicited or changed. If exception handling is not enabled, the console attributes are left as they are, and the destructor makes no attempt at modification.
Parameters:
hBuffer Handle the console screen buffer.
textAttributes The text attributes to be applied to the console

~console_colour_scope (  )  throw () [inline]

Resets the console text attribute(s) to the original form.


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

Generated on Thu Jun 10 08:59:37 2010 for STLSoft by  doxygen 1.5.6