EldoS
 Table of Contents >  OnEnumerateNamedStreams event/delegate/callback
Navigation
Web site
Support
Table Of Contents
Send comments on this topic

OnEnumerateNamedStreams event/delegate/callback

Filter:

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

CallbackFileSystem    

Overview

The event is fired when the OS needs to check availability and enumerate the named streams of the file.

Declaration

[Pascal]
    property OnEnumerateNamedStreams : TCbFsEnumerateNamedStreamsEvent;
    TCbFsEnumerateNamedStreamsEvent = procedure( Sender : TObject; FileInfo: TCbFsFileInfo; var NamedStreamContext: pointer; var StreamName: WideString; var StreamSize: Int64; var StreamAllocationSize: Int64; var NamedStreamFound: Boolean ) of object;

[C++ (Lib)]
    void (__stdcall *CbFsEnumerateNamedStreamsEvent)(void* Sender, CbFsFileInfo* FileInfo, PVOID* NamedStreamContext, LPWSTR StreamName, __int64 * StreamSize, __int64 * StreamAllocationSize, LPBOOL NamedStreamFound );

[C++ (VCL)]
    typedef void (__closure *TCbFsEnumerateNamedStreamsEvent)( System::TObject* Sender, CbFsFileInfo* FileInfo, void ** NamedStreamContext, WideString & StreamName, __int64 & StreamSize, __int64 & StreamAllocationSize, bool & NamedStreamFound );

[C++ (.NET)]
    public __delegate void CbFsEnumerateNamedStreamsEvent( CallbackFileSystem^ Sender, CbFsFileInfo^ FileInfo, IntPtr% NamedStreamContext, String^% StreamName, Int64% StreamSize, Int64% StreamAllocationSize, bool% NamedStreamFound );

[C#]
    public void CbFsEnumerateNamedStreamsEvent( CallbackFileSystem Sender, CbFsFileInfo FileInfo, ref IntPtr NamedStreamContext, ref string StreamName, ref Int64 StreamSize, ref Int64 StreamAllocationSize, ref bool NamedStreamFound );

[VB.NET]
    Sub CbFsEnumerateNamedStreamsEvent( ByVal Sender As CallbackFileSystem, ByRef FileInfo As TCbFsFileInfo, ByRef NamedStreamContext As IntPtr, ByRef StreamName As String, ByRef StreamSize As Int64, ByRef StreamAllocationSize As Int64, ByRef NamedStreamFound As Boolean )

Parameters

  • Sender - reference to the class that called the delegate/event handler.
  • FileInfo - the information about the file whose streams are enumerated
  • NamedStreamContext - the placeholder for the application-defined data
  • StreamName - the event handler must set this parameter to the name of the found named stream.
    [C++ (Lib)] The buffer of size 32768 characters is passed by the caller. The event handler must put the stream name to this buffer.
  • StreamSize - the event handler must place the size of the stream data in bytes to this parameter.
  • StreamAllocationSize - the event handler must place the size of the space, allocated for the stream to this parameter. The allocation size is in most cases a multiple of the allocation unit (cluster) size
  • NamedStreamFound - the event handler must set this parameter to true if the stream exists and the information is provided and false otherwise

Description

This event is fired when the OS wants to enumerate the directory entries by mask.
The application must report information about the entry in the file specified by FileInfo. If the entry is present, NamedStreamFound must be set to true and the information about the entry must be included. If the entry is not present, NamedStreamFound must be set to false.

If this is the first call to enumerate the directory entries, NamedStreamContext can be used to store information, which speeds up subsequent enumeration calls. The application can use NamedStreamContext to store the reference to some information, identifying the search (such as file handle or database record ID etc). The value, set in the event handler, is later passed to all operations, related to this enumeration, i.e. subsequent calls to OnEnumerateNamedStreams event handler.
Read more about contexts.

The event is optional, i.e. you should not to attach an event handler if you don't plan to work with alternate (named) streams. In this case CBFS API will tell the OS that the named streams are not supported by the file system.

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.

Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2008, EldoS Corporation