Artifact Content

Not logged in

Artifact 909c16b823b96e7bba2194ba83583ac1443b6791


     1  #ifndef AFX_ARCCPT_H__B5D13025_2DA9_4489_8BCB_ACB84B908A84__INCLUDED_
     2  #define AFX_ARCCPT_H__B5D13025_2DA9_4489_8BCB_ACB84B908A84__INCLUDED_
     3  
     4  #include "Archiver.h"
     5  #include "SubDlg.h"
     6  
     7  class CArcCpt : public CArchiver
     8  {
     9  public:
    10  	CArcCpt() : CArchiver("cpt.bin.") {}
    11  
    12  private:
    13  	int  v_load(){return aCheck|aMelt|aList|aMeltEach;}
    14  	bool v_check( const kiPath& aname );
    15  	int  v_contents( const kiPath& aname, kiPath& dname );
    16  	int  v_melt( const arcname& aname, const kiPath& ddir, const aflArray* files );
    17  	bool v_list( const arcname& aname, aflArray& files );
    18  	kiStr v_name(const char*) const { return "CPT"; }
    19  
    20  	CArcProgressDlg* pdlg;
    21  
    22  //-- cpt archive operations ----------------
    23  
    24  	unsigned int m_nMacBinOffset;
    25  	unsigned int m_nIndexPos;
    26  	unsigned int dataULen, dataCLen;
    27  
    28  	kiFile cpt,out;
    29  	unsigned char tmp[270]; // temp
    30  
    31  	bool read_main_hdr();
    32  	bool check_index_crc();
    33  	bool operation_for_each( bool o_list=true, aflArray* files=NULL );
    34  	bool recurse( bool o_list, aflArray* files, kiPath& path, int base, int num );
    35  	void cptmelt( bool isRL );
    36  
    37  //-- lzh - rle -------------------------------
    38  
    39  #define CIRCSIZE 8192
    40  	class sf_entry
    41  	{
    42  	public:
    43  		int Value;
    44  		int BitLength;
    45  	};
    46  	class node
    47  	{
    48  	public:
    49  		int flag, byte;
    50  		node *one, *zero;
    51  	};
    52  
    53  	void cpt_outch( unsigned char ch );
    54  	BYTE cpt_outstat,cpt_savechar;
    55  	void cpt_rle_lzh();
    56  	int cpt_get6bits();
    57  	int cpt_getbit();
    58  	void cpt_readHuff(int size,node* Hufftree);
    59  
    60  	int gethuffbyte(node* l_nodelist);
    61  #define SLACK 6
    62  	node cpt_Hufftree[512 + SLACK],cpt_LZlength[128 + SLACK],cpt_LZoffs[256 + SLACK];
    63  	unsigned char cpt_LZbuff[CIRCSIZE];
    64  	unsigned int cpt_LZptr;
    65  	unsigned long cpt_newbits;
    66  	int cpt_bitsavail;
    67  	int cpt_blocksize;
    68  };
    69  
    70  #endif