Changeset 8858 for code/trunk/src/libraries/core/command/Shell.h
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/libraries/core/command/Shell.h
r8729 r8858 48 48 #include <vector> 49 49 50 #include "util/ OutputHandler.h"50 #include "util/output/BaseWriter.h" 51 51 #include "core/Core.h" 52 52 #include "core/OrxonoxClass.h" … … 66 66 private: 67 67 virtual void linesChanged() {} ///< Called if all output-lines have changed 68 virtual void onlyLastLineChanged() {} ///< Called if only the last output-line has changed69 68 virtual void lineAdded() {} ///< Called if a new line was added to the output 70 69 virtual void inputChanged() {} ///< Called if the input has changed … … 78 77 @brief The Shell is the logical component of the console that displays output to the user and allows him to enter commands. 79 78 80 The Shell gathers output sent from Output Handler by inheriting from OutputListener.79 The Shell gathers output sent from OutputManager by inheriting from BaseWriter. 81 80 The output-lines are stored in the shell, so they can be displayed in a graphical 82 81 console. Additionally the Shell has an InputBuffer which is needed by the user to … … 85 84 Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole. 86 85 */ 87 class _CoreExport Shell : public OutputListener, public DevModeListener86 class _CoreExport Shell : public BaseWriter, public DevModeListener 88 87 { 89 88 public: … … 91 90 enum LineType 92 91 { 93 TDebug = OutputLevel::TDebug, 94 None = OutputLevel::None, 95 Warning = OutputLevel::Warning, 96 Error = OutputLevel::Error, 97 Info = OutputLevel::Info, 98 Debug = OutputLevel::Debug, 99 Verbose = OutputLevel::Verbose, 100 Ultra = OutputLevel::Ultra, 92 DebugOutput = debug_output, 93 Message = message, 94 UserError = user_error, 95 UserWarning = user_warning, 96 UserStatus = user_status, 97 UserInfo = user_info, 98 InternalError = internal_error, 99 InternalWarning = internal_warning, 100 InternalStatus = internal_status, 101 InternalInfo = internal_info, 102 Verbose = verbose, 103 VerboseMore = verbose_more, 104 VerboseUltra = verbose_ultra, 105 Cout, 101 106 Input, 102 107 Command, 108 Result, 103 109 Hint 104 110 }; … … 127 133 LineList::const_iterator getEndIterator() const; 128 134 129 void addOutput(const std::string& text, LineType type = None); 135 void addOutput(const std::string& text, LineType type = DebugOutput); 136 void addLine(const std::string& line, LineType type = DebugOutput); 130 137 void clearOutput(); 131 138 … … 150 157 const std::string& getFromHistory() const; 151 158 void clearInput(); 152 // OutputListener153 v oid outputChanged(intlevel);159 // BaseWriter 160 virtual void printLine(const std::string& line, OutputLevel level); 154 161 155 162 void configureInputBuffer(); … … 183 190 std::list<ShellListener*> listeners_; ///< The registered shell listeners 184 191 InputBuffer* inputBuffer_; ///< The input buffer that is needed by the user to enter text 185 std::stringstream outputBuffer_; ///< The output buffer that is used to retrieve lines of output from OutputListener186 bool bFinishedLastLine_; ///< Stores if the most recent output-line was terminated with a line-break or if more output is expected for this line187 192 LineList outputLines_; ///< A list of all output-lines that were displayed in the shell so far 188 193 LineList::const_iterator scrollIterator_; ///< An iterator to an entry of the list of output-lines, changes if the user scrolls through the output in the shell 189 194 unsigned int scrollPosition_; ///< The number of the line that is currently being referenced by scrollIterator_ 190 195 unsigned int historyPosition_; ///< If the user scrolls through the history of entered commands (stored in commandHistory_), this contains the currently viewed history entry 191 192 const std::string consoleName_; ///< The name of this shell - used to define the name of the soft-debug-level config-value193 196 const bool bScrollable_; ///< If true, the user can scroll through the output-lines 194 197 … … 197 200 unsigned int historyOffset_; ///< The command history is a circular buffer, this variable defines the current write-offset 198 201 std::vector<std::string> commandHistory_; ///< The history of commands that were entered by the user 199 int debugLevel_; //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)200 202 static unsigned int cacheSize_s; ///< The maximum cache size of the CommandExecutor - this is stored here for better readability of the config file and because CommandExecutor is no OrxonoxClass 201 203 };
Note: See TracChangeset
for help on using the changeset viewer.