MySQL 9.1.0
Source Code Documentation
Gcs_file_sink Class Reference

#include <gcs_logging_system.h>

Inheritance diagram for Gcs_file_sink:
[legend]

Public Member Functions

 Gcs_file_sink (const std::string &file_name, const std::string &dir_name)
 
 ~Gcs_file_sink () override=default
 
enum_gcs_error initialize () override
 File sink initialization method. More...
 
enum_gcs_error finalize () override
 File sink finalization method. More...
 
void log_event (const std::string &message) override
 Print the received message to a log file. More...
 
void log_event (const char *message, size_t message_size) override
 Print the received message to a log file. More...
 
const std::string get_information () const override
 The purpose of this method is to return information on the sink such as its location. More...
 
enum_gcs_error get_file_name (char *file_name_buffer) const
 Return the full path of the file that shall be created. More...
 
- Public Member Functions inherited from Sink_interface
 ~Sink_interface () override=default
 Define a virtual destructor as instances of this interface can be polymorphically used. More...
 
- Public Member Functions inherited from Common_interface
virtual ~Common_interface ()=default
 Define a virtual destructor as instances of this interface can be polymorphically used. More...
 

Private Member Functions

 Gcs_file_sink (Gcs_file_sink &d)
 
Gcs_file_sinkoperator= (const Gcs_file_sink &d)
 

Private Attributes

File m_fd
 
std::string m_file_name
 
std::string m_dir_name
 
bool m_initialized
 

Constructor & Destructor Documentation

◆ Gcs_file_sink() [1/2]

Gcs_file_sink::Gcs_file_sink ( const std::string &  file_name,
const std::string &  dir_name 
)

◆ ~Gcs_file_sink()

Gcs_file_sink::~Gcs_file_sink ( )
overridedefault

◆ Gcs_file_sink() [2/2]

Gcs_file_sink::Gcs_file_sink ( Gcs_file_sink d)
private

Member Function Documentation

◆ finalize()

enum_gcs_error Gcs_file_sink::finalize ( )
overridevirtual

File sink finalization method.

Return values
GCS_OKin case everything goes well. Any other value of gcs_error in case of error.

Implements Common_interface.

◆ get_file_name()

enum_gcs_error Gcs_file_sink::get_file_name ( char *  file_name_buffer) const

Return the full path of the file that shall be created.

If the path is too long GCS_NOK is returned.

Parameters
[out]file_name_bufferBuffer that will contain the resulting path
Return values
GCS_OKin case everything goes well. Any other value of gcs_error in case of error

◆ get_information()

const std::string Gcs_file_sink::get_information ( ) const
overridevirtual

The purpose of this method is to return information on the sink such as its location.

Implements Sink_interface.

◆ initialize()

enum_gcs_error Gcs_file_sink::initialize ( )
overridevirtual

File sink initialization method.

Return values
GCS_OKin case everything goes well. Any other value of gcs_error in case of error.

Implements Common_interface.

◆ log_event() [1/2]

void Gcs_file_sink::log_event ( const char *  message,
size_t  message_size 
)
overridevirtual

Print the received message to a log file.

Parameters
messagerendered stream of the logging message
message_sizelogging message size

Implements Sink_interface.

◆ log_event() [2/2]

void Gcs_file_sink::log_event ( const std::string &  message)
overridevirtual

Print the received message to a log file.

Parameters
messagerendered stream of the logging message

Implements Sink_interface.

◆ operator=()

Gcs_file_sink & Gcs_file_sink::operator= ( const Gcs_file_sink d)
private

Member Data Documentation

◆ m_dir_name

std::string Gcs_file_sink::m_dir_name
private

◆ m_fd

File Gcs_file_sink::m_fd
private

◆ m_file_name

std::string Gcs_file_sink::m_file_name
private

◆ m_initialized

bool Gcs_file_sink::m_initialized
private

The documentation for this class was generated from the following files: