⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zipbuilder.h

📁 zip算法的源码
💻 H
📖 第 1 页 / 共 4 页
字号:
class PACKAGE EZipAbort : public EZipBuilder
{
  public:
     __fastcall EZipAbort(void);
};

#ifndef NO_STREAM
class PACKAGE TZipStream : public TMemoryStream
{
	friend class TZipBuilder;

	protected:
		inline __fastcall virtual ~TZipStream( void ) { }
		inline __fastcall virtual TZipStream( void ) {
			Clear();
		}
	public:
		void __fastcall virtual SetPointer( void *Ptr, int Size );
};
#endif
//new V1.70
class TMZipDataList : public TList
{
	private:
		MDZipData* GetItems(int Index);
	public:
		__fastcall TMZipDataList(int TotalEntries);
		__fastcall ~TMZipDataList(void);
		__property MDZipData* Items[int Index] =  {read=GetItems};
		int IndexOf(const String& fname);
};
#pragma option -a.


//------------------------------------------------------------------------

#if __BORLANDC__ < 1344
#pragma option -a4
#else
#pragma option -a8
#endif
class PACKAGE TZipBuilder : public Classes::TComponent {
	friend class TSHFormatThread;
  friend class TZipLib;  // allow ZipLib to call protected functions
#ifdef INTERNAL_SFX
  friend class TInternalSFX;
#endif
	private:
	// fields of published properties
		int							  FAddCompLevel;
		AddOpts						FAddOptions;
    SpanOpts          FSpanOptions;
		AddStoreExts			FAddStoreSuffixes;
    AnsiString        FExtAddStoreSuffixes;
	// private versions of property variables
		bool							FCancel;
		int								FDirOnlyCount;
		int   						FErrCode;
		int								FFullErrCode;
    String            FEventErr;
		HWND							FHandle;
    bool							FIsSpanned;
    bool              FMVolume;
    String 						FMessage;
		bool							FVerbose;
		bool							FTrace;
		Classes::TList		*FZipContents;
		String						FExtrBaseDir;
    bool              FBusy;
    bool					fIsDestroying;		// new 1.73
		bool  						FZipBusy;
		bool							FUnzBusy;
		ExtrOpts					FExtrOptions;
		Classes::TStrings	*FFSpecArgs;
		String						FZipFileName;
		int  							FSuccessCnt;
		String						FPassword;
		bool							FEncrypt;
		int								FSFXOffset;
		String						FDLLDirectory;
		bool							FUnattended;
    bool              AutoExeViaAdd;
		String						FVolumeName;
		__int64						FSizeOfDisk;
		__int64						FDiskFree;
    __int64           FFreeOnDisk;
    __int64           FFreeOnAllDisks;
		String						FDrive;
    bool              FDriveFixed;
		DeleteOpts				FHowToDelete;
		unsigned long			FTotalSizeToProcess;
    unsigned          FTotalPosition;       // new 1.73
    unsigned          FItemSizeToProcess;   // new 1.73
    unsigned          FItemPosition;        // new 1.73
    String            FItemName;            // new 1.73
		int								FDiskNr;
		unsigned short		FTotalDisks;
		long							FFileSize;
		long							FRealFileSize;
		bool							FWrongZipStruct;
		String						FInFileName;
		int								FInFileHandle;
		int								FOutFileHandle;
		unsigned char			FHostNum;
		unsigned char			FHostVer;
		int								FDateStamp;
		String						FTempDir;
		bool							FShowProgress;
#if __BORLANDC__ > 1328		// BCB3=0x0530(1328)
		__int64						FFreeOnDisk1;
		__int64						FMaxVolumeSize;
#else
    long						FFreeOnDisk1;
		long						FMaxVolumeSize;
#endif
		long							FMinFreeVolSize;
		CPOpts						FCodePage;
		unsigned long			FZipSOC;
		unsigned long			FZipEOC;
		String						FZipComment;
		String						FVersionInfo;
		unsigned int			FPasswordReqCount;
		bool							GAssignPassword;
		TModalResult			GModalResult;
		Classes::TStrings	*FFSpecArgsExcl;
		bool							FUseDirOnlyEntries;
		String						FRootDir;
		int								FCurWaitCount;
		TCursor						FSaveCursor;
    String      FStoredExtraData;   // 1.73
    String FEOCComment; // new 1.73
		// Dll related variables
    TZipDll	*fZipDll;					// new 1.73
		TUnzDll *fUnzDll;					// new 1.73

