Solid File System

Virtual file system enigne that can be embedded into your software.

OnProgress event/delegate/callback

Filter:

Pascal    Plain C    C++ (DLL/Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET    Java 

SolFSStorage     See also    

Overview

This event is fired when storage needs to be created.

Declaration

[Pascal]
    TSolFSProgressEvent = procedure( Sender : TObject; Operation : LongWord; Progress : LongWord; Total : LongWord; CanStop : Boolean; var Stop : Boolean) of object;

[Plain C]
    typedef Error (__stdcall *SolFSProgressFunc)( CallbackDataType UserData, unsigned long Operation, unsigned long Progress, unsigned long Total, bool CanStop, bool *Stop);

[C++ (DLL/Lib)]
    typedef Error (__stdcall *SolFSProgressFunc)( CallbackDataType UserData, unsigned long Operation, unsigned long Progress, unsigned long Total, bool CanStop, bool *Stop);

[C++ (VCL)]
    typedef void (__closure *TSolFSProgressEvent)( System::TObject* Sender, unsigned long Operation, unsigned long Progress, unsigned long Total, bool CanStop, bool &Stop);

[C++ (.NET)]
    public __delegate void SolFSProgressEvent( SolFSStorage* Sender, unsigned long Operation, unsigned long Progress, unsigned long Total, boolean CanStop, boolean __gc &Stop);

[C#]
    public void SolFSProgressEvent( SolFS.SolFSStorage Sender, uint Operation, uint Progress, uint Total, bool CanStop, ref bool Stop);

[VB.NET]
    Sub SolFSProgressEvent( ByVal Sender As SolFS.SolFSStorage, ByVal Operation As UInt32, ByVal Progress As UInt32, ByVal Total As UInt32, ByVal CanStop As Boolean, ByRef Stop As Boolean)

[Java]
    boolean ISolFSProgressEvents.onProgress( long operation, long progress, long total, boolean canStop )

Parameters

  • Sender - reference to the class that called the delegate/event handler.
  • Operation - the code of operation being performed.
  • Progress - current progress.
  • Total - maximum progress. Can be 0 if it can't be determined.
  • CanStop - specifies is the operation can be interrupted by the user. The value can be different during one operation
  • Stop - set this parameter to true to stop current operation
  • [Plain C] UserData - application-defined parameter which is specified when the operation is invoked and passed back to callback function.

[Java]  Return values

Returns True if the operation must be stopped immediately and false otherwise.

Description

The event is fired when some lengthy operation is performed. Note, that certain operations can be repeated many times, so the same operation code can be reported several times in Operation parameter.

The callback/event handler must be set before the storage is opened.

[Java]
You need to implement ISolFSProgressEvents interface in your code and pass the object, that implements the events, to one of SolFSStorage constructors that accept storageEvents parameter.

[Java]
ERROR REPORTING: In Java you can't return more than one parameter, so the natural way is to throw an exception. You can throw any exception, and this exception will be passed back to the code, which called one of SolFS functions. So if you use callback mechanism and throw exception from within event handlers, be sure to wrap each call to SolFS methods with try/catch.

See also

Information about callbacks (Operating System edition only)     CheckAndRepair     FormatFixedSize    

Back to top