Artifact Content

Not logged in

Artifact f42371bc1f59bea62bd0d763c45d221766da561a


     1  #ifndef AFX_ARCB2e_H__697CC1BD_2C28_434C_8C53_239D624227C3__INCLUDED_
     2  #define AFX_ARCB2e_H__697CC1BD_2C28_434C_8C53_239D624227C3__INCLUDED_
     3  
     4  #include "Archiver.h"
     5  
     6  class CArcB2e : public CArchiver
     7  {
     8  public: //--<action>--
     9  
    10  	CArcB2e( const char* scriptname );
    11  	virtual ~CArcB2e();
    12  	static const char* init_b2e_path();
    13  
    14  private: //--<CArchiver>--
    15  
    16  	int  v_load();
    17  	bool v_ver( kiStr& str );
    18  	bool v_check( const kiPath& aname );
    19  	int  v_contents( const kiPath& aname, kiPath& dname );
    20  	int  v_melt( const arcname& aname, const kiPath& ddir, const aflArray* files );
    21  	bool v_list( const arcname& aname, aflArray& files );
    22  	int  v_compress( const kiPath& base, const wfdArray& files, const kiPath& ddir, int method, bool sfx );
    23  	kiStr v_name(const char*) const { return exe ? exe->name() : kiStr(""); }
    24  
    25  	bool arc2sfx( const kiPath& temp, const kiPath& dest );
    26  	int  cmpr( const char* scr, const kiPath& base, const wfdArray& files, const kiPath& ddir, const int method );
    27  
    28  private: //--<RythpScript>--
    29  
    30  	// scripts
    31  	char*       m_ScriptBuf;
    32  	char*       m_LoadScr;
    33  	const char* m_EncScr;
    34  	const char* m_DecScr;
    35  	const char* m_SfxScr;
    36  	const char* m_DcEScr;
    37  	const char* m_LstScr;
    38  	bool        m_SfxDirect;
    39  
    40  	enum scr_mode { mLod, mEnc, mDec, mDc1, mSfx, mLst };
    41  	int exec_script( const char* scr, scr_mode mode );
    42  
    43  	// B2e Core
    44  	class CB2eCore : public kiRythpVM
    45  	{
    46  		friend class CArcB2e;
    47  
    48  		bool exec_function( const kiVar& name, const CharArray& a, const BoolArray& b,int c, kiVar* r );
    49  
    50  		void arc( const char* opt, const CharArray& a, const BoolArray& b,int c, kiVar* r );
    51  		void list( const char* opt, const CharArray& a, const BoolArray& b,int c, kiVar* r );
    52  		void resp( bool needq, const char* opt, const CharArray& a, const BoolArray& b,int c, kiVar* r );
    53  		void input( const char* msg, const char* defval, kiVar* r );
    54  
    55  		void setPtr( CArcB2e* p, scr_mode m ){x=p;m_mode=m;}
    56  		CArcB2e* x;
    57  		scr_mode m_mode;
    58  		kiVar t;
    59  	};
    60  	friend class CB2eCore;
    61  	static char st_base[MAX_PATH];
    62  	static int  st_life;
    63  	static CB2eCore* rvm;
    64  
    65  	// module
    66  	CArcModule* exe;
    67  	kiArray<kiStr> m_subFile;
    68  
    69  	// script˜AŒg
    70  	bool load_module( const char* name );
    71  	int m_Result;
    72  	bool m_usMode;
    73  	const arcname*  m_psArc;
    74  	const kiPath*   m_psDir;
    75  	const int*      m_psMhd;
    76  	const wfdArray* m_psList;
    77  	const aflArray* m_psAInfo;
    78  };
    79  
    80  #endif