- Notifications
You must be signed in to change notification settings - Fork5
Everything Search Engine SDK for Delphi
License
delphilite/EverythingSDK
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
EverythingSDK is aDelphi client library forVoidtools' Everything search engine. It supports both dynamic and static libraries from the native Everything SDK.
Everything is a powerful search engine that can index and search for files, folders, and other data on your Windows system. The official C++ SDK provides a way to access the Everything database and perform searches programmatically. This repository provides a Delphi translation of the C++ SDK, allowing Delphi developers to easily integrate Everything search functionality into their applications.
Everything service must be running on your machine.
- Complete translation of Everything's C++ SDK to Delphi.
- Easy integration with Delphi projects.
- Supports all major features of the original SDK.
- Supports using static libraries (Everything32.obj/Everything64.obj). By enabling the ET_STATICLINK directive (default).
- Supports using dynamic libraries (Everything32.dll/Everything64.dll).
- Supports using the Everything IPC (EverythingIPC.pas+EverythingImpl.pas). Reference EverythingImpl instead of EverythingSDK, without requiring any DLL or OBJ.
- Delphi XE2 or later.
- Everything 1.4.1 or later.
To install the EverythingSDK binding, follow these steps:
Clone the repository:
git clone https://github.com/delphilite/EverythingSDK.git
Add the EverythingSDK\Source directory to the project or IDE's search path.
Make sure Everything is installed and running on your system.
EverythingSDK should now be listed inDelphinus package manager.
Be sure to restart Delphi after installing via Delphinus otherwise the units may not be found in your test projects.
Here's a simple example demonstrating how to use the EverythingSDK in a Delphi application:
uses SysUtils, Windows, EverythingSDK;{ or EverythingImpl instead of EverythingSDK}functionFileTimeToDateTime(const AFileTime: TFileTime): TDateTime;var LocalFileTime: TFileTime; SystemTime: TSystemTime;begin FileTimeToLocalFileTime(AFileTime, LocalFileTime); FileTimeToSystemTime(LocalFileTime, SystemTime); Result := SystemTimeToDateTime(SystemTime);end;functionFormatFileAttrib(AAttrib: DWORD): string;beginif AAttriband faDirectory <>0then Result :=''elsebegin Result :='';if AAttriband faReadOnly <>0then Result := Result +'r'else Result := Result +'-';if AAttriband faArchive <>0then Result := Result +'a'else Result := Result +'-';if AAttriband faHidden <>0then Result := Result +'h'else Result := Result +'-';if AAttriband faSysFile <>0then Result := Result +'s'else Result := Result +'-';end;end;procedureExecute(const AFind: string);var C, F, I, R: DWORD; dwAttributes: DWORD; fileName: string; fileAttrib, fileSize, fileTime: string; ftModified: TFileTime; nSize: Int64;begin Writeln('Find:', AFind); Everything_SetSearch(PChar(AFind)); F := EVERYTHING_REQUEST_FILE_NAMEor EVERYTHING_REQUEST_PATHor EVERYTHING_REQUEST_DATE_MODIFIEDor EVERYTHING_REQUEST_SIZEor EVERYTHING_REQUEST_ATTRIBUTES; Everything_SetRequestFlags(F); Everything_SetSort(EVERYTHING_SORT_PATH_ASCENDING); Writeln('Execute Query');ifnot Everything_Query(True)thenbegin R := Everything_GetLastError; raise Exception.Create(Everything_GetErrorMessage(R));end; Writeln('Result List Request Flags:', Everything_GetResultListRequestFlags()); C := Everything_GetNumResults(); Writeln('Result List Count:', C);if C >0thenfor I :=0to C -1dobegin SetLength(fileName, MAX_PATH); R := Everything_GetResultFullPathName(I, PChar(fileName), MAX_PATH); SetLength(fileName, R); dwAttributes := Everything_GetResultAttributes(I); fileAttrib := FormatFileAttrib(dwAttributes); fileAttrib := Format('%6s', [fileAttrib]); Everything_GetResultSize(I, nSize);if dwAttributesand faDirectory <>0then fileSize :='-1'else fileSize := FormatFloat('#,#.#',nSize); fileSize := Format('%16s', [fileSize]);if Everything_GetResultDateModified(I, ftModified)then fileTime := FormatDateTime('yyyy/mm/dd hh:nn:ss', FileTimeToDateTime(ftModified))else fileTime := StringOfChar('',19); Writeln(fileTime,'', fileAttrib,'', fileSize,'', fileName);end;end;begin ReportMemoryLeaksOnShutdown := True;try WriteLn('Everything:', Everything_GetVersion); WriteLn(''); Execute('*.iso'); WriteLn(''); WriteLn('Done.');except on E: Exceptiondo WriteLn('Error:', E.Message);end; ReadLn; Everything_CleanUp;end.
For more examples based on low-level API, refer to the test cases under the demos directory.
For more detailed information, refer to theEverything SDK.
Contributions are welcome! Please fork this repository and submit pull requests with your improvements.
This project is licensed under the Mozilla Public License 2.0. See theLICENSE file for details.
Special thanks to Voidtools for creating Everything and providing the original SDK.
About
Everything Search Engine SDK for Delphi
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.