Changeset 6010 for code/branches/console/src/libraries/core/Shell.h
- Timestamp:
- Oct 31, 2009, 11:13:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/libraries/core/Shell.h
r6004 r6010 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * Reto Grieder 26 26 * 27 27 */ … … 61 61 }; 62 62 63 63 64 class _CoreExport Shell : virtual public OrxonoxClass, public OutputListener 64 65 { 65 66 public: 66 Shell(const std::string& consoleName, bool bScrollable );67 virtual~Shell();67 Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel = false); 68 ~Shell(); 68 69 69 70 void setConfigValues(); … … 81 82 { return this->inputBuffer_->getCursorPosition(); } 82 83 83 void setInput(const std::string& input);84 85 inline void clearInput()86 { this->setInput(""); }87 84 inline std::string getInput() const 88 85 { return this->inputBuffer_->get(); } … … 91 88 std::list<std::string>::const_iterator getEndIterator() const; 92 89 93 void add Line(const std::string& line, int level = 0);94 void clear Lines();90 void addOutputLine(const std::string& line, int level = 0); 91 void clearOutput(); 95 92 96 93 inline unsigned int getNumLines() const … … 99 96 { return this->scrollPosition_; } 100 97 101 inline void addOutputLevel(bool bAddOutputLevel)102 { this->bAddOutputLevel_ = bAddOutputLevel; }98 inline const std::string& getPromptPrefix() const { return this->promptPrefix_; } 99 void setPromptPrefix(const std::string& str); 103 100 104 101 private: 105 102 Shell(const Shell& other); 106 103 104 void addToHistory(const std::string& command); 105 std::string getFromHistory() const; 106 void clearInput(); 107 // OutputListener 108 void outputChanged(int level); 109 107 110 void configureInputBuffer(); 108 111 109 void addToHistory(const std::string& command); 110 std::string getFromHistory() const; 111 112 virtual void outputChanged(int level); 113 112 // InputBuffer callbacks 114 113 void inputChanged(); 115 114 void execute(); 116 void hint andcomplete();115 void hintAndComplete(); 117 116 void backspace(); 118 void deletechar(); 119 void clear(); 120 void cursor_right(); 121 void cursor_left(); 122 void cursor_end(); 123 void cursor_home(); 124 void history_up(); 125 void history_down(); 126 void history_search_up(); 127 void history_search_down(); 128 void scroll_up(); 129 void scroll_down(); 117 void deleteChar(); 118 void cursorRight(); 119 void cursorLeft(); 120 void cursorEnd(); 121 void cursorHome(); 122 void historyUp(); 123 void historyDown(); 124 void historySearchUp(); 125 void historySearchDown(); 126 void scrollUp(); 127 void scrollDown(); 130 128 void exit(); 131 129 … … 138 136 139 137 std::list<ShellListener*> listeners_; 140 InputBuffer* inputBuffer_;141 std::stringstream outputBuffer_;142 bool finishedLastLine_;143 std::list<std::string> outputLines_;138 InputBuffer* inputBuffer_; 139 std::stringstream outputBuffer_; 140 bool bFinishedLastLine_; 141 std::list<std::string> outputLines_; 144 142 std::list<std::string>::const_iterator scrollIterator_; 145 unsigned int scrollPosition_; 146 unsigned int historyPosition_; 147 bool bAddOutputLevel_; 148 ConfigFileType commandHistoryConfigFileType_; 149 const std::string consoleName_; 150 const bool bScrollable_; 143 unsigned int scrollPosition_; 144 unsigned int historyPosition_; 145 ConfigFileType commandHistoryConfigFileType_; 146 147 std::string promptPrefix_; 148 const std::string consoleName_; 149 const bool bPrependOutputLevel_; 150 const bool bScrollable_; 151 151 152 152 // Config values 153 unsigned int maxHistoryLength_;154 unsigned int historyOffset_;155 std::vector<std::string> commandHistory_;156 int softDebugLevel_;153 unsigned int maxHistoryLength_; 154 unsigned int historyOffset_; 155 std::vector<std::string> commandHistory_; 156 int softDebugLevel_; 157 157 }; 158 158 }
Note: See TracChangeset
for help on using the changeset viewer.