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.

Chapter 9<br />

Lossless Compression<br />

Before we go into the details of the classes belonging to this module we want to give an<br />

overview of the different components and how they interact. We start with an example.<br />

Suppose you want to write a string to a compressed file named “foo” and read it back<br />

from the file. <strong>The</strong>n you can use the following program:<br />

#include <br />

#include // contains all compression classes<br />

using namespace leda;<br />

typedef HuffmanCoder Coder;<br />

int main()<br />

{<br />

string str = "Hello World";<br />

}<br />

encoding_ofstream out("foo");<br />

out

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

Saved successfully!

Ooh no, something went wrong!