dtSearch Text Retrieval Engine Programmer's Reference 7.86
C++ Support Classes
Legend | Namespaces | Topics | Functions | Send Feedback

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

Using the C++ Support Classes

The classes are not compiled into the dtSearch Engine DLL, and instead are provided as C++ source files and also as a static library that you can include in your project. 

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

To include the static library version of the classes in your project: 

1.   Tell the compiler where to find the dtSearch .lib and .h files. To do this, add the dtSearch Engine LIB folder to the library path and add the dtSearch Engine examples\cpp\include folder to the "include" path. 

2.   #include <dtsfclib.h> in the source code modules that use the dtSearch Engine.

Library compatibility

Four versions of the static library are included: Release, Debug, Unicode Release, and Unicode Debug. The dtsfclib.h header will automatically select the correct version for your configuration. 

To build the libraries, open the dtsfclib Visual C++ project file and build it. The projects are located under the dtSearch examples folder, in folders named examples\vcN\dtsfclib, where N is the Visual C++ version.

Requirements to use the static libraries

To use the pre-built static libraries, your project must 

1. Use MFC 

2. Be built with MFC support and with the multithreaded DLL version of the runtime library; 

3. Be built with the option to make wchar_t a built-in type (Project properties > C/C++ > Language > Treat wchar_t as Built-in Type); 

4. Use the new streams (#include <fstream>, not #include <fstream.h>), if the project uses iostreams; and 

5. #define the USE_DTSEARCH_NAMESPACE macro. 

If your project is not compatible with these assumptions, you can still use the C++ Support Classes, but you will need to include them as source code. (The static libraries are built by the project in the examples\vcX\dtsfclib folder, so you can also build custom versions of the static libraries.)

Including the libraries as source code

To include the source code version of the C++ support classes in a C++ project: 

1.   Tell the compiler where to find the dtSearch .lib and .h files. To do this, add the dtSearch Engine LIB folder to the library path and add the dtSearch Engine examples\cpp\include folder to the "include" path. 

2.   Add dten600.lib or dtengine64.lib to the project. 

3.   Add the source code files in the dtsfclib project file to the project. These files are located in the dtSearch Engine examples\cpp\common folder. 

4.   #include <dtsfc.h> in source code modules that use the classes, or add dtsfc.h to your stdafx.h

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.

Namespace for C++ support classes. 
The following table lists functions in this documentation. 
To conditionally define logging away If dlogger.h is not included before or after dfile.h, debugLog() will map to debugLogIgnore() 
You are here: C++ Support Classes
Copyright (c) 1995-2016 dtSearch Corp. All rights reserved.