#include <Stream.h>
A stream for ast::Channel
◆ Stream() [1/4]
ast::Stream::Stream |
( |
std::istream * |
istreamPtr, |
|
|
std::ostream * |
ostreamPtr |
|
) |
| |
|
inlineexplicit |
Construct a Stream from input and output std::streams
- Parameters
-
[in] | istreamPtr | source/input stream; may match ostreamPtr ; may be nullptr if sourcing not needed |
[in] | ostreamPtr | sink/output stream; may match istreamPtr ; may be nullptr if sinking not needed |
◆ Stream() [2/4]
◆ ~Stream()
virtual ast::Stream::~Stream |
( |
| ) |
|
|
inlinevirtual |
◆ Stream() [3/4]
ast::Stream::Stream |
( |
Stream const & |
| ) |
|
|
default |
◆ Stream() [4/4]
ast::Stream::Stream |
( |
Stream && |
| ) |
|
|
default |
◆ getIsFits()
bool ast::Stream::getIsFits |
( |
| ) |
const |
|
inline |
◆ hasStdStream()
bool ast::Stream::hasStdStream |
( |
| ) |
|
|
inline |
Return true if this Stream has an input or output std::stream
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setIsFits()
void ast::Stream::setIsFits |
( |
bool |
isFits | ) |
|
|
inlineprotected |
◆ sink()
bool ast::Stream::sink |
( |
char const * |
cstr | ) |
|
|
inline |
Sink (write) to the stream
- Parameters
-
[in] | cstr | data to write; a newline is then written if _isFits false |
- Returns
- true on success or if there is no stream pointer (a normal mode), false if the stream pointer is in a bad state after writing
- Note
- this function is not virtual because of type slicing: this function is called from code that casts a void pointer to a Stream pointer without knowing which kind of Stream it is.
◆ source()
char const* ast::Stream::source |
( |
| ) |
|
|
inline |
Source (read) from the stream
- Returns
- the data read as a C string, or nullptr if there is no source stream or the source stream is empty or in an error state. The Stream owns the string buffer, and it will be invalidated on the next call to this function.
◆ Channel
◆ _isFits
bool ast::Stream::_isFits |
|
protected |
◆ _istreamPtr
std::shared_ptr<std::istream> ast::Stream::_istreamPtr |
|
protected |
◆ _ostreamPtr
std::shared_ptr<std::ostream> ast::Stream::_ostreamPtr |
|
protected |
◆ _sourceStr
std::string ast::Stream::_sourceStr |
|
protected |
string containing a local copy of sourced data, so source can return a char *
that won't disappear right away
The documentation for this class was generated from the following file: