summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index beb4b08..a18be11 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,3 +1,10 @@
1/*
2 * Copyright (C) 2007-2008 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
1#ifndef BU_BUFFER_H 8#ifndef BU_BUFFER_H
2#define BU_BUFFER_H 9#define BU_BUFFER_H
3 10
@@ -18,15 +25,23 @@ namespace Bu
18 virtual size_t write( const void *pBuf, size_t nBytes ); 25 virtual size_t write( const void *pBuf, size_t nBytes );
19 using Stream::write; 26 using Stream::write;
20 27
28 size_t getReadFill() { return iReadBufFill; }
29 bool isWritePending() { return iWriteBufFill > 0; }
30
21 virtual void flush(); 31 virtual void flush();
22 32
23 private: 33 private:
34 void fillReadBuf();
35
36 private:
24 size_t sSoFar; 37 size_t sSoFar;
25 int iBufSize; 38 int iBufSize;
26 char *sReadBuf; 39 char *sReadBuf;
27 char *sWriteBuf; 40 char *sWriteBuf;
28 int iReadBufFill; 41 int iReadBufFill;
42 int iReadPos;
29 int iWriteBufFill; 43 int iWriteBufFill;
44 int iWritePos;
30 }; 45 };
31}; 46};
32 47