3rdParty/boost/1.78.0/libs/iostreams/doc/classes/null.html
OverviewAcknowledgmentsHeadersReferenceClass template basic_null_sourceClass template basic_null_sinkClass template basic_null_device
The class templates basic_null_source, basic_null_sink and basic_null_device are models of Device whose member functions all have trivial implementations. A basic_null_source is a Source whose member function read returns -1, indicating end-of-sequence. A basic_null_sink is a Sink whose member function write consumes and ignores the characters passed to it. A basic_null_device combines — depending on its template parameter Mode — the trivial read and write functions just described with a member seek that always returns an invalid stream position.
In addition, each of the above templates is Closable, with a no-op implementation of close.
The templates described here were inspired by Daryle Walker's basic_nullbuf template. See Disconnected Streams.
<boost/iostreams/device/null.hpp>
basic_null_sourceModel of Source whose member function read returns -1, indicating end-of-sequence.
namespaceboost {namespaceiostreams {template<typename[Ch](#null_source_params)>class[basic\_null\_source](#null_source_params){public:typedefCh char_type;typedef[implementation-defined]category;[basic\_null\_source](#null_source_ctor)();
std::streamsize[read](#null_source_read)(char_type* s, std::streamsize n);void[close](#null_source_close)();
};typedefbasic_null_source<char>null\_source;typedefbasic_null_source<wchar\_t>wnull\_source;
} }// End namespace boost::io
|
Ch
| - |
The character type type.
|
basic_null_source::basic_null_sourcebasic_null_source();
Constructs a basic_null_source.
basic_null_source::readstd::streamsize read(char_type* s, std::streamsize n);
Returns -1.
basic_null_source::closevoidclose();
No-op.
basic_null_sinkModel of Sink whose member function write consumes and ignores the contents of the character buffer passed to it.
namespaceboost {namespaceiostreams {template<typename[Ch](#null_sink_params)>class[basic\_null\_sink](#null_sink_params){public:typedefCh char_type;typedef[implementation-defined]category;[basic\_null\_sink](#null_sink_ctor)();
std::streamsize[write](#null_sink_write)(constchar_type* s, std::streamsize n);void[close](#null_sink_close)();
};typedefbasic_null_sink<char>null\_sink;typedefbasic_null_sink<wchar\_t>wnull\_sink;
} }// End namespace boost::io
|
Ch
| - |
The character type type.
|
basic_null_sink::basic_null_sinkbasic_null_sink();
Constructs a basic_null_sink.
basic_null_sink::writestd::streamsize write(constchar_type* s, std::streamsize n);
Returns n.
basic_null_sink::closevoidclose();
No-op.
basic_null_deviceModel of Device whose mode is specified as a template parameter, and whose member functions have trivial implementations, as follows:
read returns -1, indicating end-of-sequencewrite consumes but ignores the entire contents of the character buffer passed to itseek returns an invalid stream positionnamespaceboost {namespaceiostreams {template<typename[Ch](#null_device_params),typename[Mode](#null_device_params)>class[basic\_null\_device](#null_device_params){public:typedefCh char_type;typedef[implementation-defined]category;[basic\_null\_device](#null_device_ctor)();
std::streamsize[read](#null_device_read)(char_type* s, std::streamsize n);
std::streamsize[write](#null_device_write)(constchar_type* s, std::streamsize n);[stream\_offset](../functions/positioning.html#synopsis)[seek](#null_device_seek)([stream\_offset](../functions/positioning.html#synopsis)off, std::ios_base::seekdir way,
std::ios_base::openmode which =
std::ios_base::in | std::ios_base::out );void[close](#null_device_close)();
};
} }// End namespace boost::io
|
Ch
| - |
The character type.
| |
Mode
| - |
The mode.
|
basic_null_device::basic_null_devicebasic_null_device();
Constructs a basic_null_device.
basic_null_device::readstd::streamsize read(char_type* s, std::streamsize n);
Returns -1. Enabled if Mode refines input.
basic_null_device::writestd::streamsize write(constchar_type* s, std::streamsize n);
Returns n. Enabled if Mode refines output.
basic_null_device::seek[stream\_offset](../functions/positioning.html#synopsis)seek([stream\_offset](../functions/positioning.html#synopsis)off, std::ios_base::seekdir way,
std::ios_base::openmode which =
std::ios_base::in | std::ios_base::out );
Returns an invalid stream position. Enabled if Mode permits random access.
basic_null_device::closevoidclose();
No-op.
© Copyright 2008 CodeRage, LLC
© Copyright 2004-2007 Jonathan Turkanis
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)