Orxonox: orxonox::Shell Class Reference

# orxonox::Shell Class Reference

`#include <src/core/Shell.h>`

Inheritance diagram for orxonox::Shell:

List of all members.

## Public Member Functions

void | addLine (const std::string &line, int level=0)
void | addOutputLevel (bool bAddOutputLevel)
void | clearInput ()
void | clearLines ()
void | commandHistoryLengthChanged ()
void | commandHistoryOffsetChanged ()
unsigned int | getCursorPosition () const
std::list< std::string > ::const_iterator | getEndIterator () const
std::string | getInput () const
InputBuffer * | getInputBuffer ()
std::list< std::string > ::const_iterator | getNewestLineIterator () const
unsigned int | getNumLines () const
OutputBuffer & | getOutputBuffer ()
unsigned int | getScrollPosition () const
void | registerListener (ShellListener *listener)
virtual void | setConfigValues ()
| Function to collect the SetConfigValue-macro calls.
void | setCursorPosition (unsigned int cursor)
void | setInput (const std::string &input)
| Shell ()
void | unregisterListener (ShellListener *listener)
virtual | ~Shell ()

## Static Public Member Functions

static void | clearShell ()
static Shell & | getInstance ()
static void | history ()

## Private Member Functions

void | addToHistory (const std::string &command)
void | backspace ()
void | clear ()
void | configureInputBuffer ()
void | cursor_end ()
void | cursor_home ()
void | cursor_left ()
void | cursor_right ()
void | deletechar ()
void | execute ()
void | exit ()
std::string | getFromHistory () const
void | hintandcomplete ()
void | history_down ()
void | history_up ()
void | inputChanged ()
virtual void | outputChanged ()
void | scroll_down ()
void | scroll_up ()
| Shell (const Shell &other)

## Private Attributes

bool | bAddOutputLevel_
std::vector< std::string > | commandHistory_
ConfigFileType | commandHistoryConfigFileType_
bool | finishedLastLine_
unsigned int | historyOffset_
unsigned int | historyPosition_
InputBuffer * | inputBuffer_
std::list< std::string > | lines_
std::list< ShellListener * > | listeners_
unsigned int | maxHistoryLength_
OutputBuffer | outputBuffer_
std::list< std::string > ::const_iterator | scrollIterator_
unsigned int | scrollPosition_

## Static Private Attributes

static Shell * | singletonRef_s = 0

## Constructor & Destructor Documentation

orxonox::Shell::Shell | ( |  | ) |

References bAddOutputLevel_, clearLines(), commandHistoryConfigFileType_, configureInputBuffer(), finishedLastLine_, orxonox::ConfigFileManager::getInstance(), orxonox::ConfigFileManager::getNewConfigFileType(), orxonox::OutputHandler::getOutStream(), orxonox::getSoftDebugLevel(), historyOffset_, historyPosition_, inputBuffer_, orxonox::OutputHandler::LD_Shell, maxHistoryLength_, outputBuffer_, orxonox::OutputBuffer::registerListener(), RegisterRootObject, scrollPosition_, setConfigValues(), orxonox::ConfigFileManager::setFilename(), orxonox::OutputHandler::setOutputBuffer(), orxonox::Core::setSoftDebugLevel(), and singletonRef_s.

orxonox::Shell::~Shell | ( |  | ) | `[virtual]`

References orxonox::OutputHandler::getOutStream(), inputBuffer_, orxonox::OutputHandler::setOutputBuffer(), and singletonRef_s.

orxonox::Shell::Shell | ( | const Shell & | other | ) | `[private]`

## Member Function Documentation

void orxonox::Shell::addLine | ( | const std::string & | line,
|  | int | level = `0` |
| ) |  |  |

References finishedLastLine_, orxonox::OutputHandler::getOutputLevel(), orxonox::OutputHandler::getOutStream(), outputBuffer_, and orxonox::OutputHandler::setOutputLevel().

Referenced by execute(), hintandcomplete(), and history().

void orxonox::Shell::addOutputLevel | ( | bool | bAddOutputLevel | ) | `[inline]`

Referenced by orxonox::InGameConsole::initialise().

void orxonox::Shell::addToHistory | ( | const std::string & | command | ) | `[private]`

References commandHistory_, historyOffset_, historyPosition_, maxHistoryLength_, and ModifyConfigValue.

Referenced by execute().

void orxonox::Shell::backspace | ( |  | ) | `[private]`

References inputBuffer_, inputChanged(), orxonox::InputBuffer::removeBehindCursor(), and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::clear | ( |  | ) | `[private]`

References orxonox::InputBuffer::clear(), historyPosition_, inputBuffer_, inputChanged(), and SHELL_UPDATE_LISTENERS.

Referenced by execute(), and exit().

void orxonox::Shell::clearInput | ( |  | ) | `[inline]`

void orxonox::Shell::clearLines | ( |  | ) |

