aboutsummaryrefslogtreecommitdiff
path: root/src/stable/nullstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/nullstream.h')
-rw-r--r--src/stable/nullstream.h92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/stable/nullstream.h b/src/stable/nullstream.h
index 034b0c5..a8b24e3 100644
--- a/src/stable/nullstream.h
+++ b/src/stable/nullstream.h
@@ -12,56 +12,56 @@
12 12
13namespace Bu 13namespace Bu
14{ 14{
15 /** 15 /**
16 * Works a lot like /dev/null on *nix style systems. This class allows 16 * Works a lot like /dev/null on *nix style systems. This class allows
17 * infinite reading and writing. All operatorns "succeed" even if they 17 * infinite reading and writing. All operatorns "succeed" even if they
18 * don't seem to do anything. This is great for testing writing code or 18 * don't seem to do anything. This is great for testing writing code or
19 * doing dry runs. When reading, it will produce NULL bytes, so any 19 * doing dry runs. When reading, it will produce NULL bytes, so any
20 * application that would like the ability to produce null streams as a 20 * application that would like the ability to produce null streams as a
21 * snap-in replacement for any other Bu::Stream, this is the right option. 21 * snap-in replacement for any other Bu::Stream, this is the right option.
22 * 22 *
23 * As an added feature, the NullStream will track how many bytes it was 23 * As an added feature, the NullStream will track how many bytes it was
24 * asked to read and write, allowing you to use it to determine how many 24 * asked to read and write, allowing you to use it to determine how many
25 * bytes a write opretion would use without actually writing anything. 25 * bytes a write opretion would use without actually writing anything.
26 */ 26 */
27 class NullStream : public Bu::Stream 27 class NullStream : public Bu::Stream
28 { 28 {
29 public: 29 public:
30 NullStream(); 30 NullStream();
31 virtual ~NullStream(); 31 virtual ~NullStream();
32 32
33 virtual void close(); 33 virtual void close();
34 virtual Bu::size read( void *pBuf, Bu::size nBytes ); 34 virtual Bu::size read( void *pBuf, Bu::size nBytes );
35 virtual Bu::String readLine(); 35 virtual Bu::String readLine();
36 virtual Bu::size write( const void *pBuf, Bu::size nBytes ); 36 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
37 using Bu::Stream::write; 37 using Bu::Stream::write;
38 virtual Bu::size tell(); 38 virtual Bu::size tell();
39 virtual void seek( Bu::size offset ); 39 virtual void seek( Bu::size offset );
40 virtual void setPos( Bu::size pos ); 40 virtual void setPos( Bu::size pos );
41 virtual void setPosEnd( Bu::size pos ); 41 virtual void setPosEnd( Bu::size pos );
42 virtual bool isEos(); 42 virtual bool isEos();
43 virtual bool isOpen(); 43 virtual bool isOpen();
44 virtual void flush(); 44 virtual void flush();
45 virtual bool canRead(); 45 virtual bool canRead();
46 virtual bool canWrite(); 46 virtual bool canWrite();
47 virtual bool isReadable(); 47 virtual bool isReadable();
48 virtual bool isWritable(); 48 virtual bool isWritable();
49 virtual bool isSeekable(); 49 virtual bool isSeekable();
50 virtual bool isBlocking(); 50 virtual bool isBlocking();
51 virtual void setBlocking( bool bBlocking=true ); 51 virtual void setBlocking( bool bBlocking=true );
52 virtual void setSize( Bu::size iSize ); 52 virtual void setSize( Bu::size iSize );
53 53
54 virtual size getSize() const; 54 virtual size getSize() const;
55 virtual size getBlockSize() const; 55 virtual size getBlockSize() const;
56 virtual Bu::String getLocation() const; 56 virtual Bu::String getLocation() const;
57 57
58 Bu::size getBytesRead() { return sRead; } 58 Bu::size getBytesRead() { return sRead; }
59 Bu::size getByetsWritten() { return sWrote; } 59 Bu::size getByetsWritten() { return sWrote; }
60 60
61 private: 61 private:
62 Bu::size sRead; 62 Bu::size sRead;
63 Bu::size sWrote; 63 Bu::size sWrote;
64 }; 64 };
65}; 65};
66 66
67#endif 67#endif