Class TRALMultipartDecoder

Unit

Declaration

type TRALMultipartDecoder = class(TObject)

Description

Base class for the object that will parse Multipart from the HTTP Request

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public function FormDataCount: IntegerRAL;
Protected function BurnBuffer: PByte;
Protected function GetFormData(idx: Integer): TRALMultipartFormData;
Protected function ProcessLine: PByte;
Protected function ResetBuffer: PByte;
Public procedure ProcessMultiPart(AStream: TStream); overload;
Public procedure ProcessMultiPart(const AString: StringRAL); overload;
Protected procedure ClearItems;
Protected procedure FinalizeItem;
Protected procedure ProcessBuffer(AInput: PByte; AInputLen: IntegerRAL);
Protected procedure SetContentType(AValue: StringRAL);

Properties

Published property Boundary: StringRAL read FBoundary write FBoundary;
Published property ContentType: StringRAL write SetContentType;
Public property FormData[idx:Integer]: TRALMultipartFormData read GetFormData;
Published property OnFormDataComplete: TRALMultipartFormDataComplete read FOnFormDataComplete write FOnFormDataComplete;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public function FormDataCount: IntegerRAL;

Returns the ammount of items in the Multipart

Protected function BurnBuffer: PByte;

used to write the info of the Multipart into the stream buffer

Protected function GetFormData(idx: Integer): TRALMultipartFormData;

Gets an item from the FormData based on the index provided

Protected function ProcessLine: PByte;

Function that separates Multipart by its lines

Protected function ResetBuffer: PByte;

Function that initializes the Multipart buffer

Public procedure ProcessMultiPart(AStream: TStream); overload;

Processes the Multipart from a Stream input

Public procedure ProcessMultiPart(const AString: StringRAL); overload;

Processes the Multipart from a String input

Protected procedure ClearItems;

destroys the content of the Multipart

Protected procedure FinalizeItem;

Method called at the end of the Multipart processing to remove linebreaks

Protected procedure ProcessBuffer(AInput: PByte; AInputLen: IntegerRAL);

Main method that reads the Multipart

Protected procedure SetContentType(AValue: StringRAL);

Setter function for Content-type

Properties

Published property Boundary: StringRAL read FBoundary write FBoundary;
 
Published property ContentType: StringRAL write SetContentType;
 
Public property FormData[idx:Integer]: TRALMultipartFormData read GetFormData;

Gets an item from the FormData based on the index provided

Published property OnFormDataComplete: TRALMultipartFormDataComplete read FOnFormDataComplete write FOnFormDataComplete;
 


GitHub Repository
Generated by PasDoc 0.16.0.