📄 backup.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'backup.pas' rev: 5.00
#ifndef backupHPP
#define backupHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <FileCtrl.hpp> // Pascal unit
#include <StdCtrls.hpp> // Pascal unit
#include <Dialogs.hpp> // Pascal unit
#include <Forms.hpp> // Pascal unit
#include <Controls.hpp> // Pascal unit
#include <Graphics.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <Messages.hpp> // Pascal unit
#include <Windows.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Backup
{
//-- type declarations -------------------------------------------------------
typedef void * __fastcall (*TAlloc)(void * AppData, int Items, int Size);
typedef void __fastcall (*TFree)(void * AppData, void * Block);
#pragma pack(push, 1)
struct TZStreamRec
{
char *next_in;
int avail_in;
int total_in;
char *next_out;
int avail_out;
int total_out;
char *msg;
void *internal;
TAlloc zalloc;
TFree zfree;
void *AppData;
int data_type;
int adler;
int reserved;
} ;
#pragma pack(pop)
typedef Shortint TPercentage;
#pragma option push -b-
enum TBackupMode { bmAll, bmIncremental };
#pragma option pop
#pragma option push -b-
enum TRestoreMode { rmAll, rmNoOverwrite, rmNewer, rmExisting, rmExistingNewer };
#pragma option pop
#pragma option push -b-
enum TCompressionLevel { clFastest, clNone, clDefault, clMax };
#pragma option pop
typedef void __fastcall (__closure *TProgressEvent)(System::TObject* Sender, AnsiString Filename, TPercentage
Percent, bool &Continue);
typedef void __fastcall (__closure *TNeedDiskEvent)(System::TObject* Sender, Word DiskID, bool &Continue
);
typedef void __fastcall (__closure *TRestoreFileEvent)(System::TObject* Sender, AnsiString &Filename
, int FA, bool &DoRestore);
typedef void __fastcall (__closure *TFileRestoredEvent)(System::TObject* Sender, AnsiString &Filename
, Classes::TFileStream* &Stream);
typedef void __fastcall (__closure *TBackupErrorEvent)(System::TObject* Sender, const int Error, AnsiString
ErrString);
class DELPHICLASS TBackupFile;
class PASCALIMPLEMENTATION TBackupFile : public Classes::TComponent
{
typedef Classes::TComponent inherited;
private:
AnsiString FBackupTitle;
int fMaxSize;
TBackupMode fBackupMode;
TRestoreMode fRestoreMode;
TCompressionLevel fCompressionLevel;
bool fSetArchiveFlag;
int fFilesTotal;
int fFilesProcessed;
int fSizeTotal;
int fProgressSize;
int fCompressedTotal;
AnsiString CurrentFile;
bool IsBusy;
bool Continue;
int fLastErr;
Classes::TStream* fInputStream;
Classes::TStream* fOutputStream;
bool fRestoreFullPath;
bool fSaveFileID;
TProgressEvent fOnProgress;
TNeedDiskEvent fOnNeedDisk;
TRestoreFileEvent fOnRestoreFile;
TFileRestoredEvent fOnFileRestored;
TBackupErrorEvent fOnError;
AnsiString __fastcall GetVersion();
void __fastcall SetVersion(AnsiString dummy);
void __fastcall SetBackupMode(TBackupMode value);
void __fastcall DeCompress(Classes::TStream* InStream, Classes::TStream* OutStream, bool DoWrite);
void __fastcall MessageError(int err);
public:
__property int FilesTotal = {read=fFilesTotal, nodefault};
__property int SizeTotal = {read=fSizeTotal, nodefault};
__property int FilesProcessed = {read=fFilesProcessed, nodefault};
bool __fastcall BackupToStream(const Classes::TStrings* Filelist, Classes::TStream* Target);
bool __fastcall Backup(const Classes::TStrings* Filelist, AnsiString Target);
bool __fastcall RestoreFromStream(Classes::TStream* Source, AnsiString TargetPath);
bool __fastcall Restore(AnsiString Source, AnsiString TargetPath);
AnsiString __fastcall GetArchiveTitle(const AnsiString Source, Classes::TStringList* &Filelist);
AnsiString __fastcall GetArchiveTitleFromStream(Classes::TStream* Source, Classes::TStringList* &Filelist
);
int __fastcall CompressionRate(void);
bool __fastcall Busy(void);
void __fastcall Stop(void);
__published:
__property AnsiString Version = {read=GetVersion, write=SetVersion};
__property AnsiString BackupTitle = {read=FBackupTitle, write=FBackupTitle};
__property TBackupMode BackupMode = {read=fBackupMode, write=SetBackupMode, nodefault};
__property TCompressionLevel CompressionLevel = {read=fCompressionLevel, write=fCompressionLevel, nodefault
};
__property TRestoreMode RestoreMode = {read=fRestoreMode, write=fRestoreMode, nodefault};
__property int MaxSize = {read=fMaxSize, write=fMaxSize, nodefault};
__property bool SetArchiveFlag = {read=fSetArchiveFlag, write=fSetArchiveFlag, nodefault};
__property TProgressEvent OnProgress = {read=fOnProgress, write=fOnProgress};
__property TNeedDiskEvent OnNeedDisk = {read=fOnNeedDisk, write=fOnNeedDisk};
__property TRestoreFileEvent OnRestoreFile = {read=fOnRestoreFile, write=fOnRestoreFile};
__property TFileRestoredEvent OnFileRestored = {read=fOnFileRestored, write=fOnFileRestored};
__property TBackupErrorEvent OnError = {read=fOnError, write=fOnError};
__property bool RestoreFullPath = {read=fRestoreFullPath, write=fRestoreFullPath, nodefault};
__property bool SaveFileID = {read=fSaveFileID, write=fSaveFileID, nodefault};
public:
#pragma option push -w-inl
/* TComponent.Create */ inline __fastcall virtual TBackupFile(Classes::TComponent* AOwner) : Classes::TComponent(
AOwner) { }
#pragma option pop
#pragma option push -w-inl
/* TComponent.Destroy */ inline __fastcall virtual ~TBackupFile(void) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const Word BufferSize = 0x4000;
#define cVersion "5.10"
#define fSignature "EC2"
static const Shortint idCantreadFile = 0x1;
static const Shortint idCantwriteFile = 0x2;
static const Shortint idCantreadArchive = 0x3;
static const Shortint idCantwriteArchive = 0x4;
static const Shortint idInvalidfiletype = 0x5;
static const Shortint idCompression = 0x6;
static const Shortint idCantCreateFileID = 0x7;
#define zlib_Version "1.1.3"
extern PACKAGE void __fastcall Register(void);
} /* namespace Backup */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Backup;
#endif
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // backup
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -