An output stream based on IO_CACHE class.
More...
#include <basic_ostream.h>
An output stream based on IO_CACHE class.
◆ IO_CACHE_ostream() [1/2]
IO_CACHE_ostream::IO_CACHE_ostream |
( |
| ) |
|
|
default |
◆ IO_CACHE_ostream() [2/2]
◆ ~IO_CACHE_ostream()
IO_CACHE_ostream::~IO_CACHE_ostream |
( |
| ) |
|
|
override |
◆ close()
bool IO_CACHE_ostream::close |
( |
| ) |
|
Closes the stream.
It deinitializes IO_CACHE and close the file it opened.
- Return values
-
◆ flush()
bool IO_CACHE_ostream::flush |
( |
| ) |
|
|
overridevirtual |
Flush data to IO_CACHE's file if there is any data in IO_CACHE's buffer.
- Return values
-
Implements Truncatable_ostream.
◆ open()
bool IO_CACHE_ostream::open |
( |
PSI_file_key |
log_file_key, |
|
|
const char * |
file_name, |
|
|
myf |
flags |
|
) |
| |
Open the output stream.
It opens related file and initialize IO_CACHE.
- Parameters
-
[in] | log_file_key | The PSI_file_key for this stream |
[in] | file_name | The file will be opened |
[in] | flags | The flags used by IO_CACHE. |
- Return values
-
◆ operator=()
◆ seek()
bool IO_CACHE_ostream::seek |
( |
my_off_t |
offset | ) |
|
|
overridevirtual |
Put the write position to a given offset.
The offset counts from the beginning of the file.
- Parameters
-
[in] | offset | Where the write position will be |
- Return values
-
Implements Truncatable_ostream.
◆ sync()
bool IO_CACHE_ostream::sync |
( |
| ) |
|
|
overridevirtual |
Syncs the file to disk.
It doesn't check and flush any remaining data still left in IO_CACHE's buffer. So a call to flush() is necessary in order to persist all data including the data in buffer.
- Return values
-
Implements Truncatable_ostream.
◆ truncate()
bool IO_CACHE_ostream::truncate |
( |
my_off_t |
offset | ) |
|
|
overridevirtual |
Truncate some data at the end of the output stream.
- Parameters
-
[in] | offset | Where the output stream will be truncated to. |
- Return values
-
Implements Truncatable_ostream.
◆ write()
bool IO_CACHE_ostream::write |
( |
const unsigned char * |
buffer, |
|
|
my_off_t |
length |
|
) |
| |
|
overridevirtual |
Write some bytes into the output stream.
When all data is written into the stream successfully, then it return false. Otherwise, true is returned. It will never returns false when partial data is written into the stream.
- Parameters
-
[in] | buffer | Data to be written |
[in] | length | Length of the data |
- Return values
-
Implements Basic_ostream.
◆ m_io_cache
The documentation for this class was generated from the following files: