KVXMLConvertFile()
This function is called directly and converts a source file to an output file.
Syntax
BOOL pascal KVXMLConvertFile ( void *pContext, void *pCallingContext, char *pInFileName, char *pOutFileName, KVXMLTemplate *pTemplates, KVXMLOptions *pOptions, KVXMLTOCOptions *pTOCCreateOptions, KVXMLCallbacks *pCallbacks, BOOL bIndex, KVErrorCode *pError)
Arguments
|
|
A pointer to an Export session that you initialized by calling fpInit(). |
|
|
A pointer passed back to the callback functions. |
|
|
A pointer to the input file. |
|
|
A pointer to the output file. |
|
|
A pointer to the data structure If this pointer is |
|
|
A pointer to the data structure If this pointer is |
|
|
A pointer to the If this pointer is |
|
|
A pointer to the If callbacks are not used, this can be |
|
|
Set This can also be set through the |
|
|
A pointer to an error code if the call to |
Returns
-
If the call is successful, the return value is
TRUE. -
If the call is unsuccessful, the return value is
FALSE.
Discussion
-
Only
pContext,pInFileName,pOutFileName, andbIndexare required. All other pointers should beNULLwhen they are not set. -
If
pCallbacksisNULL,pOptions->pszDefaultOutputDirectorymust be valid, except when you setbIndextoTRUE. -
This function runs in-process or out-of-process. See Convert Files Out-of-Process.
-
When converting out-of-process, this function must be called after the call to
KVXMLStartOOPSession()and before the call toKVXMLEndOOPSession(). See KVXMLStartOOPSession() and KVXMLEndOOPSession(). -
When converting out-of-process, the values for the
KVXMLTemplate,KVXMLOptions, andKVXMLTOCOptionsstructures should be set toNULL. These structures are already passed in the call toKVXMLStartOOPSession(). See KVXMLStartOOPSession(). -
On Windows,
pInFileNameandpOutFileNamemust be in the local Windows code page.
Example
if(!(*KVXMLInt.KVXMLConvertFile)(
pKVXML, /* Pointer returned by fpInit() */
NULL, /* Pointer for callback functions */
&InputFile, /* Input file */
&OutputFile, /* Output file */
&XMLTemplates, /* Markup and related variables */
&XMLOptions, /* Options */
NULL, /* TOC options */
NULL, /* A pointer to callback functions */
FALSE, /* Index mode */
&error)) /* Error return value */
{
printf("Error converting %s to XML %d\n", argv[i - 1], error);
}
else
{
printf("Conversion of %s to XML completed.\n\n", argv[i - 1]);
}