Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2009, 2:47:14 PM (16 years ago)
Author:
rgrieder
Message:

Changed Output concept a little bit to allow for more general use.
Every output (log) target has to be implemented as OutputListener. There is already a LogFileWriter and a MemoryLogWriter (stores ALL the log in a vector and provides iterators).
The OutputListener has a unique and constant name, a stream pointer and a soft debug level (that can only be changed via OutputHandler::setSoftDebugLevel(name, level)).
This concept doesn't require the OutputBuffer anymore, so I deleted it.

The adjustments in the Shell are just preliminary for this commit.

File:
1 edited

Legend:

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

    r5986 r5994  
    3434#include <cassert>
    3535#include <list>
     36#include <sstream>
    3637#include <string>
    3738#include <vector>
    3839
    39 #include "util/OutputBuffer.h"
     40#include "util/OutputHandler.h"
    4041#include "input/InputBuffer.h"
    4142#include "OrxonoxClass.h"
     
    6162    };
    6263
    63     class _CoreExport Shell : public Singleton<Shell>, virtual public OrxonoxClass, public OutputBufferListener
     64    class _CoreExport Shell : public Singleton<Shell>, virtual public OrxonoxClass, public OutputListener
    6465    {
    6566        friend class Singleton<Shell>;
     
    7172            static void history();
    7273
    73             virtual void setConfigValues();
     74            void setConfigValues();
    7475            void commandHistoryOffsetChanged();
    7576            void commandHistoryLengthChanged();
     
    8081            inline InputBuffer* getInputBuffer()
    8182                { return this->inputBuffer_; }
    82             inline OutputBuffer& getOutputBuffer()
    83                 { return this->outputBuffer_; }
    8483
    8584            void setCursorPosition(unsigned int cursor);
     
    117116
    118117            virtual void outputChanged();
     118
    119119            void inputChanged();
    120120            void execute();
     
    144144            std::list<ShellListener*> listeners_;
    145145            InputBuffer* inputBuffer_;
    146             OutputBuffer outputBuffer_;
     146            std::stringstream outputBuffer_;
    147147            bool finishedLastLine_;
    148148            std::list<std::string> lines_;
     
    154154            unsigned int historyOffset_;
    155155            bool bAddOutputLevel_;
     156            int softDebugLevel_;
    156157
    157158            ConfigFileType commandHistoryConfigFileType_;
Note: See TracChangeset for help on using the changeset viewer.