Indy 9
TIdDecoder
Hierarchy, Properties, Methods, See Also, Unit: IdCoder
Abstract ancestor for Indy decoder classes.
TIdDecoder = class(TIdBaseComponent)
Unit
IdCoder
Description
TIdDecoder is a TIdBaseComponent descendant that is the abstract ancestor for all Indy classes that perform decoding operations on String values to either String- or Stream-based destinations. Descendants of TIdDecoder include TIdDecoder4to3 and TIdDecoderQuotedPrintable.

Applications do not normally create instances of TIdDecoder, and instead use one of the descendant classes that implements a specific decoding algorithm. TIdDecoder can be used an as ancestor for classes that utilize a unique decoding algorithm and also adhere to the Indy coder framework.


TIdDecoder.DecodeString
TIdDecoder, See Also
Class function providing access to decoding of String values.
class function DecodeString(AIn: string): string;
Parameters
AIn: string
Value to be decoded.
Return Value
String - Decoded value of the input parameter.
Description
DecodeString is a class function in TIdDecoder that provides access to decoding of the String value in AIn. DecodeString creates a temporary instance of TIdDecoder, and calls the DecodeToString method to get the return value. The temporary instance of TIdDecoder is freed before exiting from the DecodeString method.

TIdDecoder.DecodeToStream
TIdDecoder, See Also
Specifies the method for decoding String values to a Stream.
procedure DecodeToStream(AIn: string; ADest: TStream); virtual; abstract;
Parameters
AIn: string
Value to be decoded.
ADest: TStream
Stream that is the destination for the decoded value.
Description
DecodeToStream is an abstract virtual method in TIdDecoder that specifies the coder method used to decode the String value in AIn to the TStream destination in ADest. Descendant classes, like TIdDecoderQuotedPrintable, must reimplement DecodeToStream to use a specific decoding algorithm.

Use DecodeToString to provide decoding operations that return a String value.


TIdDecoder.DecodeToString
TIdDecoder, See Also
Returns a decoded String value.
function DecodeToString(const AIn: string): string;
Parameters
const AIn: string
Value to be decoded.
Return Value
String - Decoded value of the input parameter.
Description
DecodeToString is a String function that performs decoding of the value in AIn, and returns the result as a String. In its implementation, DecodeToString calls DecodeToStream with a TStringStream created to receive the decoded value.

Applications should use DecodeToStream when a Stream-based destination is needed for the decoded value.

DecodeToString is called by the class function DecodeString to perform decoding operations when no application instance of TIdDecoder is needed.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.