Used with dtsIndexJob and dtsSearchJob to record errors that occur during indexing or searching.
struct dtsErrorInfo { long structSize; void * pUserData; };
dtsearch.h
dtsErrorInfo accumulates messages in a buffer and has member functions to provide access to those messages. Additionally, it has a callback function you can use to obtain notifications each time a message is added to the dtsErrorInfo. dtsErrorInfo provides a more thread-friendly way to report errors than the global callback functions in the dtsInitInfo structure passed to dtssDoInit.
For each message, the following information is recorded: (1) a numeric code, which identifies the message in a language-independent way; (2) the text of the message; and (3) up to two string arguments for the message. For example, if an index cannot be accessed in a search, the numeric code will be dtsErAccIndex, the text of the message will be "Unable to access index," the first argument will be the path to the index, and the second argument will be the reason the index could not be accessed.
To use dtsErrorInfo,
The data members of dtsErrorInfo (messageText, messageCode, etc.) should not be accessed directly. Instead, use the dtsErrorInfo constructor to initialize them and then use getCount(), getMessage(), etc. to access them.
|
Data Member |
Description |
|
Use the pUserData pointer to store instance data that you want to access in the callback function in pNotifyFn. | |
|
Initialize to sizeof(dtsErrorInfo). |
|
Method |
Description |
|
Removes all messages from a dtsErrorInfo but does not deallocate the buffers. | |
|
Copy all data from another dtsErrorInfo | |
|
Constructor for dtsErrorInfo, which will allocate fixed-length buffers large enough to hold, by default, up to 20 messages with up to 4096 bytes. The dtsErrorInfo destructor will automatically deallocate these buffers. | |
|
Transfer messages to another dtsErrorInfo | |
|
Returns the number of messages logged in the dtsErrorInfo. | |
|
Returns the text of a message | |
|
Returns the numeric code of a message (see Error Codes for the values of these codes) | |
|
Return text meaning for a numeric error code | |
|
Adds a message to the dtsErrorInfo | |
|
Returns true if some messages could not be stored in the dtsErrorInfo because the buffers were too small. | |
|
Attaches a callback notification function to the dtsErrorInfo. Each time an error occurs during searching or indexing, the function provided will be called with a pointer to the dtsErrorInfo as the only parameter. Instance data can be accessed through the pUserData member of the dtsErrorInfo. |
|
Data Member |
|
Method |
|
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.
|