23#ifndef BASIC_OSTREAM_INCLUDED
24#define BASIC_OSTREAM_INCLUDED
137 bool flush()
override;
147 bool sync()
override;
158template <
int BUFFER_SIZE>
The abstract class for basic output streams which provides write operation.
Definition: basic_ostream.h:36
virtual ~Basic_ostream()=default
virtual bool write(const unsigned char *buffer, my_off_t length)=0
Write some bytes into the output stream.
Definition: basic_ostream.h:172
Managed_buffer_sequence_t & m_managed_buffer_sequence
Definition: basic_ostream.h:179
Compressor_ptr_t m_compressor
Definition: basic_ostream.h:178
Compressed_ostream(const Compressed_ostream &)=delete
Compressed_ostream(Compressor_ptr_t compressor, Managed_buffer_sequence_t &managed_buffer_sequence)
Definition: basic_ostream.h:183
Status_t m_status
Definition: basic_ostream.h:180
Compressed_ostream()=delete
std::shared_ptr< Compressor_t > Compressor_ptr_t
Definition: basic_ostream.h:175
bool write(const unsigned char *buffer, my_off_t length) override
Compress the given bytes into the buffer sequence.
Definition: basic_ostream.cc:91
Status_t get_status() const
Definition: basic_ostream.cc:98
Compressed_ostream & operator=(const Compressed_ostream &)=delete
~Compressed_ostream() override=default
An output stream based on IO_CACHE class.
Definition: basic_ostream.h:97
IO_CACHE m_io_cache
Definition: basic_ostream.h:150
bool close()
Closes the stream.
Definition: basic_ostream.cc:51
bool flush() override
Flush data to IO_CACHE's file if there is any data in IO_CACHE's buffer.
Definition: basic_ostream.cc:81
~IO_CACHE_ostream() override
Definition: basic_ostream.cc:31
IO_CACHE_ostream(const IO_CACHE_ostream &)=delete
bool truncate(my_off_t offset) override
Truncate some data at the end of the output stream.
Definition: basic_ostream.cc:71
bool seek(my_off_t offset) override
Put the write position to a given offset.
Definition: basic_ostream.cc:60
bool open(PSI_file_key log_file_key, const char *file_name, myf flags)
Open the output stream.
Definition: basic_ostream.cc:33
bool write(const unsigned char *buffer, my_off_t length) override
Write some bytes into the output stream.
Definition: basic_ostream.cc:65
bool sync() override
Syncs the file to disk.
Definition: basic_ostream.cc:86
IO_CACHE_ostream & operator=(const IO_CACHE_ostream &)=delete
A basic output stream based on StringBuffer class.
Definition: basic_ostream.h:160
StringBuffer_ostream(const StringBuffer_ostream &)=delete
bool write(const unsigned char *buffer, my_off_t length) override
Write some bytes into the output stream.
Definition: basic_ostream.h:166
StringBuffer_ostream()=default
StringBuffer_ostream & operator=(const StringBuffer_ostream &)=delete
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:658
bool append(const String &s)
Definition: sql_string.cc:418
size_t length() const
Definition: sql_string.h:240
Truncatable_ostream abstract class provides seek() and truncate() interfaces to all truncatable outpu...
Definition: basic_ostream.h:57
virtual bool flush()=0
Flush data.
virtual bool seek(my_off_t offset)=0
Put the write position to a given offset.
~Truncatable_ostream() override=default
virtual bool sync()=0
Sync.
virtual bool truncate(my_off_t offset)=0
Truncate some data at the end of the output stream.
Abstract base class for compressors.
Definition: compressor.h:78
mysqlns::buffer::Managed_buffer_sequence<> Managed_buffer_sequence_t
Definition: compressor.h:80
Owned, non-contiguous, growable memory buffer.
Definition: managed_buffer_sequence.h:113
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:47
static int flags[50]
Definition: hp_test1.cc:39
Functions for reading and storing in machine-independent format.
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:93
ulonglong my_off_t
Definition: my_inttypes.h:71
#define HAVE_PSI_INTERFACE
Definition: my_psi_config.h:38
Common header for many mysys elements.
mysqlns::buffer::Grow_status Compress_status
Definition: compressor.h:37
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:93
Grow_status
Error statuses for classes that use Grow_calculator.
Definition: grow_status.h:36
@ success
A grow operation succeeded.
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:419
Definition: varlen_sort.h:183
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:46
Our own string classes, used pervasively throughout the executor.