Register an external file parser. See File Parser API
File
File: dtsviewr.h
Syntax
C++
struct dtsViewerInfo {
char name[maxTypeNameLen];
unsigned short typeId;
char version[maxTypeNameLen];
dtsRecognitionSignature signature;
const char * filenamePattern;
long filenameConfidence;
unsigned long blockSize;
int (* recognize)(dtsInputStream& aStream);
dtsViewerHandle (* makeViewer)(dtsInputStream& aStream);
void (* destroyViewer)(dtsViewerHandle handle);
void (* readTextBlock)(dtsViewerHandle handle, dtsTextBlock& block);
void (* gotoBookMark)(dtsViewerHandle handle, dtsBookMark& bookMark);
void (* getFileInfo)(dtsViewerHandle handle, dtsFileInfo& info);
long flags;
long (* getCount)(dtsViewerHandle handle);
int (* getFirst)(dtsViewerHandle handle, dtsContainerItemInfo& info);
int (* getNext)(dtsViewerHandle handle, dtsContainerItemInfo& info);
int (* getInfoByName)(dtsViewerHandle handle, const char *name, dtsContainerItemInfo& info);
int (* getInfoByIndex)(dtsViewerHandle handle, long index, dtsContainerItemInfo& info);
int (* extractToMem)(dtsViewerHandle handle, dtsContainerItemInfo& info, void *dest, long bufLen);
int (* extractToFile)(dtsViewerHandle handle, dtsContainerItemInfo& info, const char *fileToCreate);
char canExtractToMem;
dtsViewerHandle (* makeViewer2)(dtsMakeViewerParams& params);
};
Data Members
Data Member |
Description |
---|---|
Size of the text blocks to pass to the readTextBlock function. (Note: The block size actually provided to readTextBlock may be different from the requested size, so readTextBlock implementations should check the size of the dtsTextBlock passed in and should not assume that the provided buffer is of the requested size.) | |
True if this file parser implements extractToMem | |
Delete the object represented by a handle previously returned by makeViewer. | |
Pointer to function that will extract an item from the container to a temporary file. | |
Pointer to function that will extract an item from the container to a memory buffer. | |
If the filename matches filenamePattern, identifies how confident the parser is that the file belongs to the parser. Ranges from 0 to dtsMaxConfidence. | |
Used to determine whether a file belongs to this file parser. If non-NULL, this points to a block of memory containing a series of null-terminated filename filters such as "*.DOC", terminated by a double-null. | |
ViewerInfoFlags describing this file parser | |
Pointer to function that will return the number of files in the container. | |
Get basic information about the document associated with handle. All of this will be available in the dtsInputStream, but a viewer may wish to modify the information in some cases. | |
Pointer to function that will get information about the first item in the container. | |
Pointer to function that will get information about an item in the container, identified by its numerical index. (See dtsContainerItemInfo.indexInContainer.) | |
Pointer to function that will get information about a named item in the container. | |
Pointer to function that will get information about the next item in the container. | |
Reposition the parser's input pointer to the start of the text block identified by the dtsBookMark, or any earlier position in the file. Most file parsers should just rewind the input to the beginning of the file. | |
Create a file parser for a dtsInputStream. Deprecated: Use dtsMakeViewer2 | |
Pointer to a function that will create a file parser for a dtsInputStream, using information provided in a dtsMakeViewerParams struct. | |
Name of the file format | |
read a block of text from the input and store it in a dtsTextBlock. | |
If not NULL, will be called to determine whether the a file has the format recognized by the parser. If possible, file parsers should use the recognitionSignature to identify the file format and initialize recognize to NULL. | |
A dtsRecognitionSignature that is used to determine whether a file belongs to this file parser. | |
Numeric identifier for the viewer. Internal viewers use the types listed in the dtsInputType enumeration. External viewers should use values starting at it_LastInternal | |
For diagnostic purposes only, a string identifying the version of the parser. |
Group
Members
Data Members
Data Member |
Description |
---|---|
Size of the text blocks to pass to the readTextBlock function. (Note: The block size actually provided to readTextBlock may be different from the requested size, so readTextBlock implementations should check the size of the dtsTextBlock passed in and should not assume that the provided buffer is of the requested size.) | |
True if this file parser implements extractToMem | |
Delete the object represented by a handle previously returned by makeViewer. | |
Pointer to function that will extract an item from the container to a temporary file. | |
Pointer to function that will extract an item from the container to a memory buffer. | |
If the filename matches filenamePattern, identifies how confident the parser is that the file belongs to the parser. Ranges from 0 to dtsMaxConfidence. | |
Used to determine whether a file belongs to this file parser. If non-NULL, this points to a block of memory containing a series of null-terminated filename filters such as "*.DOC", terminated by a double-null. | |
ViewerInfoFlags describing this file parser | |
Pointer to function that will return the number of files in the container. | |
Get basic information about the document associated with handle. All of this will be available in the dtsInputStream, but a viewer may wish to modify the information in some cases. | |
Pointer to function that will get information about the first item in the container. | |
Pointer to function that will get information about an item in the container, identified by its numerical index. (See dtsContainerItemInfo.indexInContainer.) | |
Pointer to function that will get information about a named item in the container. | |
Pointer to function that will get information about the next item in the container. | |
Reposition the parser's input pointer to the start of the text block identified by the dtsBookMark, or any earlier position in the file. Most file parsers should just rewind the input to the beginning of the file. | |
Create a file parser for a dtsInputStream. Deprecated: Use dtsMakeViewer2 | |
Pointer to a function that will create a file parser for a dtsInputStream, using information provided in a dtsMakeViewerParams struct. | |
Name of the file format | |
read a block of text from the input and store it in a dtsTextBlock. | |
If not NULL, will be called to determine whether the a file has the format recognized by the parser. If possible, file parsers should use the recognitionSignature to identify the file format and initialize recognize to NULL. | |
A dtsRecognitionSignature that is used to determine whether a file belongs to this file parser. | |
Numeric identifier for the viewer. Internal viewers use the types listed in the dtsInputType enumeration. External viewers should use values starting at it_LastInternal | |
For diagnostic purposes only, a string identifying the version of the parser. |
Methods
Methods