You are here: C++ Support Classes
C++ Support Classes
Close
dtSearch Text Retrieval Engine Programmer's Reference
C++ Support Classes

To make development with the dtSearch Engine easier, a small collection of classes is provided to simplify the function-call API.

The C++ Support Classes are not compiled into the dtSearch Engine DLL, and instead are provided as C++ source files and also, under Windows, as a static library project. 

An optional macro, USE_DTSEARCH_NAMESPACE, will place all of the C++ Support Classes into a namespace named "dtSearch".

Job Classes

The "Job" classes -- DFileConvertJob, DIndexJob, DIndexMergeJob, DIndexListJob, DSearchJob, and DSearchReportJob -- all inherit basic job control functions from DJobBase. For information on starting, monitoring, or cancelling a job, and on obtaining error information on a job that has completed, see the DJobBase documentation.

String Classes

The DStringProperty and DStringSetProperty classes are used extensively in the Job classes to provide easy access to string and string set values passed to or from the dtSearch Engine. The advantage of these classes over the char * pointers used in the lower-level function-call interface is that the DStringProperty and DStringSetProperty classes take care of all character set conversion issues, so that values can be set or read as Ansi, Unicode, or UTF-8 (the format the dtSearch Engine uses internally). 

Some API functions return variable-length string data as a dtsStringHandle. To transfer this string data to a DString and release the dtsStringHandle object in a single step, call DString's getFromStringHandle function.

Including the libraries as source code

To include the source code version of the C++ Support Classes in a project: 

1.   Add the dtSearch examples\cpp\include folder to the include path 

2.   #include <dtsfc.h> in source code modules that use the classes 

3.   Add these source code files in the dtSearch examples\cpp\common folder to the project:

File
Purpose
dtsearch.cpp
Constructors for API functions -- always required
dtsviewr.cpp
Constructors for API functions -- always required
dtsfc.cpp
"Job" classes (DIndexJob, DSearchJob, etc.)
dstring.cpp
String classes used in the dtsfc.cpp Job classes
dfile.cpp
File class
dinputstream.cpp
Stream classes used in the dtsfc.cpp Job classes
settings.cpp
Class to read and write XML-based settings files used in the dtSearch Engine
xmlMaker.cpp
XML reader and writer classes used by settings.cpp