1
#ifndef TmpOutputByteStream_INCLUDED
2
#define TmpOutputByteStream_INCLUDED 1
4
#include "OutputByteStream.h"
8
namespace DSSSL_NAMESPACE {
12
using namespace SP_NAMESPACE;
15
class TmpOutputByteStream : public OutputByteStream {
17
enum { bufSize = 1024 };
24
Iter(const TmpOutputByteStream &sb) : block_(sb.head_), lastBlockUsed_(sb.lastBlockUsed()) { }
25
bool next(const char *&p, size_t &n) {
28
n = block_->next ? TmpOutputByteStream::bufSize : lastBlockUsed_;
29
block_ = block_->next;
37
size_t lastBlockUsed_;
39
TmpOutputByteStream();
40
~TmpOutputByteStream();
41
bool isEmpty() { return head_ == 0; }
43
void flushBuf(char ch);
46
size_t lastBlockUsed() const {
47
return last_ ? (ptr_ - last_->buf) : 0;
49
unsigned nFullBlocks_;
54
#ifdef DSSSL_NAMESPACE
58
#endif /* not OutputByteStream_INCLUDED */