MySQL 8.0.40
Source Code Documentation
|
A stdin input stream based on IO_CACHE. More...
#include <basic_istream.h>
Public Member Functions | |
Stdin_istream () | |
Stdin_istream (const Stdin_istream &)=delete | |
Stdin_istream & | operator= (const Stdin_istream &)=delete |
~Stdin_istream () override | |
bool | open (std::string *errmsg) |
Opens the stdin stream. More... | |
void | close () |
Closes the stream. More... | |
ssize_t | read (unsigned char *buffer, size_t length) override |
Read some bytes from the input stream. More... | |
bool | skip (my_off_t bytes) |
Skip bytes data from the stdin stream. More... | |
Public Member Functions inherited from Basic_istream | |
virtual | ~Basic_istream ()=default |
Private Attributes | |
IO_CACHE | m_io_cache |
A stdin input stream based on IO_CACHE.
It provides a Basic_istream based on stdin.
|
default |
|
delete |
|
override |
void Stdin_istream::close | ( | ) |
Closes the stream.
It deinitializes IO_CACHE.
bool Stdin_istream::open | ( | std::string * | errmsg | ) |
Opens the stdin stream.
It initializes the IO_CACHE with stdin.
[out] | errmsg | An error message is returned if any error happens. |
|
delete |
|
overridevirtual |
Read some bytes from the input stream.
It should read exact 'length' bytes unless error happens or it reaches the end of the stream. It should block when reaching the end of a pipe that is not closed.
[out] | buffer | Where data will be put in. |
[in] | length | The number of bytes that you want to read. length should not be larger than max long. |
'length' | Read 'length' bytes successfully |
>=0 | Reach EOF, return the number of bytes actually read. It is between 0 and length-1. |
-1 | Error. |
Implements Basic_istream.
bool Stdin_istream::skip | ( | my_off_t | bytes | ) |
Skip bytes data from the stdin stream.
[in] | bytes | How many bytes should be skipped |
|
private |