Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030 #ifndef __CLAW_LOG_STREAM_UNIQ_HPP__
00031 #define __CLAW_LOG_STREAM_UNIQ_HPP__
00032
00033 #include <string>
00034 #include <claw/log_stream.hpp>
00035
00036 #ifndef CLAW_LOGGER_EXPORT
00037 # ifdef CLAW_LOGGER_NO_EXPORT
00038 # define CLAW_LOGGER_EXPORT
00039 # else
00040 # ifdef _WIN32
00041 # ifdef claw_logger_EXPORTS
00042 # define CLAW_LOGGER_EXPORT __declspec(dllexport)
00043 # else
00044 # define CLAW_LOGGER_EXPORT __declspec(dllimport)
00045 # endif // def claw_logger_EXPORTS
00046 # else // def _WIN32
00047 # define CLAW_LOGGER_EXPORT
00048 # endif // def _WIN32
00049 # endif // def CLAW_LOGGER_NO_EXPORT
00050 #endif // ndef CLAW_LOGGER_EXPORT
00051
00052 namespace claw
00053 {
00058 class CLAW_LOGGER_EXPORT log_stream_uniq:
00059 public log_stream,
00060 public pattern::non_copyable
00061 {
00062 public:
00063 explicit log_stream_uniq( log_stream* s );
00064 virtual ~log_stream_uniq();
00065
00066 virtual void write( const std::string& str );
00067 virtual void flush();
00068
00069 private:
00070 void output_current_line();
00071
00072 private:
00074 log_stream* m_stream;
00075
00077 std::string m_current_line;
00078
00080 std::string m_previous_line;
00081
00083 std::size_t m_repetition_count;
00084
00085 };
00086 }
00087
00088 #endif // __CLAW_LOG_STREAM_UNIQ_HPP__