|
libtcspc C++ API
Streaming TCSPC and time tag data processing
|
Streams for use with tcspc::read_binary_stream().
An input stream is a movable (usually noncopyable) object with the following member functions:
bytes. Return true if successful.Functions | |
| auto | tcspc::binary_file_input_stream (std::string const &filename, arg::start_offset< u64 > start_offset=arg::start_offset{u64(0)}) |
| Create a binary input stream for the given file. | |
| auto | tcspc::borrowed_cfile_input_stream (std::FILE *fp) |
| Create an input stream from a non-owned C file pointer. | |
| template<typename IStream> | |
| auto | tcspc::istream_input_stream (IStream stream) |
| Create an input stream from an std::istream instance. | |
| auto | tcspc::null_input_stream () |
| Create an input stream that contains no bytes. | |
| auto | tcspc::owning_cfile_input_stream (std::FILE *fp) |
| Create an input stream from a C file pointer, taking ownership. | |
|
inline |
Create a binary input stream for the given file.
If the file cannot be opened, or is smaller than start_offset bytes, the stream will be in an error state.
| filename | the filename |
| start_offset | offset within the file to start reading from |
|
inline |
Create an input stream from a non-owned C file pointer.
The stream will use the C stdio functions, such as std::fread(). The file pointer is not closed when the stream is destroyed. The caller is responsible for ensuring that the file pointer will remain valid throughout the lifetime of the returned input stream.
The file pointer fp should have been opened in binary mode. (If using stdin, use std::freopen() with a null filename on POSIX or _setmode() with _O_BINARY on Windows (via _fileno()).)
If fp is null, the stream will always be in an error state.
| fp | a file pointer |
|
inline |
Create an input stream from an std::istream instance.
The istream is moved into the returned input stream and destroyed together, so you cannot use this with an istream that you do not own (such as std::cin). For that, see tcspc::borrowed_cfile_input_stream (which works with stdin).
Due to poor performance, use of this stream type is not recommended unless you must interface with an existing std::istream.
| stream | an istream (derived from std::istream) |
|
inline |
Create an input stream that contains no bytes.
|
inline |
Create an input stream from a C file pointer, taking ownership.
The stream will use the C stdio functions, such as std::fread(). The file pointer is closed when the stream is destroyed.
The file pointer fp should have been opened in binary mode.
If fp is null, the stream will always be in an error state.
| fp | a file pointer |