43 : m_stream(s), m_repetition_count(0)
64 std::string::size_type p = str.find_first_of(
'\n');
66 if ( p == std::string::npos )
67 m_current_line += str;
71 m_current_line += str.substr(0, p);
73 output_current_line();
75 if ( p != str.length() )
76 write( str.substr(p) );
93 void claw::log_stream_uniq::output_current_line()
95 if ( m_current_line == m_previous_line )
99 if ( m_repetition_count > 0 )
101 std::ostringstream oss;
102 oss <<
claw_gettext(
"(Previous line repeated ") << m_repetition_count
103 <<
claw_ngettext(
" time)",
" times)", m_repetition_count) <<
'\n';
105 m_stream->write(oss.str());
108 m_repetition_count = 0;
110 m_previous_line = m_current_line;
111 m_stream->write( m_current_line );
114 m_current_line.clear();