forked from RipcordSoftware/libhttpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnull_stream.h
More file actions
56 lines (45 loc) · 1.05 KB
/
Copy pathnull_stream.h
File metadata and controls
56 lines (45 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef RS_LIBHTTPSERVER_NULL_STREAM_H
#define RS_LIBHTTPSERVER_NULL_STREAM_H
#include "stream.h"
namespace rs {
namespace httpserver {
/**
* An empty stream
*/
class NullStream : public Stream {
public:
/**
* Performs a no-op
*/
virtual void Flush() override {}
/**
* Reads any pending bytes on the stream
* @return always returns 0
*/
virtual int Read(byte* buffer, int offset, int count, bool peek = false) override {
return 0;
}
/**
* Writes buffer data to the stream
* @return always returns 0
*/
virtual int Write(const byte* buffer, int offset, int count) override {
return 0;
}
/**
* Gets the current position in the stream
* @return always returns 0
*/
virtual long getPosition() override {
return 0;
}
/**
* Gets the length of the stream if known
* @return always returns 0
*/
virtual long getLength() override {
return 0;
}
};
}}
#endif /* RS_LIBHTTPSERVER_NULL_STREAM_H */