SolFSStorage.FindByQueryFirst method


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

SolFSStorage     See also    


Searches for the first instance of a file which tags satisfy a query.


    function FindByQueryFirst(var Search: TStorageSearch; const Directory: TSolFSString; const Query: TSolFSString; Flags: LongWord): Boolean;

[Plain C]
    long _stdcall StorageFindByQueryFirst( Handle Storage, PWideChar Directory, PStorageSearch Search, PWideChar Query, LongWord Flags);

[C++ (DLL/Lib)]
    bool FindByQueryFirst( TStorageSearch &Search, const PWideChar Directory, const PWideChar Query, long Flags)

[C++ (VCL)]
    bool __fastcall FindByQueryFirst( TStorageSearch &Search, const TSolFSString Directory, const TSolFSString Query, unsigned Flags);

[C++ (.NET)]
    bool FindByQueryFirst( String *directory, String *query, long flags, TStorageSearch & search )

    bool FindByQueryFirst( string directory, string query, uint flags, ref CBFSStorage.StorageSearch search )

    Function FindByQueryFirst( ByVal directory As String, ByVal query As String, ByVal flags As UInt32, ByRef search As CBFSStorage.StorageSearch ) As Boolean

    boolean findByQueryFirst( SolFSStorageSearch search, String directory, String query, SearchQueryFlags flags );


  • Directory - search directory.
  • Query - search query.
  • Flags - search flags.
  • Search - on return contains the structure with search result
  • [Plain C] Storage - handle to the storage returned by Create or Open function.

Values of Flags

Return value

    True if a file was successfully located.
    False if no files have been found.
     [Java]  the structure with search result.
     [Plain C]  0 if the function succeeded or one of Error codes if the function failed.


FindByQueryFirst searches the directory specified by Directory using file metadata (tags), for the first file that matches the Query. When you finish enumeration, remember to call FindByQueryClose. Calling this method is not necessary, if FindByQueryFirst returned False ([DLL] "errNoMoreFiles" error code).

See also

Files and streams     Using query language     FindFirst     FindByQueryNext     FindByQueryClose