Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 29, 2011, 10:26:45 PM (13 years ago)
Author:
landauf
Message:

Shell and its derivatives are now based on the new output system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/core/command/Shell.h

    r8729 r8795  
    4848#include <vector>
    4949
    50 #include "util/OutputHandler.h"
     50#include "util/output/BaseWriter.h"
    5151#include "core/Core.h"
    5252#include "core/OrxonoxClass.h"
     
    7878        @brief The Shell is the logical component of the console that displays output to the user and allows him to enter commands.
    7979
    80         The Shell gathers output sent from OutputHandler by inheriting from OutputListener.
     80        The Shell gathers output sent from OutputManager by inheriting from BaseWriter.
    8181        The output-lines are stored in the shell, so they can be displayed in a graphical
    8282        console. Additionally the Shell has an InputBuffer which is needed by the user to
     
    8585        Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole.
    8686    */
    87     class _CoreExport Shell : public OutputListener, public DevModeListener
     87    class _CoreExport Shell : public BaseWriter, public DevModeListener
    8888    {
    8989        public:
     
    9191            enum LineType
    9292            {
    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,
     93                DebugOutput     = debug_output,
     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,
    101106                Input,
    102107                Command,
     
    127132            LineList::const_iterator getEndIterator() const;
    128133
    129             void addOutput(const std::string& text, LineType type = None);
     134            void addOutput(const std::string& text, LineType type = DebugOutput);
    130135            void clearOutput();
    131136
     
    150155            const std::string& getFromHistory() const;
    151156            void clearInput();
    152             // OutputListener
    153             void outputChanged(int level);
     157            // BaseWriter
     158            virtual void printLine(const std::string& line, OutputLevel level);
    154159
    155160            void configureInputBuffer();
     
    183188            std::list<ShellListener*> listeners_;           ///< The registered shell listeners
    184189            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 OutputListener
    186             bool                      bFinishedLastLine_;   ///< Stores if the most recent output-line was terminated with a line-break or if more output is expected for this line
    187190            LineList                  outputLines_;         ///< A list of all output-lines that were displayed in the shell so far
    188191            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
     
    197200            unsigned int              historyOffset_;       ///< The command history is a circular buffer, this variable defines the current write-offset
    198201            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)
     202            OutputLevel               debugLevel_;          //!< The maximum level of output that is displayed in the shell (will be passed to OutputListener to filter output)
    200203            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
    201204    };
Note: See TracChangeset for help on using the changeset viewer.