1 | // |
---|---|
2 | // NullStream.cpp |
3 | // |
4 | // Library: Foundation |
5 | // Package: Streams |
6 | // Module: NullStream |
7 | // |
8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. |
9 | // and Contributors. |
10 | // |
11 | // SPDX-License-Identifier: BSL-1.0 |
12 | // |
13 | |
14 | |
15 | #include "Poco/NullStream.h" |
16 | |
17 | |
18 | namespace Poco { |
19 | |
20 | |
21 | NullStreamBuf::NullStreamBuf() |
22 | { |
23 | } |
24 | |
25 | |
26 | NullStreamBuf::~NullStreamBuf() |
27 | { |
28 | } |
29 | |
30 | |
31 | int NullStreamBuf::readFromDevice() |
32 | { |
33 | return -1; |
34 | } |
35 | |
36 | |
37 | int NullStreamBuf::writeToDevice(char c) |
38 | { |
39 | return charToInt(c); |
40 | } |
41 | |
42 | |
43 | NullIOS::NullIOS() |
44 | { |
45 | poco_ios_init(&_buf); |
46 | } |
47 | |
48 | |
49 | NullIOS::~NullIOS() |
50 | { |
51 | } |
52 | |
53 | |
54 | NullInputStream::NullInputStream(): std::istream(&_buf) |
55 | { |
56 | } |
57 | |
58 | |
59 | NullInputStream::~NullInputStream() |
60 | { |
61 | } |
62 | |
63 | |
64 | NullOutputStream::NullOutputStream(): std::ostream(&_buf) |
65 | { |
66 | } |
67 | |
68 | |
69 | NullOutputStream::~NullOutputStream() |
70 | { |
71 | } |
72 | |
73 | |
74 | } // namespace Poco |
75 |