Console Class Reference

#include <Console.h>

Description

A debugging utility used to view output from the Engine and interpret text commands from the user.

The console a useful utility on the user side when running your program. All Engine messages displayed are recorded in the console. While you can view output, you can also submit additional commands for the Engine to run. There exist a number of built-in commands along with the ability to add your own commands. And, due to the structure of adding commands, they will all have some sort of help documentation for usage.

Public Types

enum  MessageMode {
  Standard,
  Disabled
}
 

Static Functions

static bool IsVisible ()
 
static void Show (bool doIt)
 
static bool IsLocked ()
 
static void Lock (bool)
 
static void AddCommand (const std::string &name, Interpreter::Command *command)
 
static uint32_t GetNumLines ()
 
static std::string GetLine (uint32_t i)
 
static void Clear ()
 
static void OverlayMessageMode (MessageMode)
 
static MessageMode GetOverlayMessageMode ()
 
static void SetCommandCallback (DynacoeEvent((*)))
 
Special streams
static ConsoleStream System ()
 
static ConsoleStream Info ()
 
static ConsoleStream Error ()
 
static ConsoleStream Warning ()
 

Static Properties

static const char * End
 

Member Enumeration Documentation

enum MessageMode
strong

Types of message postings.

Enumerator
Standard 

Every console line added results in a message that briefly appears on screen. This is the default.

Disabled 

Console output is only added to the console log.

Member Function Documentation

static bool IsVisible ( )
static

Returns whether or not the console is showing.

static void Show ( bool  doIt)
static

Activates/deactivates the console.

Parameters
doItIf true, the console will be shown. If false, the console will be hidden.
static bool IsLocked ( )
static

Returns whether or not console has been locked.

When the console is locked, the console may not be toggled.

static void Lock ( bool  )
static

Locks the console.

Parameters
lockIf true, Show() will no longer have an effect. Calling the function again with false re-enables the toggling.
static void AddCommand ( const std::string &  name,
Interpreter::Command command 
)
static

Adds an additional command to be recognized by the interactive interpreter.

Parameters
nameThe base name of the command.
commandThe actual command logic.
static uint32_t GetNumLines ( )
static

Returns the number of lines of output currently held by the console.

static std::string GetLine ( uint32_t  i)
static

Returns the i'th most recent message, where 0 is the earliest line and GetNumLines()-1 is the most recent line.

Parameters
iThe line to retrieve.
static void Clear ( )
static

Clears all recorded messages in the Console.

static void OverlayMessageMode ( MessageMode  )
static

Sets the mode by which to display incoming Console messages.

static MessageMode GetOverlayMessageMode ( )
static

Returns the current message mode. MessageMode::Standard is the default.

static void SetCommandCallback ( DynacoeEvent((*))  )
static

Sets a callback to be run for all user-entered commands, regardless of command issued. Whether to process the command normally is returned.

If specified, the console, before normally processing the command, will call this function first to determine whether to continue. The compiled input string is given as the first argument of args. If the callback returns false, no further action is taken.

Field Documentation

const char* End
static

Marks the ending of the line.


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Modules/Console.h