RTEMS Linker  0.0.1
RTEMS Tools Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rld::compress::compressor Class Reference

#include <rld-compression.h>

Public Member Functions

 compressor (files::image &image, size_t size, bool out=true, bool compress=true)
 
 ~compressor ()
 
void write (const void *data, size_t length)
 
void write (files::image &input, off_t offset, size_t length)
 
void flush ()
 
size_t read (void *data, size_t length)
 
size_t read (files::image &output_, off_t offset, size_t length)
 
size_t read (files::image &output_, size_t length)
 
size_t transferred () const
 
size_t compressed () const
 
off_t offset () const
 

Detailed Description

A compressor.

Constructor & Destructor Documentation

rld::compress::compressor::compressor ( files::image image,
size_t  size,
bool  out = true,
bool  compress = true 
)

Construct the compressor for the given image.

Parameters
imageThe image to read or write to.
sizeThe size of the input and output buffers.
outThe compressor is compressing.
compressSet to false to disable compression.
rld::compress::compressor::~compressor ( )

Destruct the compressor.

Member Function Documentation

size_t rld::compress::compressor::compressed ( ) const

The amount of compressed data transferred.

Returns
size_t The amount of compressed data tranferred.
void rld::compress::compressor::flush ( )

Flush the output buffer is data is present.

off_t rld::compress::compressor::offset ( ) const

The current offset in the stream.

Returns
off_t The current uncompressed offset.
size_t rld::compress::compressor::read ( void *  data,
size_t  length 
)

Read the compressed data into the input buffer and return the section requested.

Parameters
dataWrite the decompressed data here.
lengthThe mount of data in bytes to read.
Returns
size_t The amount of data read.
size_t rld::compress::compressor::read ( files::image output_,
off_t  offset,
size_t  length 
)

Read the decompressed data writing it to the image.

Parameters
output_The output image.
offsetThe output image offset to write from.
lengthThe mount of data in bytes to read.
Returns
size_t The amount of data read.
size_t rld::compress::compressor::read ( files::image output_,
size_t  length 
)

Read the decompressed data writing it to the image.

Parameters
output_The output image.
lengthThe mount of data in bytes to read.
Returns
size_t The amount of data read.
size_t rld::compress::compressor::transferred ( ) const

The amount of uncompressed data transferred.

Returns
size_t The amount of data tranferred.
void rld::compress::compressor::write ( const void *  data,
size_t  length 
)

Write the data to the output buffer and once the image buffer is full compress and write the compressed data to the image.

Parameters
dataThe data to write to the image compressed
lengthThe mount of data in bytes to write.
void rld::compress::compressor::write ( files::image input,
off_t  offset,
size_t  length 
)

Write the section of the input image file to the output buffer and once the image buffer is full compress and write the compressed data to the image.

Parameters
inputThe input image.
offsetThe input image offset to read from.
lengthThe mount of data in bytes to write.

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