References finishedLastLine_, lines_, scrollIterator_, scrollPosition_, and SHELL_UPDATE_LISTENERS.

Referenced by clearShell(), and Shell().

void orxonox::Shell::clearShell | ( |  | ) | `[static]`

References clearLines(), and getInstance().

void orxonox::Shell::commandHistoryLengthChanged | ( |  | ) |

References commandHistory_, commandHistoryOffsetChanged(), maxHistoryLength_, and ModifyConfigValue.

Referenced by setConfigValues().

void orxonox::Shell::commandHistoryOffsetChanged | ( |  | ) |

References historyOffset_, and maxHistoryLength_.

Referenced by commandHistoryLengthChanged(), and setConfigValues().

void orxonox::Shell::configureInputBuffer | ( |  | ) | `[private]`

References backspace(), cursor_end(), cursor_home(), cursor_left(), cursor_right(), orxonox::KeyCode::Delete, deletechar(), orxonox::KeyCode::Down, orxonox::KeyCode::End, execute(), exit(), hintandcomplete(), history_down(), history_up(), orxonox::KeyCode::Home, inputBuffer_, inputChanged(), orxonox::KeyCode::Left, orxonox::KeyCode::PageDown, orxonox::KeyCode::PageUp, orxonox::InputBuffer::registerListener(), orxonox::KeyCode::Right, scroll_down(), scroll_up(), and orxonox::KeyCode::Up.

Referenced by Shell().

void orxonox::Shell::cursor_end | ( |  | ) | `[private]`

References inputBuffer_, orxonox::InputBuffer::setCursorToEnd(), and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::cursor_home | ( |  | ) | `[private]`

References inputBuffer_, orxonox::InputBuffer::setCursorToBegin(), and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::cursor_left | ( |  | ) | `[private]`

References orxonox::InputBuffer::decreaseCursor(), inputBuffer_, and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::cursor_right | ( |  | ) | `[private]`

References orxonox::InputBuffer::increaseCursor(), inputBuffer_, and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::deletechar | ( |  | ) | `[private]`

References inputBuffer_, inputChanged(), orxonox::InputBuffer::removeAtCursor(), and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::execute | ( |  | ) | `[private]`

References addLine(), addToHistory(), clear(), orxonox::CommandExecutor::execute(), orxonox::InputBuffer::get(), and inputBuffer_.

Referenced by configureInputBuffer().

void orxonox::Shell::exit | ( |  | ) | `[private]`

References clear(), orxonox::InputBuffer::getSize(), inputBuffer_, lines_, scrollIterator_, scrollPosition_, and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

unsigned int orxonox::Shell::getCursorPosition | ( |  | ) | const`[inline]`

Referenced by orxonox::InGameConsole::cursorChanged().

std::list< std::string >::const_iterator orxonox::Shell::getEndIterator | ( |  | ) | const

References lines_.

std::string orxonox::Shell::getFromHistory | ( |  | ) | const`[private]`

References commandHistory_, historyOffset_, historyPosition_, maxHistoryLength_, and orxonox::mod().

Referenced by history_down(), and history_up().

std::string orxonox::Shell::getInput | ( |  | ) | const`[inline]`

InputBuffer* orxonox::Shell::getInputBuffer | ( |  | ) | `[inline]`

Referenced by orxonox::InGameConsole::print().

static Shell& orxonox::Shell::getInstance | ( |  | ) | `[inline, static]`

Referenced by orxonox::InGameConsole::activate(), clearShell(), orxonox::InGameConsole::cursorChanged(), orxonox::InGameConsole::deactivate(), history(), orxonox::InGameConsole::initialise(), orxonox::InGameConsole::inputChanged(), orxonox::InGameConsole::linesChanged(), orxonox::InGameConsole::onlyLastLineChanged(), and orxonox::InGameConsole::print().

std::list< std::string >::const_iterator orxonox::Shell::getNewestLineIterator | ( |  | ) | const

References lines_, scrollIterator_, and scrollPosition_.

Referenced by orxonox::InGameConsole::linesChanged().

unsigned int orxonox::Shell::getNumLines | ( |  | ) | const`[inline]`

OutputBuffer& orxonox::Shell::getOutputBuffer | ( |  | ) | `[inline]`

unsigned int orxonox::Shell::getScrollPosition | ( |  | ) | const`[inline]`

void orxonox::Shell::hintandcomplete | ( |  | ) | `[private]`

References addLine(), orxonox::CommandExecutor::complete(), orxonox::InputBuffer::get(), orxonox::CommandExecutor::hint(), inputBuffer_, inputChanged(), and orxonox::InputBuffer::set().

Referenced by configureInputBuffer().

void orxonox::Shell::history | ( |  | ) | `[static]`

References addLine(), commandHistory_, getInstance(), and historyOffset_.

void orxonox::Shell::history_down | ( |  | ) | `[private]`

References getFromHistory(), historyPosition_, inputBuffer_, and orxonox::InputBuffer::set().

Referenced by configureInputBuffer().

