Record Sagui

Hierarchy
Fields
Properties

Unit

Declaration

type Sagui = record

Description

Global Sagui object containing general purpose functions.

Overview

Methods

Public class function Version: Cardinal; overload; static;
Public class function Version(out AMajor, AMinor: Byte; out APatch: SmallInt): Cardinal; overload; static;
Public class function VersionStr: string; static;
Public class function Malloc(ASize: NativeUInt): Pointer; static;
Public class function Alloc(ASize: NativeUInt): Pointer; static;
Public class function Realloc(APointer: Pointer; ASize: NativeUInt): Pointer; static;
Public class procedure Free(APointer: Pointer); static;
Public class procedure StrError(AErrorNum: Integer; out AErrorMsg: string; AErrorLen: Integer); overload; static; inline;
Public class function StrError(AErrorNum: Integer): string; overload; static;
Public class function IsPost(const AMethod: string): Boolean; static;
Public class function ExtractEntryPoint(const APath: string): string; static;
Public class function TmpDir: string; static;
Public class function EOR(AError: Boolean): NativeInt; static;
Public class function IP(ASocket: Pointer): string; static;

Description

Methods

Public class function Version: Cardinal; overload; static;

Returns the library version number.

Returns

Library version packed into a single integer.

Public class function Version(out AMajor, AMinor: Byte; out APatch: SmallInt): Cardinal; overload; static;

Returns the library version number.

Parameters
AMajor[out]
Major number.
AMinor[out]
Minor number.
APatch[out]
Patch number.
Returns

Library version packed into a single integer.

Public class function VersionStr: string; static;

Returns the library version number as string in the format <MAJOR>.<MINOR>.<PATCH>.

Returns

Library version packed into a static string.

Public class function Malloc(ASize: NativeUInt): Pointer; static;

Allocates a new memory space.

Parameters
ASize[in]
Memory size to be allocated.
Returns

Pointer of the allocated zero-initialized memory.

Returns values:

nil

If size is 0 or no memory space.

Public class function Alloc(ASize: NativeUInt): Pointer; static;

Allocates a new zero-initialized memory space.

Parameters
ASize[in]
Memory size to be allocated.
Returns

Pointer of the allocated zero-initialized memory.

Returns values:

nil

If size is 0 or no memory space.

Public class function Realloc(APointer: Pointer; ASize: NativeUInt): Pointer; static;

Reallocates an existing memory block.

Parameters
APointer[in]
Pointer of the memory to be reallocated.
ASize[in]
Memory size to be allocated.
Returns

Pointer of the reallocated memory.

Public class procedure Free(APointer: Pointer); static;

Frees a memory space previous allocated by Sagui.Malloc, Sagui.Alloc or Sagui.Realloc.

Parameters
APointer[in]
Pointer of the memory to be freed.
Public class procedure StrError(AErrorNum: Integer; out AErrorMsg: string; AErrorLen: Integer); overload; static; inline;

Returns string describing an error number.

Parameters
AErrorNum[in]
Error number.
AErrorMsg[out]
Referenced string to store the error message.
AErrorLen[in]
Length of the error message.
Public class function StrError(AErrorNum: Integer): string; overload; static;

Returns string describing an error number.

Parameters
AErrorNum[in]
Error number.
Returns

Static string describing the error.

Public class function IsPost(const AMethod: string): Boolean; static;

Checks if a string is an HTTP post method.

Parameters
AMethod[in]
HTTP verb.
Returns

True if given method is POST, PUT, DELETE or OPTIONS.

Public class function ExtractEntryPoint(const APath: string): string; static;

Extracts the entry-point of a path or resource. For example, given a path /api1/customer, the part considered as entry-point is /api1.

Parameters
APath[in]
Path as static string.
Returns

Entry-point as static string.

Public class function TmpDir: string; static;

Returns the system temporary directory.

Returns

Temporary directory as static string.

Public class function EOR(AError: Boolean): NativeInt; static;

Indicates the end-of-read processed in TBrookHTTPResponse.SendStream.

Parameters
AError[in]
True to return a value indicating a stream reading error.
Returns

Value to end a stream reading.

Public class function IP(ASocket: Pointer): string; static;

Obtains the IP of a socket handle into a string.

Parameters
ASocket[in]
Socket handle.
Returns

Formatted IP into a string.


Generated by PasDoc 0.16.0.