31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Operations<br />

Standard Operations<br />

void C.encode( ) encodes the source stream and writes the output to<br />

the target stream.<br />

void C.decode( ) decodes the source stream and writes the output to<br />

the target stream.<br />

uint32<br />

C.calculate length of encoded data(uint32 input length)<br />

calculates the length (in bytes) of the output when<br />

encoding some input of the given length with the current<br />

settings. (This function is helpful for encoding<br />

memory chunks (see below).)<br />

uint32 C.encode memory chunk(const char ∗ in buf , uint32 in len, char ∗ out buf ,<br />

uint32 out len)<br />

encodes the memory chunk starting at in buf with<br />

size in len into the buffer starting at out buf with size<br />

out len. <strong>The</strong> function returns actual length of the<br />

encoded chunk which may be smaller than out len. If<br />

the output buffer is too small for the encoded data<br />

the failure flag will be set (see below). Note: <strong>The</strong><br />

output data is slightly longer than the input data due<br />

to padding and header data.<br />

uint32 C.decode memory chunk(const char ∗ in buf , uint32 in len, char ∗ out buf ,<br />

uint32 out len)<br />

decodes a memory chunk. <strong>The</strong> meaning of the parameters<br />

and the return value is the same as in the<br />

previous function.<br />

streambuf ∗ C.get src stream( ) returns the current source stream.<br />

void<br />

C.set src stream(streambuf ∗ src stream, bool own stream = false)<br />

sets the source stream (cf. constructor).<br />

void C.set src file(const char ∗ file name)<br />

sets a file as source stream.<br />

streambuf ∗ C.get tgt stream( ) returns the current target stream.<br />

void<br />

void<br />

C.set tgt stream(streambuf ∗ tgt stream, bool own Stream = false)<br />

sets the target stream (cf. constructor).<br />

C.set tgt file(const char ∗ file name)<br />

sets a file as target stream.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!