void orxonox::Shell::history_up | ( |  | ) | `[private]`

References commandHistory_, getFromHistory(), historyPosition_, inputBuffer_, and orxonox::InputBuffer::set().

Referenced by configureInputBuffer().

void orxonox::Shell::inputChanged | ( |  | ) | `[private]`

References SHELL_UPDATE_LISTENERS.

Referenced by backspace(), clear(), configureInputBuffer(), deletechar(), hintandcomplete(), and setInput().

void orxonox::Shell::outputChanged | ( |  | ) | `[private, virtual]`

Implements orxonox::OutputBufferListener.

References bAddOutputLevel_, finishedLastLine_, orxonox::OutputBuffer::getLine(), orxonox::OutputHandler::getOutStream(), lines_, outputBuffer_, scrollIterator_, scrollPosition_, and SHELL_UPDATE_LISTENERS.

void orxonox::Shell::registerListener | ( | ShellListener * | listener | ) |

References listeners_.

Referenced by orxonox::InGameConsole::activate().

void orxonox::Shell::scroll_down | ( |  | ) | `[private]`

References lines_, scrollIterator_, scrollPosition_, and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::scroll_up | ( |  | ) | `[private]`

References lines_, scrollIterator_, scrollPosition_, and SHELL_UPDATE_LISTENERS.

Referenced by configureInputBuffer().

void orxonox::Shell::setConfigValues | ( |  | ) | `[virtual]`

Function to collect the SetConfigValue-macro calls.

Reimplemented from orxonox::OrxonoxClass.

References commandHistory_, commandHistoryConfigFileType_, commandHistoryLengthChanged(), commandHistoryOffsetChanged(), historyOffset_, maxHistoryLength_, SetConfigValueGeneric, and SetConfigValueVectorGeneric.

Referenced by Shell().

void orxonox::Shell::setCursorPosition | ( | unsigned int | cursor | ) |

References inputBuffer_, orxonox::InputBuffer::setCursorPosition(), and SHELL_UPDATE_LISTENERS.

void orxonox::Shell::setInput | ( | const std::string & | input | ) |

References inputBuffer_, inputChanged(), and orxonox::InputBuffer::set().

void orxonox::Shell::unregisterListener | ( | ShellListener * | listener | ) |

References listeners_.

Referenced by orxonox::InGameConsole::deactivate().

## Member Data Documentation

bool orxonox::Shell::bAddOutputLevel_`[private]`

Referenced by outputChanged(), and Shell().

std::vector<std::string> orxonox::Shell::commandHistory_`[private]`

Referenced by addToHistory(), commandHistoryLengthChanged(), getFromHistory(), history(), history_up(), and setConfigValues().

ConfigFileType orxonox::Shell::commandHistoryConfigFileType_`[private]`

Referenced by setConfigValues(), and Shell().

bool orxonox::Shell::finishedLastLine_`[private]`

Referenced by addLine(), clearLines(), outputChanged(), and Shell().

unsigned int orxonox::Shell::historyOffset_`[private]`

Referenced by addToHistory(), commandHistoryOffsetChanged(), getFromHistory(), history(), setConfigValues(), and Shell().

unsigned int orxonox::Shell::historyPosition_`[private]`

Referenced by addToHistory(), clear(), getFromHistory(), history_down(), history_up(), and Shell().

InputBuffer* orxonox::Shell::inputBuffer_`[private]`

Referenced by backspace(), clear(), configureInputBuffer(), cursor_end(), cursor_home(), cursor_left(), cursor_right(), deletechar(), execute(), exit(), hintandcomplete(), history_down(), history_up(), setCursorPosition(), setInput(), Shell(), and ~Shell().

std::list<std::string> orxonox::Shell::lines_`[private]`

Referenced by clearLines(), exit(), getEndIterator(), getNewestLineIterator(), outputChanged(), scroll_down(), and scroll_up().

std::list<ShellListener*> orxonox::Shell::listeners_`[private]`

Referenced by registerListener(), and unregisterListener().

unsigned int orxonox::Shell::maxHistoryLength_`[private]`

Referenced by addToHistory(), commandHistoryLengthChanged(), commandHistoryOffsetChanged(), getFromHistory(), setConfigValues(), and Shell().

OutputBuffer orxonox::Shell::outputBuffer_`[private]`

Referenced by addLine(), outputChanged(), and Shell().

std::list<std::string>::const_iterator orxonox::Shell::scrollIterator_`[private]`

Referenced by clearLines(), exit(), getNewestLineIterator(), outputChanged(), scroll_down(), and scroll_up().

unsigned int orxonox::Shell::scrollPosition_`[private]`

Referenced by clearLines(), exit(), getNewestLineIterator(), outputChanged(), scroll_down(), scroll_up(), and Shell().

Shell * orxonox::Shell::singletonRef_s = 0`[static, private]`

Referenced by Shell(), and ~Shell().

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

- src/core/Shell.h
- src/core/Shell.cc