Discuss this help topic in CBFS Forum

OnIsDirectoryEmpty event/delegate/callback

Filter:

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

CallbackFileSystem     See also    

Overview

The event is fired when the OS needs to check if the directory is empty.

Declaration

[Pascal]
    property OnIsDirectoryEmpty : TCbFsIsDirectoryEmptyEvent;
    TCbFsIsDirectoryEmptyEvent = procedure( Sender : TObject; DirectoryInfo: TCbFsFileInfo; FileName: TCBString; var IsEmpty: boolean ) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    void (__stdcall *CbFsIsDirectoryEmptyEvent)(void* Sender, CbFsFileInfo* DirectoryInfo, LPCWSTR FileName, LPBOOL IsEmpty );

[C++ (VCL)]
    typedef void (__closure *TCbFsIsDirectoryEmptyEvent)( System::TObject* Sender, TCbFsFileInfo* DirectoryInfo, TCBString FileName, bool & IsEmpty );

[C++ (.NET)]
    public __delegate void CbFsIsDirectoryEmptyEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ DirectoryInfo, String^ FileName, bool% IsEmpty );

[C#]
    public void CbFsIsDirectoryEmptyEvent( CallbackFileSystem Sender, CbFsFileInfo DirectoryInfo, String FileName, ref bool IsEmpty );

[VB.NET]
    Sub CbFsIsDirectoryEmptyEvent( ByVal Sender As CallbackFileSystem, ByVal DirectoryInfo As CbFsFileInfo, ByVal FileName As String, ByRef IsEmpty As Boolean )

[Java]
    void ICbFsEnumerateEvents.onIsDirectoryEmpty( CallbackFileSystem sender, CbFsFileInfo directoryInfo, string fileName, boolRef isEmpty );

Parameters

  • Sender - reference to the class that called the delegate/event handler.
  • DirectoryInfo - information about the directory which is being queried.
  • FileName - the name of the directory whose status is queried
  • IsEmpty - the event handler must place the file attributes to this parameter

Description

This event is fired when the OS wants to check whether the directory is empty or contains some files.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to Callback File System. Throwing ECBFSError exception from this event handler will not cause the OS to abort the operation or display an error message to the user.

See also

OnEnumerateDirectory    

Discuss this help topic in CBFS Forum