MyGUI  3.2.1
MyGUI_LogStream.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_LOG_STREAM_H__
00008 #define __MYGUI_LOG_STREAM_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include <string.h>
00012 #include <sstream>
00013 
00014 namespace MyGUI
00015 {
00016 
00017     class MYGUI_EXPORT LogStream
00018     {
00019     public:
00020         struct End { };
00021 
00022     public:
00023         std::string operator << (const End& _endl)
00024         {
00025             return mStream.str();
00026         }
00027 
00028         template <typename T>
00029         LogStream& operator << (T _value)
00030         {
00031             mStream << _value;
00032             return *this;
00033         }
00034 
00035     private:
00036         std::ostringstream mStream;
00037     };
00038 
00039 } // namespace MyGUI
00040 
00041 #endif // __MYGUI_LOG_STREAM_H__