Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2009, 10:43:43 PM (14 years ago)
Author:
rgrieder
Message:

Extended Shell line colouring in order to distinguish output from COUT, entered commands and hints.

File:
1 edited

Legend:

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

    r6105 r6180  
    6565    {
    6666        public:
    67             Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel = false);
     67            enum LineType
     68            {
     69                None    = OutputLevel::None,
     70                Warning = OutputLevel::Warning,
     71                Error   = OutputLevel::Error,
     72                Info    = OutputLevel::Info,
     73                Debug   = OutputLevel::Debug,
     74                Verbose = OutputLevel::Verbose,
     75                Ultra   = OutputLevel::Ultra,
     76                Input,
     77                Command,
     78                Hint
     79            };
     80
     81            Shell(const std::string& consoleName, bool bScrollable);
    6882            ~Shell();
    6983
     
    8599                { return this->inputBuffer_->get(); }
    86100
    87             std::list<std::string>::const_iterator getNewestLineIterator() const;
    88             std::list<std::string>::const_iterator getEndIterator() const;
     101            typedef std::list<std::pair<std::string, LineType> > LineList;
     102            LineList::const_iterator getNewestLineIterator() const;
     103            LineList::const_iterator getEndIterator() const;
    89104
    90             void addOutputLine(const std::string& line, int level = 0);
     105            void addOutputLine(const std::string& line, LineType type = None);
    91106            void clearOutput();
    92107
     
    139154            std::stringstream         outputBuffer_;
    140155            bool                      bFinishedLastLine_;
    141             std::list<std::string>    outputLines_;
    142             std::list<std::string>::const_iterator scrollIterator_;
     156            LineList                  outputLines_;
     157            LineList::const_iterator scrollIterator_;
    143158            unsigned int              scrollPosition_;
    144159            unsigned int              historyPosition_;
     
    147162            std::string               promptPrefix_;
    148163            const std::string         consoleName_;
    149             const bool                bPrependOutputLevel_;
    150164            const bool                bScrollable_;
    151165
Note: See TracChangeset for help on using the changeset viewer.