SecureBlackbox 2020 Qt Edition

Questions / Feedback?

PrepareFile Event

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

Syntax

class ArchiveWriterPrepareFileEventParams {
public:
  const QString &Path();
  qint64 FileSize();
  int DataSource();
  void SetDataSource(int iDataSource);
  const QString &LocalPath();
  void SetLocalPath(const QString &qsLocalPath);
  int Action();
  void SetAction(int iAction);
  int EventRetVal();
  void SetEventRetVal(int iRetVal);
};
// To handle, connect one or more slots to this signal. void PrepareFile(ArchiveWriterPrepareFileEventParams *e);
// Or, subclass ArchiveWriter and override this emitter function. virtual int FirePrepareFile(ArchiveWriterPrepareFileEventParams *e) {...}

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 Qt Edition - Version 20.0 [Build 8154]