Close
dtSearch Text Retrieval Engine Programmer's Reference
dtsInputStream Structure

Abstract interface to any source of document data.

File: dtsviewr.h

Syntax
C++
struct dtsInputStream { const char * filename; const char * tempname; long size; dtsFileDate modified; dtsFileDate created; void * pData; void (* seek)(void *pData, long where); long (* read)(void *pData, void *dest, long len); void (* release)(void *pData); const char * displayName; const char * fields; long typeId; __int64 size64; void (* seek64)(void *pData, __int64 where); int parentTypeId; };

The dtSearch Engine API uses dtsInputStream in two places: (1) the external file parser API, which lets you add a file parser to the dtSearch indexing engine, and (2) the dtsDataSource API, which lets you index text data from any source.

dtsInputStream in the external file parser API

Your file parser receives a dtsInputStream as the source of its input and is responsible for converting the data in the file into blocks of indexable text. The input could come from a file handle, a memory buffer, or any other object. The seek() and read() function pointers in the dtsInputStream provide a generic way to read data from the file your parser is processing. Input may come from a document extracted from a container rather than from a disk file, so parsers should not assume that the filename element refers to an existing file on disk. 

dtsInputStream may be extended in the future to provide additional flexibility. To avoid source-level dependencies on dtsInputStream, file parsers should use a dtsInputStreamReader to access a dtsInputStream.

dtsInputStream in the dtsDataSource API

In the dtsDataSource API, your data source creates dtsInputStream objects and returns them to the dtSearch engine to be indexed. Thus, instead of using the read() and seek() pointers, you would implement them. After dtSearch is done indexing a dtsInputStream, dtSearch will call the release() function to request that the calling application dispose of the object. Your implementation can delete the underlying object in response to that call.