LzoHeader

LzoHeader structure

Members

Enums

Type
enum Type

Header type enumerator

Functions

crc32
uint crc32(void[] payload)

Calculates the CRC32 value of the header elements after crc32.

data
void[] data()

Returns the header data of this instance.

data_without_length
void[] data_without_length()

Returns the header data of tihs instance without the leading chunk length value.

lengthValid
size_t lengthValid(void[] chunk)

Checks whether the chunk_length member is correct for the given chunk.

read
void[] read(void[] chunk)

Reads the header from chunk and sets the members of this instance to the values contained in the header.

readStart
typeof(&this) readStart(void[] chunk)

Reads chunk which is expected to be a Start chunk or a Null chunk.

setHeader
typeof(&this) setHeader(void[] chunk)

Sets the internal data members from the given chunk.

start
typeof(&this) start(size_t total_uncompressed_length)

Sets this instance to create a Start header. Since a Start chunk has no payload, the returned data are a full Start chunk.

stop
typeof(&this) stop()

Sets this instance to create a Stop header. Since a Stop chunk has no payload, the returned data are a full Start chunk.

tryRead
bool tryRead(void[] chunk)

Checks whather chunk is valid or not. If it is valid this object's data members are initialised with the chunk header info.

tryReadStart
bool tryReadStart(void[] chunk)

Checks whether chunk is a Start / Null chunk. This data members are set from the chunk provided.

tryReadStop
bool tryReadStop(void[] chunk)

Checks whether chunk is a Stop / Null chunk. This data members are set from the chunk provided.

uncompressed
typeof(&this) uncompressed(void[] payload)

Sets this instance to create a header for a chunk containing uncompressed data. Compression method is set to None.

write
void[] write(void[] chunk)

Writes the header to chunk[0 .. this.read_length].

Manifest constants

ErrMsgSource
enum ErrMsgSource;

Error message source constant

read_length
enum read_length;
Undocumented in source.
read_length
enum read_length;
Undocumented in source.

Static functions

isNullChunk
bool isNullChunk(void[] chunk)

Checks whether chunk is a Null chunk, that is, it has a Null header. A Null header is defined as

length
size_t length()

Total data length of the members of this structure. With "align (1)" as structure definition attribute "length" equals the "sizeof" value since the member data are then packed without padding. Because this structure represents the LZO chunk header data elements, "length" must equal "sizeof" in order to generate the correct LZO chunk header by serializing an instance of this structure. Hence "length == sizeof" is checked at ccompile-time in write().

strip
void[] strip(void[] chunk)

Strips the header from chunk

Variables

chunk_length
size_t chunk_length;

Length of the chunk excluding this length value

type
Type type;

Chunk type (Type enumerator is defined below)

uncompressed_length
size_t uncompressed_length;

Length of uncompressed data

Meta