Class TRegisteredProtocol

Unit

Declaration

type TRegisteredProtocol = class(TObject)

Description

Details of the registered URL protocol. Do not create instances of this class directly, only use RegisterUrlProtocol that returns an instance of this.

Hierarchy

  • TObject
  • TRegisteredProtocol

Overview

Nested Types

Published TUrlMimeTypeEvent = function(const Url: String; out Gzipped: Boolean): String of object;

Properties

Public property Protocol: String read FProtocol;
Public property ReadEvent: TUrlReadEvent read FReadEvent write FReadEvent;
Public property WriteEvent: TUrlWriteEvent read FWriteEvent write FWriteEvent;
Public property AsynchronousReader: TUrlAsynchronousReaderClass read FAsynchronousReader write FAsynchronousReader;
Public property DetectMimeTypeFromExtension: Boolean read GetDetectMimeTypeFromExtension write SetDetectMimeTypeFromExtension default false;
Public property ExistsEvent: TUrlExistsEvent read FExistsEvent write FExistsEvent;

Description

Nested Types

Published TUrlMimeTypeEvent = function(const Url: String; out Gzipped: Boolean): String of object;

Event called when UriMimeType function wants to get MIME type from given URL. Use with RegisterUrlProtocol.

Properties

Public property Protocol: String read FProtocol;

Registered URL protocol, always lowercase. Example: 'https' to handle URLs like 'https://castle-engine.io'. Read-only, set by RegisterUrlProtocol.

Public property ReadEvent: TUrlReadEvent read FReadEvent write FReadEvent;

Optional event to read contents of URLs with given protocol. This event returns TStream from which the called can read.

Used for synchronous reading by Download. See https://castle-engine.io/url for more information how our resource loading works.

Public property WriteEvent: TUrlWriteEvent read FWriteEvent write FWriteEvent;

Optional event to write contents of URLs with given protocol. This event returns TStream to which the caller can write.

Used for writing by URLSaveStream. See https://castle-engine.io/url for more information how our resource saving works.

Public property AsynchronousReader: TUrlAsynchronousReaderClass read FAsynchronousReader write FAsynchronousReader;

Optional class reference to read contents of URLs with given protocol asynchronously.

Protocols that want to support asynchronous reading, so that you can easily download the URL contents while performing other operations (like displaying some animation) should provide this.

See https://castle-engine.io/url for more information how our resource loading works.

Public property DetectMimeTypeFromExtension: Boolean read GetDetectMimeTypeFromExtension write SetDetectMimeTypeFromExtension default false;

Can a reasonable MIME type be inferred from the URL extension. This determines whether the routine UriMimeType returns useful MIME type for this protocol.

The readers (in ReadEvent and AsynchronousReader) may also use UriMimeType, thus be affected by this property, but they can also use more elaborate ways to determine the downloaded MIME type. For example, reading resources from HTTP(S) allows to (usually) get MIME type from the HTTP(S) server. Using UriMimeType, to determine MIME type from extension, is only a fallback in this case.

Public property ExistsEvent: TUrlExistsEvent read FExistsEvent write FExistsEvent;

Optional event to check whether given URL exists (as a directory or file).


Generated by PasDoc 0.16.0-snapshot.