Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CConsole Class Reference

Gestion de la console. More...

`#include <KeosConsole.h>`

Inheritance diagram for Keos::CConsole:

List of all members.

## Public Member Functions

| CConsole ()
| Constructeur par défaut.
void | ChangeLook (Console::ILook *NewLook)
| Change l'apparence de la console.
void | RegisterCommand (const std::string &Name, const Console::CFunctor &Function, const std::string &Help="No help for this command")
| Enregistre une nouvelle commande.
void | SendChar (char Character)
| Envoie un nouveau caractère à la console.
void | Update ()
| Met à jour la console.
void | Draw () const
| Affiche la console.
void | Enable (bool Enabled)
| Active ou désactive la console.

## Private Types

typedef std::map< std::string, Console::CFunctor > | TCommandTable
typedef std::map< std::string, std::string > | THelpTable

## Private Member Functions

std::string | GetCommands () const
| Donne la liste des commandes enregistrées.
String | HelpCommand (const String &CommandName)
| Commande Help: permet d'avoir la description d'une commande.
void | ProcessCurrent ()
| Traite la ligne courante et appelle la fonction correspondante.

## Private Attributes

friend | CSingleton<CConsole>
TCommandTable | m_Commands
| Table des commandes enregistrées.
THelpTable | m_Helps
| Table des aides enregistrées.
std::string | m_Current
| Ligne courante.
CSmartPtr< Console::ILook > | m_Look
| Pointeur sur la classe gérant l'apparence de la console.
bool | m_Enabled
| Indique si la console est active ou non.

## Detailed Description

Gestion de la console.

Definition at line 64 of file KeosConsole.h.

## Member Typedef Documentation

typedef std::map<std::string, Console::CFunctor> Keos::CConsole::TCommandTable`[private]`

| Definition at line 126 of file KeosConsole.h.

typedef std::map<std::string, std::string> Keos::CConsole::THelpTable`[private]`

| Definition at line 127 of file KeosConsole.h.

## Constructor & Destructor Documentation

Keos::CConsole::CConsole | ( |  | ) |

| Constructeur par défaut. Definition at line 61 of file KeosConsole.cpp. References RegisterCommand().

## Member Function Documentation

void Keos::CConsole::ChangeLook | ( | Console::ILook * | NewLook | ) |

| Change l'apparence de la console.

Parameters:

  | NewLook | : Pointeur sur le nouveau look

Definition at line 77 of file KeosConsole.cpp.

References Assert, and m_Look.

void Keos::CConsole::Draw | ( |  | ) | const

| Affiche la console. Definition at line 158 of file KeosConsole.cpp. References m_Look.

void Keos::CConsole::Enable | ( | bool | Enabled | ) |

| Active ou désactive la console.

Parameters:

  | Enabled | : Active / inactive

Definition at line 170 of file KeosConsole.cpp.

References m_Enabled, and m_Look.

std::string Keos::CConsole::GetCommands | ( |  | ) | const`[private]`

| Donne la liste des commandes enregistrées.

Returns:
  Chaîne contenant la liste des commandes enregistrées

Definition at line 183 of file KeosConsole.cpp.

References m_Commands.

String Keos::CConsole::HelpCommand | ( | const String & | CommandName | ) | `[private]`

| Commande Help: permet d'avoir la description d'une commande.

Parameters:

  | CommandName | : Nom de la commande dont on veut la description

Returns:
  Description de la commande

Definition at line 200 of file KeosConsole.cpp.

References m_Helps.

void Keos::CConsole::ProcessCurrent | ( |  | ) | `[private]`

| Traite la ligne courante et appelle la fonction correspondante. Definition at line 214 of file KeosConsole.cpp. References m_Commands, m_Current, and m_Look. Referenced by SendChar().

void Keos::CConsole::RegisterCommand | ( | const std::string & | Name,
|  | const Console::CFunctor & | Function,
|  | const std::string & | Help = `"No help for this command"`
| ) |

| Enregistre une nouvelle commande.

Parameters:

  | Name | : Nom de la commande
  | Function | : Foncteur contenant la fonction associée

Definition at line 92 of file KeosConsole.cpp.

References m_Commands, and m_Helps.

Referenced by CConsole().

void Keos::CConsole::SendChar | ( | char | Character | ) |

| Envoie un nouveau caractère à la console.

Parameters:

  | Character | : Caractère

Definition at line 106 of file KeosConsole.cpp.

References m_Current, m_Enabled, m_Look, and ProcessCurrent().

void Keos::CConsole::Update | ( |  | ) |

| Met à jour la console. Definition at line 148 of file KeosConsole.cpp. References m_Look.

## Member Data Documentation

friend Keos::CConsole::CSingleton<CConsole>`[private]`

| Definition at line 66 of file KeosConsole.h.

TCommandTable Keos::CConsole::m_Commands`[private]`

| Table des commandes enregistrées. Definition at line 132 of file KeosConsole.h. Referenced by GetCommands(), ProcessCurrent(), and RegisterCommand().

std::string Keos::CConsole::m_Current`[private]`

| Ligne courante. Definition at line 134 of file KeosConsole.h. Referenced by ProcessCurrent(), and SendChar().

bool Keos::CConsole::m_Enabled`[private]`

| Indique si la console est active ou non. Definition at line 136 of file KeosConsole.h. Referenced by Enable(), and SendChar().

THelpTable Keos::CConsole::m_Helps`[private]`

| Table des aides enregistrées. Definition at line 133 of file KeosConsole.h. Referenced by HelpCommand(), and RegisterCommand().

CSmartPtr<Console::ILook> Keos::CConsole::m_Look`[private]`

| Pointeur sur la classe gérant l'apparence de la console. Definition at line 135 of file KeosConsole.h. Referenced by ChangeLook(), Draw(), Enable(), ProcessCurrent(), SendChar(), and Update().

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

- KeosEngine/KeosConsole.h
- KeosEngine/KeosConsole.cpp