MySQL 8.4.2
Source Code Documentation
File_IO Class Reference

FILE_IO : Wrapper around std::fstream 1> Provides READ/WRITE handle to a file 2> Records error on READ/WRITE operations 3> Closes file before destruction. More...

Public Member Functions

 File_IO (const File_IO &src)
 
File_IOoperator= (const File_IO &src)
 
 ~File_IO ()
 
void close ()
 
const Sql_string_tfile_name () const
 
bool read_mode () const
 
bool get_error () const
 
void set_error ()
 
void reset_error ()
 
File_IOoperator>> (Sql_string_t &s)
 Read an open file. More...
 
File_IOoperator<< (const Sql_string_t &output_string)
 Write into an open file. More...
 

Protected Member Functions

 File_IO ()=default
 
 File_IO (const Sql_string_t filename, bool read)
 
 File_IO (const Sql_string_t filename, MY_MODE mode)
 A constructor to create the class with the right umask mode. More...
 
void file_open ()
 
bool file_is_open ()
 

Private Attributes

Sql_string_t m_file_name
 
bool m_read
 
bool m_error_state
 
File m_file
 

Friends

class File_creator
 

Detailed Description

FILE_IO : Wrapper around std::fstream 1> Provides READ/WRITE handle to a file 2> Records error on READ/WRITE operations 3> Closes file before destruction.

Constructor & Destructor Documentation

◆ File_IO() [1/4]

File_IO::File_IO ( const File_IO src)
inline

◆ ~File_IO()

File_IO::~File_IO ( )
inline

◆ File_IO() [2/4]

File_IO::File_IO ( )
protecteddefault

◆ File_IO() [3/4]

File_IO::File_IO ( const Sql_string_t  filename,
bool  read 
)
inlineprotected

◆ File_IO() [4/4]

File_IO::File_IO ( const Sql_string_t  filename,
MY_MODE  mode 
)
inlineprotected

A constructor to create the class with the right umask mode.

Parameters
filenamename of the file
modethe create attributes to pass to my_create()

Member Function Documentation

◆ close()

void File_IO::close ( )
inline

◆ file_is_open()

bool File_IO::file_is_open ( )
inlineprotected

◆ file_name()

const Sql_string_t & File_IO::file_name ( ) const
inline

◆ file_open()

void File_IO::file_open ( )
inlineprotected

◆ get_error()

bool File_IO::get_error ( ) const
inline

◆ operator<<()

File_IO & File_IO::operator<< ( const Sql_string_t output_string)

Write into an open file.

Parameters
[in]output_stringContent to be written

Assumption : string must be non-empty.

Returns
File_IO reference. Optionally sets error.

◆ operator=()

File_IO & File_IO::operator= ( const File_IO src)
inline

◆ operator>>()

File_IO & File_IO::operator>> ( Sql_string_t s)

Read an open file.

Parameters
[out]sString buffer

Assumption : Caller will free string buffer

Returns
File_IO reference. Optionally sets error.

◆ read_mode()

bool File_IO::read_mode ( ) const
inline

◆ reset_error()

void File_IO::reset_error ( )
inline

◆ set_error()

void File_IO::set_error ( )
inline

Friends And Related Function Documentation

◆ File_creator

friend class File_creator
friend

Member Data Documentation

◆ m_error_state

bool File_IO::m_error_state
private

◆ m_file

File File_IO::m_file
private

◆ m_file_name

Sql_string_t File_IO::m_file_name
private

◆ m_read

bool File_IO::m_read
private

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