SecureBlackbox 2020 C++ Edition

Questions / Feedback?

PrepareFile Event

Fires for every file to be compressed before the compression starts.

Syntax

ANSI (Cross Platform)
virtual int FirePrepareFile(ArchiveWriterPrepareFileEventParams *e);
typedef struct {
const char *Path;
int64 FileSize;
int DataSource;
char *LocalPath;
int Action; int reserved; } ArchiveWriterPrepareFileEventParams; Unicode (Windows) virtual INT FirePrepareFile(ArchiveWriterPrepareFileEventParams *e);
typedef struct {
LPCWSTR Path;
LONG64 FileSize;
INT DataSource;
LPWSTR LocalPath;
INT Action; INT reserved; } ArchiveWriterPrepareFileEventParams;
- (void)onPrepareFile:(NSString*)path :(long long)fileSize :(int*)dataSource :(NSString**)localPath :(int*)action;
#define EID_ARCHIVEWRITER_PREPAREFILE 6

virtual INT SECUREBLACKBOX_CALL FirePrepareFile(LPSTR &lpszPath, LONG64 &lFileSize, INT &iDataSource, LPSTR &lpszLocalPath, INT &iAction);

Remarks

Class fires this event for every file included in the Files collection before commencing the compression. This is the last opportunity for your code to adjust the action to be taken for each file and tune up the data sources appropriately.

The Path parameter contains the path to the file within the archive (such as Photos/myphoto.jpg), and the FileSize contains the size of that file before compression.

The DataSource parameter indicates the media from which the file contents is to be taken. A typical default value if fdsFile, but you can adjust the value of that parameter if you need to use an alternative source. The following options are available:

fdsFile (0)The data will be taken from a file indicated by the LocalPath parameter. You can change this path in this event handler.
fdsStream (1)The file data will be taken from a stream assigned to FileStream property.
fdsBuffer (2)The data will be taken from a buffer attached to the FileData property.

Please do not assign FileStream or FileData in this event handler: this should be done further down the road in the BeforeCompressFile event handler. The purpose of this event is to prepare the compression plan by summarizing what should be done and to which files.

The Action parameter, which is also tuneable, indicates the action for class to take on the file:

atAdd (0)Add the file to the archive
atKeep (1)Keep the existing file in the archive
atUpdate (2)Update the archived file with a fresher copy
atDelete (3)Delete the file from the archive
atExtract (4)Extract the file (extraction only)
atSkip (5)Skip file extraction (extraction only)

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 C++ Edition - Version 20.0 [Build 8166]