MySQL 8.0.40
Source Code Documentation
Line_buffer< TCallback > Class Template Reference

Buffers input and runs a specified callback on single complete lines found. More...

Public Member Functions

 Line_buffer (TCallback &&line_handler)
 
 ~Line_buffer ()
 Runs callback for last incomplete line if present. More...
 
void insert (const char *buffer, size_t size)
 Adds a raw buffer bytes to our buffer and finds any new completed lines to call callback on them. More...
 

Private Attributes

TCallback m_line_handler
 
std::string m_curr_buffer
 Current incomplete line. More...
 

Detailed Description

template<class TCallback>
class Line_buffer< TCallback >

Buffers input and runs a specified callback on single complete lines found.

Constructor & Destructor Documentation

◆ Line_buffer()

template<class TCallback >
Line_buffer< TCallback >::Line_buffer ( TCallback &&  line_handler)
inline

◆ ~Line_buffer()

template<class TCallback >
Line_buffer< TCallback >::~Line_buffer

Runs callback for last incomplete line if present.

Member Function Documentation

◆ insert()

template<class TCallback >
void Line_buffer< TCallback >::insert ( const char *  buffer,
size_t  size 
)

Adds a raw buffer bytes to our buffer and finds any new completed lines to call callback on them.

Member Data Documentation

◆ m_curr_buffer

template<class TCallback >
std::string Line_buffer< TCallback >::m_curr_buffer
private

Current incomplete line.

◆ m_line_handler

template<class TCallback >
TCallback Line_buffer< TCallback >::m_line_handler
private

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