		ZipDLL::ZipParms	  	*ZipParms;
		UnzipDLL::UnZipParms 	*UnZipParms;
#ifdef INTERNAL_SFX
    // internal sfx class
    TInternalSFX* FIntSFX;
#endif
		// event variables
		Classes::TNotifyEvent		FOnDirUpdate;
		TProgressEvent					FOnProgress;
		TMsgEvent								FOnMessage;
		TSetNewNameEvent				FOnSetNewName;
		TNewNameEvent						FOnNewName;
		TPasswordErrorEvent			FOnPasswordError;
		TCRC32ErrorEvent				FOnCRC32Error;
		TExtractOverwriteEvent	FOnExtractOverwrite;
		TExtractSkippedEvent		FOnExtractSkipped;
		TCopyZipOverwriteEvent	FOnCopyZipOverwrite;
		TFileCommentEvent				FOnFileComment;
    TTickerEvent            FOnTicker;
    TAfterCallBackEvent     FOnAfterCallBack;
    TFileExtraEvent         FOnFileExtra;
    TTotalProgressEvent     FOnTotalProgress; // new 1.73
    TItemProgressEvent      FOnItemProgress;  // new 1.73
    TZipStrEvent            FOnZipStr;  // new 1.73
    TDateTime 			  	    FFromDate;
    int             FBufSize;
#ifndef NO_SPAN
		bool						FConfirmErase;
		int							FDiskWritten;
		int							FDriveNr;
		bool						FNewDisk;
		TGetNextDiskEvent			FOnGetNextDisk;
		TStatusDiskEvent			FOnStatusDisk;
		String					FOutFileName;
		TZipDiskStatus	FZipDiskStatus;
		TZipDiskAction	FZipDiskAction;
#endif
#ifndef NO_SFX
		String					FSFXCaption;				// dflt = "Self-extracting Archive"
		String						FSFXCommandLine;	// dflt = ""
		String						FSFXDefaultDir;		// dflt = ""
		TIcon						  *FSFXIcon;
		String						FSFXMessage;
		SfxOpts						FSFXOptions;
		OvrOpts						FSFXOverWriteMode;	// OvrConfirm  (others: OvrAlways, OvrNever)
		String						FSFXPath;
#endif
#ifndef NO_STREAM
    class TZipStream	*FZipStream;
#endif
		//Property get/set functions
    AnsiString __fastcall  Getmessage(void);		// new 1.73
		int    __fastcall GetCount( void );
		void   __fastcall SetFSpecArgs( Classes::TStrings *Value );
		void   __fastcall SetFileName( String Value );
		int    __fastcall GetZipVers( void );
		int    __fastcall GetUnzVers( void );
		void   __fastcall SetDLLDirectory( String Value );
		void	 __fastcall SetVersionInfo( String Value );
		String __fastcall GetZipComment( void );
		void	 __fastcall SetZipComment( String Value );
		void   __fastcall SetPasswordReqCount( unsigned int Value );
		void   __fastcall SetFSpecArgsExcl( Classes::TStrings *Value );
    void __fastcall SetExtAddStoreSuffixes (String Value);
			// Private "helper" functions
    bool __fastcall IsFixedDrive(void);
		ZipDirEntry* __fastcall GetDirEntry(int idx);
    void __fastcall FreeZipDirEntryRecords( void );
    void __fastcall SetZipSwitches( String &NameOfZipFile );
//    void __fastcall SetZipSwitches( String &NameOfZipFile, int zpVersion );
    void __fastcall SetUnZipSwitches( String &NameOfZipFile );
//		void __fastcall SetUnZipSwitches( String &NameOfZipFile, int UzpVersion );
    String __fastcall ConvertOEM(const String Source, CodePageDirection Direction); // new 1.73
    bool __fastcall GetDriveProps(void); // new 1.73
    bool   __fastcall OpenEOC( struct ZipEndOfCentral &EOC, bool DoExcept );
//    int    __fastcall CopyBuffer( int &InFile, int &OutFile, int ReadLen );   1.73 made protected
		void   __fastcall WriteJoin( void *Buffer, int BufSize, int DSErrIdent );
    void   __fastcall ReadJoin( void *Buffer, int BufSize, int DSErrIdent); // new 1.73
    void   __fastcall GetNewDisk( int DiskSeq );
    String __fastcall ZipStr(int id); // new 1.73
    void   __fastcall DiskFreeAndSize( int Action );
		void   __fastcall AddSuffix( const AddStoreSuffix SufOption, String &sStr, int sPos );
    void   __fastcall ExtExtract( int UseStream, TMemoryStream *MemStream );
		void   __fastcall ExtAdd( int UseStream, DWORD StrFileDate, DWORD StrFileAttr, TMemoryStream *MemStream );
    void   __fastcall StartWaitCursor(void);
		void   __fastcall StopWaitCursor(void);
    void  TraceMessage(String Msg); // new 1.70
    void __fastcall SetCancel(bool Value);
		void   __fastcall ShowExceptionError( const EZipBuilder &ZBExcept );
//		void   __fastcall ConvertOem2Iso( char *Source, CodePageDirection Direction );
//		bool   __fastcall IsDiskPresent( void );
//		String __fastcall ReplaceForwardSlash( char *aStr );
		void   __fastcall SetRootDir(String Value);
    bool   __fastcall FileExists(const AnsiString Name);
    void   __fastcall RemoveDriveSpec(AnsiString& FullPathName);
    bool __fastcall HasExtendedChars(const AnsiString FileName);  //new 1.73
    void __fastcall Setup_extend(void);
#ifndef NO_SPAN
    int __fastcall GetLastVolume(String FInFileName,ZipEndOfCentral &EOC, bool AllowNotExists);
    void __fastcall CreateMVFileName(String& FileName,bool StripPartNbr);
		void __fastcall CheckForDisk(bool Writing);
		void __fastcall ClearFloppy(String dir);
    bool   __fastcall IsRightDisk(void);
		void   __fastcall RWSplitData( char *Buffer, int ReadLen, int DSErrIdent );
		void   __fastcall RWJoinData( char *Buffer, int ReadLen, int DSErrIdent );
		void   __fastcall WriteSplit( const void *Buffer, int Len, int MinSize );
		int  __fastcall ZipFormat( void );
    AnsiString __fastcall NameOfPart(AnsiString fn, bool compat); // new 1.73
#endif
#ifndef NO_SFX
    void   __fastcall SetSFXIcon( TIcon *aIcon );
    int    __fastcall ConvertSFX( bool AutoExeViaAdd );
#endif
  protected:
    int __fastcall CallBack(int ActionCode, int ErrorCode, String Msg, unsigned FileSize); // 1.73 RP changed

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -