/* ****************************************************************************

LZItem class - 22/01/2003
    by Thomas Maniero - last modified 22/01/2003

todo:

* decompress funziona solo se m_dcprsize è settato...

* in compress implemento il realloc?

**************************************************************************** */

#ifndef _LZITEM_H
#define _LZITEM_H


#include "types.h"


class LZArchive;


class LZItem {

    friend class LZArchive;

private:
    u8 *m_cprbuf;     // buffer contenente i dati compressi
    u32 m_cprsize;
    bool m_cprdel;    // cancello cprbuf?
    u8 *m_dcprbuf;    // buffer contenente i dati decompressi
    u32 m_dcprsize;
    bool m_dcprdel;   // cancello dcprbuf?

public:
    LZItem();
    ~LZItem();

    void cCreate(u8 *cprbuf, u32 cprsize, u32 dcprsize, bool todel);
    void dCreate(u8 *dcprbuf, u32 dcprsize, u32 cprsize, bool todel);
    void destroy();

    bool decompress();
    bool compress();

    u8 *cBuffer();
    u32 cSize();

    u8 *dBuffer();
    u32 dSize();
};



#endif

