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
18namespace Poco {
19
20
21NullStreamBuf::NullStreamBuf()
22{
23}
24
25
26NullStreamBuf::~NullStreamBuf()
27{
28}
29
30
31int NullStreamBuf::readFromDevice()
32{
33 return -1;
34}
35
36
37int NullStreamBuf::writeToDevice(char c)
38{
39 return charToInt(c);
40}
41
42
43NullIOS::NullIOS()
44{
45 poco_ios_init(&_buf);
46}
47
48
49NullIOS::~NullIOS()
50{
51}
52
53
54NullInputStream::NullInputStream(): std::istream(&_buf)
55{
56}
57
58
59NullInputStream::~NullInputStream()
60{
61}
62
63
64NullOutputStream::NullOutputStream(): std::ostream(&_buf)
65{
66}
67
68
69NullOutputStream::~NullOutputStream()
70{
71}
72
73
74} // namespace Poco
75