added: to Log:

operator<<(const PT::TextStreamBase<>())



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@865 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-07-25 10:28:41 +00:00
parent ca0a5c9cbe
commit 1ec61ffa11
14 changed files with 942 additions and 654 deletions

View File

@@ -17,6 +17,7 @@
#include <string>
#include "textstream.h"
#include "logmanipulators.h"
#include "textstream/textstream.h"
@@ -46,6 +47,9 @@ public:
Log & operator<<(LogManipulators m);
Log & operator<<(const PT::Date & date);
template<typename char_type, size_t stack_size, size_t heap_block_size>
Log & operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf);
template<class StringType>
void LogString(const StringType & value, size_t max_size);
@@ -117,6 +121,27 @@ size_t min_size = value.size() < max_size ? value.size() : max_size;
template<typename char_type, size_t stack_size, size_t heap_block_size>
Log & Log::operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
{
if( current_level > log_level )
return *this;
typename PT::TextStreamBase<char_type, stack_size, heap_block_size>::const_iterator i = buf.begin();
// in the future we change buffer to PT::TextStreamBuffer
// so then there'll be << operator
for( ; i != buf.end() ; ++i)
buffer << *i;
return *this;
}
extern Log log;
extern Log nlog;