TECCreateSniffer
Creates a sniffer object and returns a reference to it.
Declaration
OSStatus TECCreateSniffer(TECSnifferObjectRef *encodingSniffer, const TextEncoding testEncodings[], ItemCount numTextEncodings);Parameters
- encodingSniffer:
A pointer to a sniffer object reference, which is of type Tecsnifferobjectref. On return, the reference pertains to the newly created sniffer object.
- testEncodings:
An array of text encoding specifications supplied by the caller;
TECCreateSniffercreates a sniffer that can detect each of these encodings. - numTextEncodings:
The number of text encoding specifications in the
testEncodings[]array.
Return Value
A resultcode. See Result Codes.
Discussion
The TECCreateSniffer functionpolls plug-ins for available sniffers, creates a sniffer object capableof sniffing each of the specified encodings that it can find a snifferfunction for, and returns a reference to it. You use this snifferobject reference with sniffer functions such as TECSniffTextEncoding. If no snifferfunction is available for an encoding, no error is returned and TECSniffTextEncoding indicateslater that the encoding was not examined.
To remove a sniffer object, you must call the function TECDisposeSniffer.