diff --git a/membuffer/membuffer.h b/membuffer/membuffer.h index 6accc92..5e9850a 100644 --- a/membuffer/membuffer.h +++ b/membuffer/membuffer.h @@ -115,7 +115,7 @@ public: MemBuffer & operator=(const MemBuffer & arg); void append(item_type item); - void append(item_type * item_array, size_t len); + void append(const item_type * item_array, size_t len); template void append(const MemBuffer & arg); @@ -553,7 +553,7 @@ void MemBuffer::append(item_type item) template -void MemBuffer::append(item_type * item_array, size_t len) +void MemBuffer::append(const item_type * item_array, size_t len) { if( size_used + len <= stack_size ) { diff --git a/textstream/textstream.h b/textstream/textstream.h index ec7db84..3f93a5e 100644 --- a/textstream/textstream.h +++ b/textstream/textstream.h @@ -105,16 +105,26 @@ public: TextStreamBase & operator<<(const PT::Space & space); TextStreamBase & operator<<(const PT::Date & date); + template + TextStreamBase & operator<<(const TextStreamBase & arg); + TextStreamBase & write(const char * buf, size_t len); TextStreamBase & write(const wchar_t * buf, size_t len); -protected: + /* + raw access + */ int radix; buffer_type buffer; }; +typedef TextStreamBase TextStream; +typedef TextStreamBase WTextStream; + + + template TextStreamBase::TextStreamBase() @@ -430,6 +440,20 @@ return *this; } + +template +template +TextStreamBase & +TextStreamBase::operator<<( + const TextStreamBase & arg) +{ + buffer.append(arg.buffer); + +return *this; +} + + + } // namespace