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

Chops a buffer up in to smaller pieces. More...

#include <BufferChopper.h>

Public Member Functions

 BufferChopper (size_t chopSize=1024)
 Constructor passing the chop size.
 
void assign (char *data, size_t sz)
 Assigns the buffer to be chopped.
 
char * getChunkData ()
 Gets the pointer to the next chop of data. Each call moves the internal pointer up until no more data is available.
 
size_t getChunkSize () const
 Gets the size of the chop pointed at by getChunkData().
 
bool moveNext ()
 Moves to the next chuck when available.
 
bool isDone () const
 Get the status on the chopping being done or not.
 

Detailed Description

Chops a buffer up in to smaller pieces.

Constructor & Destructor Documentation

◆ BufferChopper()

sf::BufferChopper::BufferChopper ( size_t  chopSize = 1024)
explicit

Constructor passing the chop size.

Parameters
chopSizeChop size.

Member Function Documentation

◆ assign()

void sf::BufferChopper::assign ( char *  data,
size_t  sz 
)

Assigns the buffer to be chopped.

Parameters
dataPointer to the data.
szSize of the data pointed at.

◆ getChunkData()

char * sf::BufferChopper::getChunkData ( )

Gets the pointer to the next chop of data. Each call moves the internal pointer up until no more data is available.

Returns
Pointer to the chop.

◆ getChunkSize()

size_t sf::BufferChopper::getChunkSize ( ) const

Gets the size of the chop pointed at by getChunkData().

Returns
Size of the current data chop.

◆ isDone()

bool sf::BufferChopper::isDone ( ) const

Get the status on the chopping being done or not.

Returns
True when done.

◆ moveNext()

bool sf::BufferChopper::moveNext ( )

Moves to the next chuck when available.

Returns
True on success to do so.

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