added: some work in membuffer and textstreambase

git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@426 e52654a7-88a9-db11-a3e9-0013d4bc506e
master
Tomasz Sowa 11 years ago
parent d2d30cf640
commit 600d0fc34a

@ -115,7 +115,7 @@ public:
MemBuffer & operator=(const MemBuffer<item_type, stack_size, heap_block_size> & 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<typename arg_item_type, size_t arg_stack_size, size_t arg_heap_block_size>
void append(const MemBuffer<arg_item_type, arg_stack_size, arg_heap_block_size> & arg);
@ -553,7 +553,7 @@ void MemBuffer<item_type, stack_size, heap_block_size>::append(item_type item)
template<typename item_type, size_t stack_size, size_t heap_block_size>
void MemBuffer<item_type, stack_size, heap_block_size>::append(item_type * item_array, size_t len)
void MemBuffer<item_type, stack_size, heap_block_size>::append(const item_type * item_array, size_t len)
{
if( size_used + len <= stack_size )
{

@ -105,16 +105,26 @@ public:
TextStreamBase & operator<<(const PT::Space & space);
TextStreamBase & operator<<(const PT::Date & date);
template<typename arg_char_type, size_t arg_stack_size, size_t arg_heap_block_size>
TextStreamBase & operator<<(const TextStreamBase<arg_char_type, arg_stack_size, arg_heap_block_size> & 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<char, 256, 4096> TextStream;
typedef TextStreamBase<wchar_t, 256, 4096> WTextStream;
template<typename char_type, size_t stack_size, size_t heap_block_size>
TextStreamBase<char_type, stack_size, heap_block_size>::TextStreamBase()
@ -430,6 +440,20 @@ return *this;
}
template<typename char_type, size_t stack_size, size_t heap_block_size>
template<typename arg_char_type, size_t arg_stack_size, size_t arg_heap_block_size>
TextStreamBase<char_type, stack_size, heap_block_size> &
TextStreamBase<char_type, stack_size, heap_block_size>::operator<<(
const TextStreamBase<arg_char_type, arg_stack_size, arg_heap_block_size> & arg)
{
buffer.append(arg.buffer);
return *this;
}
} // namespace

Loading…
Cancel
Save