OpenTTD Source: IConsoleLine Struct Reference

OpenTTD Source 1.11.0-RC1

Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
IConsoleLine Struct Reference

Container for a single line of console output. More...

## Public Member Functions
| IConsoleLine (char *buffer, TextColour colour)
| Initialize the console line. More...
| ~IConsoleLine ()
| Clear this console line and any further ones.

## Static Public Member Functions
static const IConsoleLine * | Get (uint index)
| Get the index-ed item in the list.
static bool | Truncate ()
| Truncate the list removing everything older than/more than the amount as specified in the config file. More...
static void | Reset ()
| Reset the complete console line backlog.

## Data Fields
IConsoleLine * | previous
| The previous console message.
char * | buffer
| The data to store.
TextColour | colour
| The colour of the line.
uint16 | time
| The amount of time the line is in the backlog.

## Static Public Attributes
static IConsoleLine * | front = nullptr
| The front of the console backlog buffer.
static int | size = 0
| The amount of items in the backlog.

## Detailed Description

Container for a single line of console output.

Definition at line 39 of file console_gui.cpp.

## Constructor & Destructor Documentation

## ◆ IConsoleLine()

IConsoleLine::IConsoleLine | ( | char * | buffer,
|  | TextColour | colour
| ) |  |
| inline

Initialize the console line.

Parameters

  buffer | the data to print.
  colour | the colour of the line.

Definition at line 53 of file console_gui.cpp.

References front, and size.

## Member Function Documentation

## ◆ Truncate()

static bool IConsoleLine::Truncate | ( |  | ) |
| inlinestatic

Truncate the list removing everything older than/more than the amount as specified in the config file.

As a side effect also increase the time the other lines have been in the list.

Returns
  true if and only if items got removed.

Definition at line 95 of file console_gui.cpp.

References _settings_client, GUISettings::console_backlog_length, GUISettings::console_backlog_timeout, front, ClientSettings::gui, MAX_UVALUE, previous, and time.

Referenced by IConsoleWindow::OnRealtimeTick().

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

- src/console_gui.cpp