Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 4, 2013, 11:23:57 PM (12 years ago)
Author:
landauf
Message:

ConsoleWriter now accepts and writes to any std::ostream, not just std::cout. Makes it easier to test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/src/libraries/util/output/ConsoleWriter.h

    r9536 r9537  
    3737
    3838#include "util/UtilPrereqs.h"
     39
     40#include <ostream>
     41
    3942#include "BaseWriter.h"
    4043
     
    5053    {
    5154        public:
    52             ConsoleWriter();
     55            ConsoleWriter(std::ostream& outputStream);
    5356            ConsoleWriter(const ConsoleWriter&);
    5457            virtual ~ConsoleWriter();
     
    5760            void disable();
    5861
     62            inline const std::ostream& getOutputStream() const
     63                { return this->outputStream_; }
     64
    5965        protected:
    6066            virtual void printLine(const std::string& line, OutputLevel level);
    6167
    6268        private:
    63             bool bEnabled_; ///< If false, the instance will not write output to the console.
     69            std::ostream& outputStream_; ///< The ostream to which the console writer writes its output
     70            bool bEnabled_;              ///< If false, the instance will not write output to the console.
    6471    };
    6572}
Note: See TracChangeset for help on using the changeset viewer.