| IFileTypeManagerGetConverterToNative Method (String, OutputPropertiesProvider, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter for reading native files, doing processing on them and
creating native files as output in one single pass.
The file type definitions are tested in sequence, and the first file type definition that
matches a file is used for each file. The following steps are used to determine if
a file type definition matches a file:
- The regular expression is evaluated against the name of the file to be converted. If it does not match,
the file type definition is not used.
- If a file sniffer is defined for the file type definition, it is applied to the file. If the file sniffer
does not indicate that the file is supported, the file type definition is not used.
If no matching file type definition is found, a
OneOrMoreFilesNotSupportedException is thrown.
Namespace: Sdl.FileTypeSupport.Framework.IntegrationApiAssembly: Sdl.FileTypeSupport.Framework.Core (in Sdl.FileTypeSupport.Framework.Core.dll) Version: 1.0.0.0 (1.0.2551.0)
SyntaxIMultiFileConverter GetConverterToNative(
string[] nativeFilePaths,
OutputPropertiesProvider outputSettingsProvider,
CultureInfo sourceLanguage,
Codepage suggestedCodepage,
EventHandler<MessageEventArgs> messageHandler
)
Function GetConverterToNative (
nativeFilePaths As String(),
outputSettingsProvider As OutputPropertiesProvider,
sourceLanguage As CultureInfo,
suggestedCodepage As Codepage,
messageHandler As EventHandler(Of MessageEventArgs)
) As IMultiFileConverter
IMultiFileConverter^ GetConverterToNative(
array<String^>^ nativeFilePaths,
OutputPropertiesProvider^ outputSettingsProvider,
CultureInfo^ sourceLanguage,
Codepage^ suggestedCodepage,
EventHandler<MessageEventArgs^>^ messageHandler
)
abstract GetConverterToNative :
nativeFilePaths : string[] *
outputSettingsProvider : OutputPropertiesProvider *
sourceLanguage : CultureInfo *
suggestedCodepage : Codepage *
messageHandler : EventHandler<MessageEventArgs> -> IMultiFileConverter
Parameters
- nativeFilePaths
- Type: SystemString
The native files to be converted - outputSettingsProvider
- Type: Sdl.FileTypeSupport.Framework.IntegrationApiOutputPropertiesProvider
Implementation of the output settings provider
that will be passed to the multi-file converter and used for writing files as native.
The returned converter will be
initialized to use this file type manager to create native file generators, and the specified
output settings provider will be used to determine the output properties for the native files
when they are created.
- sourceLanguage
- Type: System.GlobalizationCultureInfo
Expected source language of the files.
The same source (and target) language must be used for all the files processed with a single converter instance.
If the language can be determined automatically
from the content of the file (e.g. when reading a bilingual format such as TTX), this parameter may be ignored by the parser.
If this parameter is left undefined, it is up to the file sniffer and/or parser to try to determine the
language. Parser components may report an error or a warning if they cannot reliably identify the language.
- suggestedCodepage
- Type: Sdl.Core.GlobalizationCodepage
A rough guess of what encoding the files use. This is normally set to the default codepage
for the language, but can also be null. This serves only as a hint. A file sniffer can be used to determine the actual encoding for each file. An
undefined codepage object can be used if no encoding can be guessed. It is then up to the file sniffer and/or parser
to best determine the encoding, and report an error if they fail or a warning if the result is not definite.
- messageHandler
- Type: SystemEventHandlerMessageEventArgs
An (optional) message handler implementation that will receive any messages reported
from file sniffers invoked in the process. If a converter is returned, this message handler will also be
connected to the Message event on the converter. You may specify null for this parameter.
Return Value
Type:
IMultiFileConverterA file converter object initialized to read the files and write corresponding output files based on the
output settings provider.
To use the file converter, add your own bilingual processors to the converter and call
Parse or
ParseNext to process the native files.
Exceptions
See Also
Comments