aboutsummaryrefslogtreecommitdiff
path: root/src/stable/membuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/membuf.h')
-rw-r--r--src/stable/membuf.h86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/stable/membuf.h b/src/stable/membuf.h
index f016974..f36e0bc 100644
--- a/src/stable/membuf.h
+++ b/src/stable/membuf.h
@@ -16,53 +16,53 @@
16 16
17namespace Bu 17namespace Bu
18{ 18{
19 /** 19 /**
20 * A memory buffer stream. This provides a read/write stream in memory that 20 * A memory buffer stream. This provides a read/write stream in memory that
21 * works exactly like a file stream...only in memory. You can seed the 21 * works exactly like a file stream...only in memory. You can seed the
22 * memory buffer with a Bu::String of your own, or start with an empty one. 22 * memory buffer with a Bu::String of your own, or start with an empty one.
23 * Due to Bu::String using Bu::SharedCore starting with a string will not 23 * Due to Bu::String using Bu::SharedCore starting with a string will not
24 * necesarilly cause the MemBuf to make a copy of your memory, but if you're 24 * necesarilly cause the MemBuf to make a copy of your memory, but if you're
25 * sure you're not going to need to change the stream then use StaticMemBuf. 25 * sure you're not going to need to change the stream then use StaticMemBuf.
26 *@ingroup Streams 26 *@ingroup Streams
27 */ 27 */
28 class MemBuf : public Stream 28 class MemBuf : public Stream
29 { 29 {
30 public: 30 public:
31 MemBuf(); 31 MemBuf();
32 MemBuf( const Bu::String &str ); 32 MemBuf( const Bu::String &str );
33 virtual ~MemBuf(); 33 virtual ~MemBuf();
34 34
35 virtual void close(); 35 virtual void close();
36 virtual size read( void *pBuf, size iBytes ); 36 virtual size read( void *pBuf, size iBytes );
37 37
38 virtual size write( const void *pBuf, size iBytes ); 38 virtual size write( const void *pBuf, size iBytes );
39 using Stream::write; 39 using Stream::write;
40 virtual size tell(); 40 virtual size tell();
41 virtual void seek( size offset ); 41 virtual void seek( size offset );
42 virtual void setPos( size pos ); 42 virtual void setPos( size pos );
43 virtual void setPosEnd( size pos ); 43 virtual void setPosEnd( size pos );
44 virtual bool isEos(); 44 virtual bool isEos();
45 virtual bool isOpen(); 45 virtual bool isOpen();
46 virtual void flush(); 46 virtual void flush();
47 virtual bool canRead(); 47 virtual bool canRead();
48 virtual bool canWrite(); 48 virtual bool canWrite();
49 virtual bool isReadable(); 49 virtual bool isReadable();
50 virtual bool isWritable(); 50 virtual bool isWritable();
51 virtual bool isSeekable(); 51 virtual bool isSeekable();
52 virtual bool isBlocking(); 52 virtual bool isBlocking();
53 virtual void setBlocking( bool bBlocking=true ); 53 virtual void setBlocking( bool bBlocking=true );
54 virtual void setSize( size iSize ); 54 virtual void setSize( size iSize );
55 virtual size getSize() const; 55 virtual size getSize() const;
56 virtual size getBlockSize() const; 56 virtual size getBlockSize() const;
57 virtual Bu::String getLocation() const; 57 virtual Bu::String getLocation() const;
58 58
59 Bu::String &getString(); 59 Bu::String &getString();
60 void setString( const Bu::String &sNewData ); 60 void setString( const Bu::String &sNewData );
61 61
62 private: 62 private:
63 Bu::String sBuf; 63 Bu::String sBuf;
64 size nPos; 64 size nPos;
65 }; 65 };
66} 66}
67 67
68#endif 68#endif