Example
Below is an example of a call to fpGetOLESummaryInfo():
{
KVSummaryInfoEx si;
memset( &si, 0, sizeof(si) );
if ( KVERR_Success != (*pInterface->fpGetOLESummaryInfo)( pKVFilter, pInput, &si ) )
{
fprintf( fpOut, "Error obtaining summary information\n" );
return;
}
if ( si.nElem == 0 )
{
fprintf( fpOut, "No summary information\n" );
goto end;
}
PrintSummaryInfo(&si, fpOut);
end:
(*pInterface->fpFreeOLESummaryInfo)( pKVFilter, &si );
}
where:
pKVFilter
|
A pointer returned from fpInit() or fpInitWithLicenseData(). |
pInput
|
A pointer to the developer-assigned instance of KVInputStream. The structure KVInputStream defines the input stream that contains the source. |
si
|
Points to the structure KVSummaryInfoEx. In the structure, nElem provides a count of the number of metadata elements, and pElem points to the first element of the array of individual elements, as defined by the structure KVSumInfoElemEx. |
To interpret the metadata after fpGetOLESummaryInfo() is called and returns a non-zero status:
- If
si.nElemis zero, the document did not contain metadata. Ifsi.nElemis not zero,si.nElemis the number of metadata elements contained in the array. - Each
KVSumInfoElemExstructure contains the following information for each metadata element:
si.pElem[n].isValid
|
Specifies whether the data value is present in the document. 1 specifies that the value is valid. For example, if the "Title" element was not populated in the document, si.pElem[1].isValid == 0 would evaluate to true. |
si.pElem[n].type
|
Specifies the data type of the metadata element. The types are defined in the structure KVSumInfoType in kvtypes.h. |
si.pElem[n].data
|
A pointer to the content of the element. If
|
si.pElem[n].pcType
|
The name of the metadata field. |