LRAUV  revA
IOStream.h
Go to the documentation of this file.
1 
10 #ifndef IOSTREAM_H_
11 #define IOSTREAM_H_
12 
13 #include "InStream.h"
14 #include "OutStream.h"
15 
16 class NullIOStream;
17 
30 class IOStream: public InStream, public OutStream
31 {
32 };
33 
47 class NullIOStream: public IOStream
48 {
50  virtual InStream& read( char* buffer, unsigned int num )
51  {
52  return *this;
53  }
54 
56  virtual bool isReadable()
57  {
58  return false;
59  }
60 
62  virtual bool eof()
63  {
64  return true;
65  }
66 
68  virtual OutStream& write( const char* buffer, unsigned int num )
69  {
70  return *this;
71  }
72 
74  virtual bool isWritable()
75  {
76  return false;
77  }
78 
79 };
80 
81 #endif /* IOSTREAM_H_ */
This is a rather abstract class that can be implemented by classes that want to send and receive stre...
Definition: IOStream.h:30
virtual bool isWritable()
indicates that the stream can't actually be written to.
Definition: IOStream.h:74
Contains the OutStream class declaration.
This is a very abstract class that can be implemented by classes that want to receive stream input...
Definition: InStream.h:29
Contains the InStream and NullInStream class declarations.
virtual bool isReadable()
indicates that the stream can't actually be read from.
Definition: IOStream.h:56
virtual bool eof()
Indicates that the end of file has been reached.
Definition: IOStream.h:62
virtual OutStream & write(const char *buffer, unsigned int num)
doesn't write num bytes from buffer to the output buffer/stream
Definition: IOStream.h:68
This is a very abstract class that can be implemented by classes that want to send stream output...
Definition: OutStream.h:41
This is an implementation of IOStream that does nothing.
Definition: IOStream.h:47
virtual InStream & read(char *buffer, unsigned int num)
doesn't really read num bytes from stream to the buffer
Definition: IOStream.h:50