You are here: C++ API > Classes > dtsOutputInfo Structure
dtSearch Text Retrieval Engine Programmer's Reference
dtsOutputInfo Structure

Describes how you want a dtSearch search report to be generated.

File: dtsearch.h

struct dtsOutputInfo { const char * outputFile; char * outputBuf; long outputBufLen; int (* pOutputFn)(void *pData, const char *text, int len); void * pData; long outputFormat; const char * beforeHit; const char * afterHit; const char * header; const char * footer; const char * htmlHead; const char * baseHref; const char * docTypeTag; };

dtsOutputInfo provides ways to control the format (HTML, RTF, plain text) and appearance of the output (file format, headers, footers, etc.) as well as the manner in which the output is provided (in memory, to a file, or through a callback function). 

The header, footer, beforeHit, and afterHit markings should be in the format of the output. For example, if the output format is HTML, then beforeHit and afterHit markings could be <b> and </b>. 

beforeHit, afterHit, header, and footer control the appearance of converted text. 

The header and footer strings are inserted before and after the body of the document. 

The beforeHit and afterHit markers are inserted before and after each hit word. The beforeHit and afterHit markers can contain hypertext links. 

To facilitate creation of hit navigation markers, the strings "%%ThisHit%%", "%%NextHit%%", and "%%PrevHit%%" will be replaced with ordinals representing the current hit, the next hit, and the previous hit in the document. 

For example, the following code makes the beforeHit and nextHit marks act as HTML "Previous Hit" and "Next Hit" buttons.

job.beforeHit = "<A NAME="hit%%ThisHit%%">" "<A HREF="#hit%%PrevHit%%">" "<IMG SRC="hit1.gif" ALIGN="middle" ALT="[Prev Hit]" BORDER=0>"; job.afterHit = "<A HREF="#hit%%NextHit%%">" "<IMG SRC="hit2.gif" ALIGN="middle" ALT="[Next Hit]" BORDER=0>";
Copyright (c) 1995-2022 dtSearch Corp. All rights reserved.