Click or drag to resize
SniffInfo Class
Information returned from Sniff(String, Language, Codepage, INativeTextLocationMessageReporter, ISettingsGroup). This class also allows you to store key/value pairs that the parser may need to read during parsing.
Inheritance Hierarchy
SystemObject
  Sdl.FileTypeSupport.Framework.NativeApiSniffInfo

Namespace: Sdl.FileTypeSupport.Framework.NativeApi
Assembly: Sdl.FileTypeSupport.Framework.Core (in Sdl.FileTypeSupport.Framework.Core.dll) Version: 1.0.0.0 (1.0.2551.0)
Syntax
[SerializableAttribute]
public class SniffInfo : IMetaDataContainer, ICloneable, 
	ISupportsPersistenceId

The SniffInfo type exposes the following members.

Constructors
  NameDescription
Public methodSniffInfo
Default constructor, creates an uninitialized object where IsSupported is false and DetectedEncoding is null.
Protected methodSniffInfo(SniffInfo)
Copy constructor used by the Clone() method. Performs a deep clone of the other object.
Top
Properties
  NameDescription
Public propertyDetectedEncoding
If the file sniffer detects or guesses which encoding is used in the file, it may communicate this to the other parser components by setting this property.
Public propertyDetectedSourceLanguage
If the file sniffer detects or guesses the source language in the file, it can be communicated to the framework by setting this property.
Public propertyDetectedTargetLanguage
If the file sniffer detects or guesses the target language of a bilingual file, it can be communicated to the framework by setting this property.
Public propertyHasMetaData
True if there are any key/value pairs of metadata in the sniff info
Public propertyIsSupported
The file sniffer sets this property to true in order to indicate that the corresponding file type definition can be used for processing this file.
Public propertyItem

Convenience getter and setter for metadata using indexer syntax.

The getter functionality is equivalent to calling SetMetaData(String, String), the setter functionality is equivalent to GetMetaData(String).

Public propertyMetaData
Iterator for all metadata key/value pairs
Public propertyMetaDataCount
Number of key/value pairs of metadata
Public propertyPersistenceId
The persistence ID associated with an object may be used by implementations during operations such as serialization and de-serialization of the object model.
Public propertySuggestedTargetEncoding
The file sniffer's suggestion on what type of encoding would be suitable when generating a translated version of this file.
Top
Methods
  NameDescription
Public methodClearMetaData
Removes all metadata key/value pairs.
Public methodClone
Deep clone this object
Public methodEquals
True if all properties and values are equal.
(Overrides ObjectEquals(Object).)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Computed by combining all properties and values
(Overrides ObjectGetHashCode.)
Public methodGetMetaData
Retrieves the metadata value for the specified key
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMetaDataContainsKey
Determines if a metadata value exists for the specified key
Public methodRemoveMetaData
Removes the metadata value for the specified key from the collection. If no value exists for this key, nothing will happen.
Public methodSetMetaData
Sets the metadata value for the specified key
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Communicates whether the file is considered valid by the file sniffer; may contain additional information such as the detected source and target languages, encoding of the file, etc.

Custom metadata can also be stored and accessed via the IMetaDataContainer implementation.

If the file type is supported and further processed, this information is passed to all file processing components that implement INativeContentCycleAware as the FileSnifferInfo when the framework calls SetFileProperties(IFileProperties).

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments