Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::LineBuffer Class Reference

Special std::streambuf class for capturing lines. More...

#include <LineBuffer.h>

Inheritance diagram for sf::LineBuffer:
Collaboration diagram for sf::LineBuffer:

Public Types

typedef TClosure< void, LineBuffer *, const std::string & > event_t
 Closure Event type.
 

Public Member Functions

 LineBuffer (unsigned max_lines)
 Constructor settings the maximum lines the buffer can hold.
 
 ~LineBuffer () override
 Overridden virtual destructor.
 
std::string getLine (unsigned line) const
 Returns requested line in the buffer.
 
int lineCount () const
 
int totalLineCount () const
 Returns the total lines passed through the fifo buffer.
 
void clear ()
 
void setMaxLines (unsigned max_lines)
 Sets the maximum lines the stream can hold. Flushes all lines first.
 
void setNewLineHandler (const event_t &event)
 When a new line is added this event is triggered.
 
const event_tnewLineHandler ()
 Returns the new line handler.
 

Detailed Description

Special std::streambuf class for capturing lines.

Member Typedef Documentation

◆ event_t

typedef TClosure<void, LineBuffer* , const std::string& > sf::LineBuffer::event_t

Closure Event type.

Constructor & Destructor Documentation

◆ LineBuffer()

sf::LineBuffer::LineBuffer ( unsigned  max_lines)
explicit

Constructor settings the maximum lines the buffer can hold.

◆ ~LineBuffer()

sf::LineBuffer::~LineBuffer ( )
override

Overridden virtual destructor.

Member Function Documentation

◆ clear()

void sf::LineBuffer::clear ( )

Clears the current line buffer.

◆ getLine()

std::string sf::LineBuffer::getLine ( unsigned  line) const

Returns requested line in the buffer.

◆ lineCount()

int sf::LineBuffer::lineCount ( ) const

Returns the amount of lines in the buffer.

◆ newLineHandler()

const event_t & sf::LineBuffer::newLineHandler ( )

Returns the new line handler.

Returns
the Handler.

◆ setMaxLines()

void sf::LineBuffer::setMaxLines ( unsigned  max_lines)

Sets the maximum lines the stream can hold. Flushes all lines first.

◆ setNewLineHandler()

void sf::LineBuffer::setNewLineHandler ( const event_t event)

When a new line is added this event is triggered.

◆ totalLineCount()

int sf::LineBuffer::totalLineCount ( ) const
inline

Returns the total lines passed through the fifo buffer.


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