#include <dsStrstream.h>
Inheritance diagram for dsStrstream:
Public Methods | |
dsStrstream () | |
dsStrstream (const dsStrstream &s) | |
dsStrstream (char *s, int n, std::ios::openmode mode=std::ios::out|std::ios::in) | |
virtual | ~dsStrstream () |
dsStrstreambuf * | rdbuf () const |
size_t | pcount () |
char * | str () |
void | freeze (bool n=true) |
void | clear () |
str() always return zero terminated string, but terminating zero is out of egptr(). It allows code like for(int i=0; i < 26; ++i) { dstr << '/' << (char) i + 'A'; mkdir( dstr.str(), 0666 ); }
str() function doesn't call freeze() IMHO, returning pointer to dynamic string is bad programming parctice, from other side invalid pointer can be located easier, then memory leaks caused by freezed stream.
clear() Clear function returns dynamic stream to initial state and reset get and put pointers for static stream.
setseg(size_t newSize) Allow manage buffer increment at runtime, larger value increase speed, small value decrease memory consumption
seekp(n,ios::end) do the same as ios::cur. IMHO, there is now such thing as end of strstream.
Stream configuration section (change it with care because most of libdms4 internals require _DS_AUTOTERMINATE is turned on and _DS_ENABLE_AUTOFREEZE turned off)
Stream configuration contains a number of defines controlling behavioure of stream. _DS_AUTOTERMINATE - initialize allocated buffer by zero, it can slow down overflow, but keppi buffer always terminated. _DS_ENABLE_AUTOFREEZE - str() will call freeze(), the same way as std:strstream does _DS_USE_SGI_SEEK_ROUTINE - use strstreambuf::seekoff() written by SGI, and used in libstdc++
_DS_ADAPTIVE_INCREMENT - add N*_DS_SEGMENT_SIZE on each overflow instead of _DS_SEGMENT_SIZE where N is number of expansions. _DS_SEGMENT_SIZE - default value of buffer increment segment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|