TASCII85DecoderStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

ASCII 85 decoder stream.

Declaration

Source position: ascii85.pp line 45

type TASCII85DecoderStream = class(TOwnerStream)
published
constructor Create(); | Create new ASCII 85 decoder stream
procedure Decode(); | Decode source byte
procedure Close; | Close decoder
function ClosedP; | Check if the state is correct
property BExpectBoundary: Boolean; [rw] | Expect ~ character
protected
function GetPosition; override;
public
destructor Destroy; override; | Clean up instance
function Read(); override; | Read data from stream
function Seek(); | Set stream position
end;

Inheritance

TASCII85DecoderStream

ASCII 85 decoder stream.
|

TOwnerStream
|

TObject

Description

TASCII85DecoderStream is a read-only stream: it takes an input stream with ASCII 85 encoded data, and decodes the data as it is read. To this end, it overrides the TSTream.Read method.

The stream cannot be written to, trying to write to the stream will result in an exception.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .


TASCII85DecoderStream
pl |  | BExpectBoundary
TOwnerStream
 | ro | Source
 |  | SourceOwner


pl |  | BExpectBoundary (TASCII85DecoderStream)
 | ro | Source (TOwnerStream)
 |  | SourceOwner (TOwnerStream)


TASCII85DecoderStream
pl | Create
pl | Decode
pl | Close
pl | ClosedP
pt | GetPosition
 | Destroy
 | Read
 | Seek
TOwnerStream
 | Create
 | Destroy


pl | Close (TASCII85DecoderStream)
pl | ClosedP (TASCII85DecoderStream)
 | Create (TOwnerStream)
pl | Create (TASCII85DecoderStream)
pl | Decode (TASCII85DecoderStream)
 | Destroy (TOwnerStream)
 | Destroy (TASCII85DecoderStream)
pt | GetPosition (TASCII85DecoderStream)
 | Read (TASCII85DecoderStream)
 | Seek (TASCII85DecoderStream)


TASCII85DecoderStream

TOwnerStream


TASCII85DecoderStream.BExpectBoundary

Expect ~ character

Declaration

Source position: ascii85.pp line 65

published property TASCII85DecoderStream.BExpectBoundary: Boolean
  read fBExpectBoundary
  write fBExpectBoundary;

Description

BExpectBoundary is True if a encoded data boundary is to be expected ("~>").

See also

ClosedP

Check if the state is correct


TASCII85DecoderStream.Close

Close decoder

Declaration

Source position: ascii85.pp line 63

published procedure TASCII85DecoderStream.Close;

Description

Close closes the decoder mechanism: it checks if all data was read and performs a check to see whether all input data was consumed.

Errors

If the input stream was invalid, an EConvertError exception is raised.

See also

TASCII85DecoderStream.ClosedP | Check if the state is correct
TASCII85DecoderStream.Read | Read data from stream
TASCII85DecoderStream.Destroy | Clean up instance


TASCII85DecoderStream.ClosedP

Check if the state is correct

Declaration

Source position: ascii85.pp line 64

published function TASCII85DecoderStream.ClosedP: Boolean;

Function result

State is one of ascInitial, ascNoEncodedChar or ascPrefix.

Description

ClosedP checks if the decoder state is one of ascInitial, ascNoEncodedChar, ascPrefix, and returns True if it is.

See also

TASCII85DecoderStream.Close | Close decoder
TASCII85DecoderStream.BExpectBoundary | Expect ~ character


TASCII85DecoderStream.Create

Create new ASCII 85 decoder stream

Declaration

Source position: ascii85.pp line 61

published constructor TASCII85DecoderStream.Create(

  aStream: TStream

);

Arguments

aStream

Source data

Description

Create instantiates a new TASCII85DecoderStream instance, and sets aStream as the source stream.

See also

TASCII85DecoderStream.Destroy

Clean up instance


TASCII85DecoderStream.Decode

Decode source byte

Declaration

Source position: ascii85.pp line 62

published procedure TASCII85DecoderStream.Decode(

  aInput: Byte

);

Arguments

aInput

Byte to decode

Description

Decode decodes a source byte, and transfers it to the buffer. It is an internal routine and should not be used directly.

See also

TASCII85DecoderStream.Close

Close decoder


TASCII85DecoderStream.Destroy

Clean up instance

Declaration

Source position: ascii85.pp line 69

public destructor TASCII85DecoderStream.Destroy; override;

Description

Destroy closes the input stream using Close and cleans up the TASCII85DecoderStream instance from memory.

Errors

In case the input stream was invalid, an exception may occur.

See also

TASCII85DecoderStream.Close

Close decoder


TASCII85DecoderStream.GetPosition

Declaration

Source position: ascii85.pp line 67

protected function TASCII85DecoderStream.GetPosition: Int64; override;


TASCII85DecoderStream.Read

Read data from stream

Declaration

Source position: ascii85.pp line 70

public function TASCII85DecoderStream.Read(

  var aBuffer;

  aCount: LongInt

):LongInt; override;

Arguments

aBuffer | Buffer to transfer data to
aCount | Number of bytes to transfer to buffer

Function result

Actual number of bytes transferred to buffer.

Description

Read attempts to read aCount bytes from the stream and places them in aBuffer. It reads only as much data as is available. The actual number of read bytes is returned.

The read method reads as much data from the input stream as needed to get to aCount bytes, in general this will be aCount*5/4 bytes.


TASCII85DecoderStream.Seek

Set stream position

Declaration

Source position: line 0

public function TASCII85DecoderStream.Seek(

  aOffset: LongInt;

  aOrigin: Word

):LongInt; override;

function TASCII85DecoderStream.Seek(

  const aOffset: Int64;

  aOrigin: TSeekOrigin

):Int64; override; overload;

Arguments

aOffset | Offset from current position (should be zero).
aOrigin | Origin for seek operation (should be soCurrent).

Function result

new position in stream.

Arguments

aOffset | Offset from current position (should be zero).
aOrigin | Origin for seek operation (should be soCurrent).

Function result

new position in stream.

Description

Seek sets the stream position. It only allows to set the position to the current position of this file, and returns then the current position. All other arguments will result in an EReadError exception.

Errors

In case the arguments are different from soCurrent and 0, an EReadError exception will be raised.

See also

TASCII85DecoderStream.Read

Read data from stream


TASCII85EncoderStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: ascii85.pp line 76

type TASCII85EncoderStream = class(TOwnerStream)

protected

  procedure WriteBoundary;

  procedure Flush;

  procedure Encode;

public

  constructor Create();

  destructor Destroy; override;

  function Write(); override;

  property Width: Integer; [r]

  property Boundary: Boolean; [r]

end;

Inheritance

TASCII85EncoderStream
|

TOwnerStream
|

TObject


TASCII85EncoderStream
 | ro | Width
 | ro | Boundary
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | Boundary (TASCII85EncoderStream)
ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)
ro | Width (TASCII85EncoderStream)


TASCII85EncoderStream
pt | WriteBoundary
pt | Flush
pt | Encode
 | Create
 | Destroy
 | Write
TOwnerStream
 | Create
 | Destroy


 | Create (TOwnerStream)
 | Create (TASCII85EncoderStream)
 | Destroy (TOwnerStream)
 | Destroy (TASCII85EncoderStream)
pt | Encode (TASCII85EncoderStream)
pt | Flush (TASCII85EncoderStream)
 | Write (TASCII85EncoderStream)
pt | WriteBoundary (TASCII85EncoderStream)


TASCII85EncoderStream

TOwnerStream


TASCII85EncoderStream.Boundary

Declaration

Source position: ascii85.pp line 92

public property TASCII85EncoderStream.Boundary: Boolean
  read FBoundary;


TASCII85EncoderStream.Create

Declaration

Source position: ascii85.pp line 88

public constructor TASCII85EncoderStream.Create(

  ADest: TStream;

  AWidth: Integer = 72;

  ABoundary: Boolean = false

);


TASCII85EncoderStream.Destroy

Declaration

Source position: ascii85.pp line 89

public destructor TASCII85EncoderStream.Destroy; override;


TASCII85EncoderStream.Encode

Declaration

Source position: ascii85.pp line 86

protected procedure TASCII85EncoderStream.Encode;


TASCII85EncoderStream.Flush

Declaration

Source position: ascii85.pp line 85

protected procedure TASCII85EncoderStream.Flush;


TASCII85EncoderStream.Width

Declaration

Source position: ascii85.pp line 91

public property TASCII85EncoderStream.Width: Integer
  read FWidth;


TASCII85EncoderStream.Write

Declaration

Source position: ascii85.pp line 90

public function TASCII85EncoderStream.Write(

  const aBuffer;

  aCount: LongInt

):LongInt; override;


TASCII85EncoderStream.WriteBoundary

Declaration

Source position: ascii85.pp line 84

protected procedure TASCII85EncoderStream.WriteBoundary;


TASCII85RingBuffer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Internal buffer class

Declaration

Source position: ascii85.pp line 30

type TASCII85RingBuffer = class
protected
function GetBufferSize;
published
property FillCount: Cardinal; [r] | Number of bytes in buffer
property Size: Cardinal; [r] | Size of buffer
procedure Write(); | Write data to the internal buffer
function Read(); | Read data from the internal buffer
end;

Inheritance

TASCII85RingBuffer

Internal buffer class
|

TObject

Description

TASCII85RingBuffer is an internal buffer class: it maintains a memory buffer of 1Kb, for faster reading of the stream. It should not be necessary to instantiate an instance of this class, the TASCII85DecoderStream decoder stream will create an instance of this class automatically.

See also

TASCII85DecoderStream

ASCII 85 decoder stream.


TASCII85RingBuffer
pl | ro | FillCount
pl | ro | Size


pl | ro | FillCount (TASCII85RingBuffer)
pl | ro | Size (TASCII85RingBuffer)


TASCII85RingBuffer
pt | GetBufferSize
pl | Write
pl | Read


pt | GetBufferSize (TASCII85RingBuffer)
pl | Read (TASCII85RingBuffer)
pl | Write (TASCII85RingBuffer)


TASCII85RingBuffer


TASCII85RingBuffer.FillCount

Number of bytes in buffer

Declaration

Source position: ascii85.pp line 39

published property TASCII85RingBuffer.FillCount: Cardinal
  read fBufferFillCount;

Description

FillCount is the available amount of bytes in the buffer.

See also

TASCII85RingBuffer.Write | Write data to the internal buffer
TASCII85RingBuffer.Read | Read data from the internal buffer
TASCII85RingBuffer.Size | Size of buffer


TASCII85RingBuffer.GetBufferSize

Declaration

Source position: ascii85.pp line 37

protected function TASCII85RingBuffer.GetBufferSize: Cardinal;


TASCII85RingBuffer.Read

Read data from the internal buffer

Declaration

Source position: ascii85.pp line 42

published function TASCII85RingBuffer.Read(

  var aBuffer;

  aSize: Cardinal

):Cardinal;

Arguments

aBuffer | Buffer to write data to
aSize | Number of bytes to transfer

Function result

Number of actually transferred bytes

Description

Read will read aSize bytes from the internal buffer and writes them to aBuffer. If not enough bytes are available, only as much bytes as available will be written. The function returns the number of bytes transferred.

See also

TASCII85RingBuffer.FillCount | Number of bytes in buffer
TASCII85RingBuffer.Write | Write data to the internal buffer
TASCII85RingBuffer.Size | Size of buffer


TASCII85RingBuffer.Size

Size of buffer

Declaration

Source position: ascii85.pp line 40

published property TASCII85RingBuffer.Size: Cardinal
  read GetBufferSize;

Description

Size is the total size of the memory buffer. This is currently hardcoded to 1024Kb.

See also

TASCII85RingBuffer.FillCount

Number of bytes in buffer


TASCII85RingBuffer.Write

Write data to the internal buffer

Declaration

Source position: ascii85.pp line 41

published procedure TASCII85RingBuffer.Write(

  const aBuffer;

  aSize: Cardinal

);

Arguments

aBuffer | Buffer to get data from
aSize | Total amount of bytes to read from aBuffer

Description

Write writes aSize bytes from aBuffer to the internal memory buffer. Only as much bytes are written as will fit in the buffer.

See also

TASCII85RingBuffer.FillCount | Number of bytes in buffer
TASCII85RingBuffer.Read | Read data from the internal buffer
TASCII85RingBuffer.Size | Size of buffer


TAVLTree

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

AVL tree component

Declaration

Source position: avl_tree.pp line 51

type TAVLTree = class
public
Root: TAVLTreeNode; | Root node of the tree
function Find(); | Find a data item in the tree.
function FindKey(); | Find a data item in the tree using alternate compare mechanism
function FindSuccessor(); | Find successor to node
function FindPrecessor(); |
function FindLowest; | Find the lowest (leftmost) node in the tree.
function FindHighest; | Find the highest (rightmost) node in the tree.
function FindNearest(); | Find the node closest to the data in the tree
function FindPointer(); | Search for a data pointer
function FindLeftMost(); | Find the node most left to a specified data node
function FindRightMost(); | Find the node most right to a specified node
function FindLeftMostKey(); | Find the node most left to a specified key node
function FindRightMostKey(); | Find the node most right to a specified key node
function FindLeftMostSameKey(); | Find the node most left to a specified node with the same data
function FindRightMostSameKey(); | Find the node most right of a specified node with the same data
procedure Add(); | Add a new node to the tree
procedure Delete(); | Delete a node from the tree
procedure Remove(); | Remove a data item from the list.
procedure RemovePointer(); | Remove a pointer item from the list.
procedure MoveDataLeftMost(); | Move data to the nearest left element
procedure MoveDataRightMost(); | Move data to the nearest right element
property OnCompare: TListSortCompare; [rw] | Compare function used when comparing nodes
procedure Clear; | Clears the tree
procedure FreeAndClear; | Clears the tree and frees nodes
procedure FreeAndDelete(); | Delete a node from the tree and destroy it
property Count: Integer; [r] | Number of nodes in the tree.
function ConsistencyCheck; | Check the consistency of the tree
procedure WriteReportToStream(); | Write the contents of the tree consistency check to the stream
function ReportAsString; | Return the tree report as a string
procedure SetNodeManager();
procedure Create(); | Create a new instance of TAVLTree
destructor Destroy; override; | Destroy the TAVLTree instance
end;

Inheritance

TAVLTree

AVL tree component
|

TObject

Description

TAVLTree maintains a balanced AVL tree. The tree consists of TAVLTreeNode nodes, each of which has a Data pointer associated with it. The TAVLTree component offers methods to balance and search the tree.

By default, the list is searched with a simple pointer comparison algorithm, but a custom search mechanism can be specified in the OnCompare property.

See also

TAVLTreeNode

Represents a node in the tree.


TAVLTree

ro

Count


ro

Count (TAVLTree)


TAVLTree
 | Find
 | FindKey
 | FindSuccessor
 | FindPrecessor
 | FindLowest
 | FindHighest
 | FindNearest
 | FindPointer
 | FindLeftMost
 | FindRightMost
 | FindLeftMostKey
 | FindRightMostKey
 | FindLeftMostSameKey
 | FindRightMostSameKey
 | Add
 | Delete
 | Remove
 | RemovePointer
 | MoveDataLeftMost
 | MoveDataRightMost
 | Clear
 | FreeAndClear
 | FreeAndDelete
 | ConsistencyCheck
 | WriteReportToStream
 | ReportAsString
 | SetNodeManager
 | Create
 | Destroy


Add (TAVLTree)

Clear (TAVLTree)

ConsistencyCheck (TAVLTree)

Create (TAVLTree)

Delete (TAVLTree)

Destroy (TAVLTree)

Find (TAVLTree)

FindHighest (TAVLTree)

FindKey (TAVLTree)

FindLeftMost (TAVLTree)

FindLeftMostKey (TAVLTree)

FindLeftMostSameKey (TAVLTree)

FindLowest (TAVLTree)

FindNearest (TAVLTree)

FindPointer (TAVLTree)

FindPrecessor (TAVLTree)

FindRightMost (TAVLTree)

FindRightMostKey (TAVLTree)

FindRightMostSameKey (TAVLTree)

FindSuccessor (TAVLTree)

FreeAndClear (TAVLTree)

FreeAndDelete (TAVLTree)

MoveDataLeftMost (TAVLTree)

MoveDataRightMost (TAVLTree)

Remove (TAVLTree)

RemovePointer (TAVLTree)

ReportAsString (TAVLTree)

SetNodeManager (TAVLTree)

WriteReportToStream (TAVLTree)


TAVLTree

OnCompare


TAVLTree.Add

Add a new node to the tree

Declaration

Source position: line 0

public procedure TAVLTree.Add(

  ANode: TAVLTreeNode

);

function TAVLTree.Add(

  Data: Pointer

):TAVLTreeNode;

Arguments

ANode

Node to add to the tree

Arguments

Data

Data item to add to the tree

Function result

Resulting node in case a data pointer is added.

Description

Add adds a new Data or Node to the tree. It inserts the node so that the tree is maximally balanced by rebalancing the tree after the insert. In case a data pointer is added to the tree, then the node that was created is returned.

See also

TAVLTree.Delete | Delete a node from the tree
TAVLTree.Remove | Remove a data item from the list.


TAVLTree.Clear

Clears the tree

Declaration

Source position: avl_tree.pp line 87

public procedure TAVLTree.Clear;

Description

Clear deletes all nodes from the tree. The nodes themselves are not freed, and the data pointer in the nodes is also not freed.

If the node's data must be freed as well, use TAVLTree.FreeAndClear instead.

See also

TAVLTree.FreeAndClear | Clears the tree and frees nodes
TAVLTree.Delete | Delete a node from the tree


TAVLTree.ConsistencyCheck

Check the consistency of the tree

Declaration

Source position: avl_tree.pp line 91

public function TAVLTree.ConsistencyCheck: Integer;

Function result

0 if the tree is OK, a negative number if something is wrong.

Description

ConsistencyCheck checks the correctness of the tree. It returns 0 if the tree is internally consistent, and a negative number if the tree contais an error somewhere.

-1
The Count property doesn't match the actual node count
-2
A left node does not point to the correct parent
-3
A left node is larger than parent node
-4
A right node does not point to the correct parent
-5
A right node is less than parent node
-6
The balance of a node is not calculated correctly

See also

TAVLTree.WriteReportToStream

Write the contents of the tree consistency check to the stream


TAVLTree.Count

Number of nodes in the tree.

Declaration

Source position: avl_tree.pp line 90

public property TAVLTree.Count: Integer
  read FCount;

Description

Count is the number of nodes in the tree.


TAVLTree.Create

Create a new instance of TAVLTree

Declaration

Source position: line 0

public constructor TAVLTree.Create(

  OnCompareMethod: TListSortCompare

);

constructor TAVLTree.Create;

Arguments

OnCompareMethod

Alternative node comparison method

Description

Create initializes a new instance of TAVLTree. An alternate OnCompare can be provided: the default OnCompare method compares the 2 data pointers of a node.

See also

OnCompare


TAVLTree.Delete

Delete a node from the tree

Declaration

Source position: avl_tree.pp line 81

public procedure TAVLTree.Delete(

  ANode: TAVLTreeNode

);

Arguments

ANode

The node to delete from the tree.

Description

Delete removes the node from the tree. The node is not freed, but is passed to a TAVLTreeNodeMemManager instance for future reuse. The data that the node represents is also not freed.

The tree is rebalanced after the node was deleted.

See also

TAVLTree.Remove | Remove a data item from the list.
TAVLTree.RemovePointer | Remove a pointer item from the list.
TAVLTree.Clear | Clears the tree


TAVLTree.Destroy

Destroy the TAVLTree instance

Declaration

Source position: avl_tree.pp line 97

public destructor TAVLTree.Destroy; override;

Description

Destroy clears the nodes (the node data is not freed) and then destroys the TAVLTree instance.

See also

TAVLTree.Create

Create a new instance of TAVLTree

TAVLTree.Clean


TAVLTree.Find

Find a data item in the tree.

Declaration

Source position: avl_tree.pp line 62

public function TAVLTree.Find(

  Data: Pointer

):TAVLTreeNode;

Arguments

Data

Data item to search for.

Function result

Tree node corresponding to Data item.

Description

Find uses the default OnCompare comparing function to find the Data pointer in the tree. It returns the TAVLTreeNode instance that results in a successful compare with the Data pointer, or Nil if none is found.

The default OnCompare function compares the actual pointers, which means that by default Find will give the same result as FindPointer.

See also

OnCompare | Compare function used when comparing nodes
FindKey | Find a data item in the tree using alternate compare mechanism


TAVLTree.FindHighest

Find the highest (rightmost) node in the tree.

Declaration

Source position: avl_tree.pp line 68

public function TAVLTree.FindHighest: TAVLTreeNode;

Function result

The rightmost (highest) node in the tree.

Description

FindHighest returns the rightmost node in the tree, i.e. the node which is reached when descending from the rootnode via the Right subtrees.

See also

FindLowest

Find the lowest (leftmost) node in the tree.


TAVLTree.FindKey

Find a data item in the tree using alternate compare mechanism

Declaration

Source position: avl_tree.pp line 63

public function TAVLTree.FindKey(

  Key: Pointer;

  OnCompareKeyWithData: TListSortCompare

):TAVLTreeNode;

Arguments

Key | Data item to search for.
OnCompareKeyWithData | Data pointer comparison callback

Function result

Tree node corresponding to Key item.

Description

FindKey uses the specified OnCompareKeyWithData comparing function to find the Key pointer in the tree It returns the TAVLTreeNode instance that matches the Data pointer, or Nil if none is found.

See also

OnCompare | Compare function used when comparing nodes
Find | Find a data item in the tree.


TAVLTree.FindLeftMost

Find the node most left to a specified data node

Declaration

Source position: avl_tree.pp line 71

public function TAVLTree.FindLeftMost(

  Data: Pointer

):TAVLTreeNode;

Arguments

Data

The data item where to start the search from

Function result

The leftmost node relative to Data

Description

FindLeftMost finds the node most left from the Data node. It starts at the preceding node for Data and tries to move as far right in the tree as possible.

This operation corresponds to finding the previous item in a list.

See also

TAVLTree.FindRightMost | Find the node most right to a specified node
TAVLTree.FindLeftMostKey | Find the node most left to a specified key node
TAVLTree.FindRightMostKey | Find the node most right to a specified key node


TAVLTree.FindLeftMostKey

Find the node most left to a specified key node

Declaration

Source position: avl_tree.pp line 73

public function TAVLTree.FindLeftMostKey(

  Key: Pointer;

  OnCompareKeyWithData: TListSortCompare

):TAVLTreeNode;

Arguments

Key | Key identifiying the node where to start the search.
OnCompareKeyWithData | Callback to compare key value with data item

Function result

The leftmost node for Key

Description

FindLeftMostKey finds the node most left from the node associated with Key. It starts at the preceding node for Key and tries to move as far left in the tree as possible.

See also

TAVLTree.FindLeftMost | Find the node most left to a specified data node
TAVLTree.FindRightMost | Find the node most right to a specified node
TAVLTree.FindRightMostKey | Find the node most right to a specified key node


TAVLTree.FindLeftMostSameKey

Find the node most left to a specified node with the same data

Declaration

Source position: avl_tree.pp line 77

public function TAVLTree.FindLeftMostSameKey(

  ANode: TAVLTreeNode

):TAVLTreeNode;

Arguments

ANode

The node to start the search from

Function result

The treenode that was found, or nil if none found

Description

FindLefMostSameKey finds the node most left from and with the same data as the specified node ANode.

See also

TAVLTree.FindLeftMost | Find the node most left to a specified data node
TAVLTree.FindLeftMostKey | Find the node most left to a specified key node
TAVLTree.FindRightMostSameKey | Find the node most right of a specified node with the same data


TAVLTree.FindLowest

Find the lowest (leftmost) node in the tree.

Declaration

Source position: avl_tree.pp line 67

public function TAVLTree.FindLowest: TAVLTreeNode;

Function result

The leftmost (lowest) node in the tree.

Description

FindLowest returns the leftmost node in the tree, i.e. the node which is reached when descending from the rootnode via the left subtrees.

See also

FindHighest

Find the highest (rightmost) node in the tree.


TAVLTree.FindNearest

Find the node closest to the data in the tree

Declaration

Source position: avl_tree.pp line 69

public function TAVLTree.FindNearest(

  Data: Pointer

):TAVLTreeNode;

Arguments

Data

The data item to search for.

Function result

The node that is closest to Data

Description

FindNearest searches the node in the data tree that is closest to the specified Data. If Data appears in the tree, then its node is returned.

See also

FindHighest | Find the highest (rightmost) node in the tree.
FindLowest | Find the lowest (leftmost) node in the tree.
Find | Find a data item in the tree.
FindKey | Find a data item in the tree using alternate compare mechanism


TAVLTree.FindPointer

Search for a data pointer

Declaration

Source position: avl_tree.pp line 70

public function TAVLTree.FindPointer(

  Data: Pointer

):TAVLTreeNode;

Arguments

Data

The data pointer to search for.

Function result

The node that matches Data

Description

FindPointer searches for a node where the actual data pointer equals Data. This is a more fine search than find, where a custom compare function can be used.

The default OnCompare compares the data pointers, so the default Find will return the same node as FindPointer

See also

TAVLTree.Find | Find a data item in the tree.
TAVLTree.FindKey | Find a data item in the tree using alternate compare mechanism


TAVLTree.FindPrecessor

Declaration

Source position: avl_tree.pp line 66

public function TAVLTree.FindPrecessor(

  ANode: TAVLTreeNode

):TAVLTreeNode;

Arguments

ANode

The node from which to start the search

Function result

The preceding node

Description

FindPrecessor returns the successor to ANode: this is the rightmost node in the left subtree, or the rightmost node above the node ANode. This can of course be Nil.

This method is used when a node must be inserted at the leftmost position.

See also

TAVLTree.FindSuccessor | Find successor to node
TAVLTree.MoveDataLeftMost | Move data to the nearest left element


TAVLTree.FindRightMost

Find the node most right to a specified node

Declaration

Source position: avl_tree.pp line 72

public function TAVLTree.FindRightMost(

  Data: Pointer

):TAVLTreeNode;

Arguments

Data

The data item where to start the search from

Function result

The rightmost node relative to Data

Description

FindRightMost finds the node most right from the Data node. It starts at the succeding node for Data and tries to move as far left in the tree as possible.

This operation corresponds to finding the next item in a list.

See also

TAVLTree.FindLeftMost | Find the node most left to a specified data node
TAVLTree.FindLeftMostKey | Find the node most left to a specified key node
TAVLTree.FindRightMostKey | Find the node most right to a specified key node


TAVLTree.FindRightMostKey

Find the node most right to a specified key node

Declaration

Source position: avl_tree.pp line 75

public function TAVLTree.FindRightMostKey(

  Key: Pointer;

  OnCompareKeyWithData: TListSortCompare

):TAVLTreeNode;

Arguments

Key | Key identifiying the node where to start the search.
OnCompareKeyWithData | Callback to compare key value with data item

Function result

The rightmost node for Key

Description

FindRightMostKey finds the node most left from the node associated with Key. It starts at the succeding node for Key and tries to move as far right in the tree as possible.

See also

TAVLTree.FindLeftMost | Find the node most left to a specified data node
TAVLTree.FindRightMost | Find the node most right to a specified node
TAVLTree.FindLeftMostKey | Find the node most left to a specified key node


TAVLTree.FindRightMostSameKey

Find the node most right of a specified node with the same data

Declaration

Source position: avl_tree.pp line 78

public function TAVLTree.FindRightMostSameKey(

  ANode: TAVLTreeNode

):TAVLTreeNode;

Arguments

ANode

The node to start the search from

Function result

The treenode that was found, or nil if none found

Description

FindRighMostSameKey finds the node most right from and with the same data as the specified node ANode.

See also

TAVLTree.FindRightMost | Find the node most right to a specified node
TAVLTree.FindRightMostKey | Find the node most right to a specified key node
TAVLTree.FindLeftMostSameKey | Find the node most left to a specified node with the same data


TAVLTree.FindSuccessor

Find successor to node

Declaration

Source position: avl_tree.pp line 65

public function TAVLTree.FindSuccessor(

  ANode: TAVLTreeNode

):TAVLTreeNode;

Arguments

ANode

The node from which to start the search

Function result

The succeding node

Description

FindSuccessor returns the successor to ANode: this is the leftmost node in the right subtree, or the leftmost node above the node ANode. This can of course be Nil.

This method is used when a node must be inserted at the rightmost position.

See also

TAVLTree.FindPrecessor |
TAVLTree.MoveDataRightMost | Move data to the nearest right element


TAVLTree.FreeAndClear

Clears the tree and frees nodes

Declaration

Source position: avl_tree.pp line 88

public procedure TAVLTree.FreeAndClear;

Description

FreeAndClear deletes all nodes from the tree. The data pointer in the nodes is assumed to be an object, and is freed prior to deleting the node from the tree.

See also

TAVLTree.Clear | Clears the tree
TAVLTree.Delete | Delete a node from the tree
TAVLTree.FreeAndDelete | Delete a node from the tree and destroy it


TAVLTree.FreeAndDelete

Delete a node from the tree and destroy it

Declaration

Source position: avl_tree.pp line 89

public procedure TAVLTree.FreeAndDelete(

  ANode: TAVLTreeNode

);

Arguments

ANode

Node which must be deleted

Description

FreeAndDelete deletes a node from the tree, and destroys the data pointer: The data pointer in the nodes is assumed to be an object, and is freed by calling its destructor.

See also

TAVLTree.Clear | Clears the tree
TAVLTree.Delete | Delete a node from the tree
TAVLTree.FreeAndClear | Clears the tree and frees nodes


TAVLTree.MoveDataLeftMost

Move data to the nearest left element

Declaration

Source position: avl_tree.pp line 84

public procedure TAVLTree.MoveDataLeftMost(

  var ANode: TAVLTreeNode

);

Arguments

ANode

Node whose data most be moved

Description

MoveDataLeftMost moves the data from the node ANode to the nearest left location relative to Anode. It returns the new node where the data is positioned. The data from the former left node will be switched to ANode.

This operation corresponds to switching the current with the previous element in a list.

See also

TAVLTree.MoveDataRightMost

Move data to the nearest right element


TAVLTree.MoveDataRightMost

Move data to the nearest right element

Declaration

Source position: avl_tree.pp line 85

public procedure TAVLTree.MoveDataRightMost(

  var ANode: TAVLTreeNode

);

Arguments

ANode

Node whose data most be moved

Description

MoveDataRightMost moves the data from the node ANode to the rightmost location relative to Anode. It returns the new node where the data is positioned. The data from the former rightmost node will be switched to ANode.

This operation corresponds to switching the current with the next element in a list.

See also

TAVLTree.MoveDataLeftMost

Move data to the nearest left element


TAVLTree.OnCompare

Compare function used when comparing nodes

Declaration

Source position: avl_tree.pp line 86

public property TAVLTree.OnCompare: TListSortCompare
  read FOnCompare
  write SetOnCompare;

Description

OnCompare is the comparing function used when the data of 2 nodes must be compared. By default, the function simply compares the 2 data pointers. A different function can be specified on creation.

See also

TAVLTree.Create

Create a new instance of TAVLTree


TAVLTree.Remove

Remove a data item from the list.

Declaration

Source position: avl_tree.pp line 82

public procedure TAVLTree.Remove(

  Data: Pointer

);

Arguments

Data

Data item to remove from the tree.

Description

Remove finds the node associated with Data using find and, if found, deletes it from the tree. Only the first occurrence of Data will be removed.

See also

TAVLTree.Delete | Delete a node from the tree
TAVLTree.RemovePointer | Remove a pointer item from the list.
TAVLTree.Clear | Clears the tree
TAVLTree.Find | Find a data item in the tree.


TAVLTree.RemovePointer

Remove a pointer item from the list.

Declaration

Source position: avl_tree.pp line 83

public procedure TAVLTree.RemovePointer(

  Data: Pointer

);

Arguments

Data

Pointer to remove from the tree

Description

Remove uses FindPointer to find the node associated with the pointer Data and, if found, deletes it from the tree. Only the first occurrence of Data will be removed.

See also

TAVLTree.Remove | Remove a data item from the list.
TAVLTree.Delete | Delete a node from the tree
TAVLTree.Clear | Clears the tree


TAVLTree.ReportAsString

Return the tree report as a string

Declaration

Source position: avl_tree.pp line 93

public function TAVLTree.ReportAsString: String;

Function result

The tree report as a string

Description

ReportAsString calls WriteReportToStream and retuns the stream data as a string.

See also

TAVLTree.WriteReportToStream

Write the contents of the tree consistency check to the stream


TAVLTree.Root

Root node of the tree

Declaration

Source position: avl_tree.pp line 61

public TAVLTree.Root: TAVLTreeNode;

Description

Root is the root node of the tree. It should not be set explicitly, only use the Add, Delete, Remove, RemovePointer, or Clear methods to manipulate the items in the tree.

See also

TAVLTree.Add | Add a new node to the tree
TAVLTree.Delete | Delete a node from the tree
TAVLTree.Remove | Remove a data item from the list.
TAVLTree.RemovePointer | Remove a pointer item from the list.
TAVLTree.Clear | Clears the tree


TAVLTree.SetNodeManager

Declaration

Source position: avl_tree.pp line 94

public procedure TAVLTree.SetNodeManager(

  newmgr: TBaseAVLTreeNodeManager

);


TAVLTree.WriteReportToStream

Write the contents of the tree consistency check to the stream

Declaration

Source position: avl_tree.pp line 92

public procedure TAVLTree.WriteReportToStream(

  s: TStream;

  var StreamSize: Int64

);

Arguments

s | Stream to write the tree report to
StreamSize | Total number of bytes written

Description

WriteReportToStream writes a visual representation of the tree to the stream S. The total number of written bytes is returnes in StreamSize. This method is only useful for debugging purposes.

See also

TAVLTree.ConsistencyCheck

Check the consistency of the tree


TAVLTreeNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Represents a node in the tree.

Declaration

Source position: avl_tree.pp line 36

type TAVLTreeNode = class
public
Parent: TAVLTreeNode; | Reference to the parent node in the tree.
Left: TAVLTreeNode; | Reference to the left subtree of the current node.
Right: TAVLTreeNode; | Reference to the right subtree of the current node.
Balance: Integer; | Balance of the current node
Data: Pointer; | The data item associated with this node.
procedure Clear; | Clears the node's data
function TreeDepth; | Level of the node in the tree below
end;

Inheritance

TAVLTreeNode

Represents a node in the tree.
|

TObject

Description

TAVLTreeNode represents a single node in the AVL tree. It contains references to the other nodes in the tree, and provides a Data pointer which can be used to store the data, associated with the node.

See also

TAVLTree | AVL tree component
TAVLTreeNode.Data | The data item associated with this node.


TAVLTreeNode


TAVLTreeNode
 | Clear
 | TreeDepth


TAVLTreeNode.Balance

Balance of the current node

Declaration

Source position: avl_tree.pp line 39

public TAVLTreeNode.Balance: Integer;

Description

Balance is the balance of the current node, that is, the Depth of the right subtree minus the depth of the left subtree. If balance is one of -1, 0, 1 then the node is considered balanced.

See also

TreeDepth

Level of the node in the tree below


TAVLTreeNode.Clear

Clears the node's data

Declaration

Source position: avl_tree.pp line 41

public procedure TAVLTreeNode.Clear;

Description

Clear clears all pointers and references in the node. It does not free the memory pointed to by these references.


TAVLTreeNode.Data

The data item associated with this node.

Declaration

Source position: avl_tree.pp line 40

public TAVLTreeNode.Data: Pointer;

Description

Data is the data item associated with this node. It is not freed when the node is freed, the programmer is responsible for freeing the actual data.


TAVLTreeNode.Left

Reference to the left subtree of the current node.

Declaration

Source position: avl_tree.pp line 38

public TAVLTreeNode.Left: TAVLTreeNode;

Description

Left contains a reference to the first node in the left subtree of the current node. It is Nil if there is no left subtree.

See also

Parent | Reference to the parent node in the tree.
Right | Reference to the right subtree of the current node.


TAVLTreeNode.Parent

Reference to the parent node in the tree.

Declaration

Source position: avl_tree.pp line 38

public TAVLTreeNode.Parent: TAVLTreeNode;

Description

Parent contains a reference to the parent node of the current node. It is Nil for the root node.

See also

left | Reference to the left subtree of the current node.
Right | Reference to the right subtree of the current node.


TAVLTreeNode.Right

Reference to the right subtree of the current node.

Declaration

Source position: avl_tree.pp line 38

public TAVLTreeNode.Right: TAVLTreeNode;

Description

Right contains a reference to the first node in the right subtree of the current node. It is Nil if there is no right subtree.

See also

Parent | Reference to the parent node in the tree.
Left | Reference to the left subtree of the current node.


TAVLTreeNode.TreeDepth

Level of the node in the tree below

Declaration

Source position: avl_tree.pp line 42

public function TAVLTreeNode.TreeDepth: Integer;

Function result

The depth of the current node

Description

TreeDepth is the height of the node: this is the largest height of the left or right nodes, plus 1. If no nodes appear below this node (left and Right are Nil), the depth is 1.

See also

Balance

Balance of the current node


TAVLTreeNodeMemManager

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TAVLTreeNode Node memory manager

Declaration

Source position: avl_tree.pp line 100

type TAVLTreeNodeMemManager = class(TBaseAVLTreeNodeManager)
public
procedure DisposeNode(); override; | Return a node to the free list
function NewNode; override; | Create a new TAVLTreeNode instance
property MinimumFreeNode: Integer; [rw] | Minimum amount of free nodes to be kept.
property MaximumFreeNodeRatio: Integer; [rw] | Maximum amount of free nodes in the list
property Count: Integer; [r] | Number of nodes in the list.
procedure Clear; | Frees all unused nodes
constructor Create; | Create a new instance of TAVLTreeNodeMemManager
destructor Destroy; override; |
end;

Inheritance

TAVLTreeNodeMemManager

TAVLTreeNode Node memory manager
|

TBaseAVLTreeNodeManager
|

TObject

Description

TAVLTreeNodeMemManager is an internal object used by the avl_tree unit. Normally, no instance of this object should be created: An instance is created by the unit initialization code, and freed when the unit is finalized.

See also

TAVLTreeNode | Represents a node in the tree.
TAVLTree | AVL tree component


TAVLTreeNodeMemManager
 |  | MinimumFreeNode
 |  | MaximumFreeNodeRatio
 | ro | Count
TBaseAVLTreeNodeManager


ro | Count (TAVLTreeNodeMemManager)
 | MaximumFreeNodeRatio (TAVLTreeNodeMemManager)
 | MinimumFreeNode (TAVLTreeNodeMemManager)


TAVLTreeNodeMemManager
 | DisposeNode
 | NewNode
 | Clear
 | Create
 | Destroy
TBaseAVLTreeNodeManager
 | DisposeNode
 | NewNode


Clear (TAVLTreeNodeMemManager)

Create (TAVLTreeNodeMemManager)

Destroy (TAVLTreeNodeMemManager)

DisposeNode (TBaseAVLTreeNodeManager)

DisposeNode (TAVLTreeNodeMemManager)

NewNode (TBaseAVLTreeNodeManager)

NewNode (TAVLTreeNodeMemManager)


TAVLTreeNodeMemManager

TBaseAVLTreeNodeManager


TAVLTreeNodeMemManager.Clear

Frees all unused nodes

Declaration

Source position: avl_tree.pp line 117

public procedure TAVLTreeNodeMemManager.Clear;

Description

Clear removes all unused nodes from the list and frees them.

See also

TAVLTreeNodeMemManager.MinimumFreeNode | Minimum amount of free nodes to be kept.
TAVLTreeNodeMemManager.MaximumFreeNodeRatio | Maximum amount of free nodes in the list


TAVLTreeNodeMemManager.Count

Number of nodes in the list.

Declaration

Source position: avl_tree.pp line 116

public property TAVLTreeNodeMemManager.Count: Integer
  read FCount;

Description

Count is the total number of nodes in the list, used or not.

See also

TAVLTreeNodeMemManager.MinimumFreeNode | Minimum amount of free nodes to be kept.
TAVLTreeNodeMemManager.MaximumFreeNodeRatio | Maximum amount of free nodes in the list


TAVLTreeNodeMemManager.Create

Create a new instance of TAVLTreeNodeMemManager

Declaration

Source position: avl_tree.pp line 118

public constructor TAVLTreeNodeMemManager.Create;

Description

Create initializes a new instance of TAVLTreeNodeMemManager.

See also

TAVLTreeNodeMemManager.Destroy


TAVLTreeNodeMemManager.Destroy

Declaration

Source position: avl_tree.pp line 119

public destructor TAVLTreeNodeMemManager.Destroy; override;

Description

Destroy calls clear to clean up the free node list and then calls the inherited destroy.

See also

TAVLTreeNodeMemManager.Create

Create a new instance of TAVLTreeNodeMemManager


TAVLTreeNodeMemManager.DisposeNode

Return a node to the free list

Declaration

Source position: avl_tree.pp line 111

public procedure TAVLTreeNodeMemManager.DisposeNode(

  ANode: TAVLTreeNode

); override;

Arguments

ANode

Node to dispose of

Description

DisposeNode is used to put the node ANode in the list of free nodes, or optionally destroy it if the free list is full. After a call to DisposeNode, ANode must be considered invalid.

See also

TAVLTreeNodeMemManager.NewNode

Create a new TAVLTreeNode instance


TAVLTreeNodeMemManager.MaximumFreeNodeRatio

Maximum amount of free nodes in the list

Declaration

Source position: avl_tree.pp line 114

public property TAVLTreeNodeMemManager.MaximumFreeNodeRatio: Integer
  read FMaxFreeRatio
  write SetMaxFreeRatio;

Description

MaximumFreeNodeRatio is the maximum amount of free nodes that should be kept in the list: if a node is disposed of, then the ratio of the free nodes versus the total amount of nodes is checked, and if it is less than the MaximumFreeNodeRatio ratio but larger than the minimum amount of free nodes, then the node is disposed of instead of added to the free list.

See also

TAVLTreeNodeMemManager.Count | Number of nodes in the list.
TAVLTreeNodeMemManager.MinimumFreeNode | Minimum amount of free nodes to be kept.


TAVLTreeNodeMemManager.MinimumFreeNode

Minimum amount of free nodes to be kept.

Declaration

Source position: avl_tree.pp line 113

public property TAVLTreeNodeMemManager.MinimumFreeNode: Integer
  read FMinFree
  write SetMinFree;

Description

MinimumFreeNode is the minimum amount of nodes that must be kept in the free nodes list.

See also

TAVLTreeNodeMemManager.MaximumFreeNodeRatio

Maximum amount of free nodes in the list


TAVLTreeNodeMemManager.NewNode

Create a new TAVLTreeNode instance

Declaration

Source position: avl_tree.pp line 112

public function TAVLTreeNodeMemManager.NewNode: TAVLTreeNode; override;

Function result

The new node.

Description

NewNode returns a new TAVLTreeNode instance. If there is a node in the free list, itare returned. If no more free nodes are present, a new node is created.

See also

TAVLTreeNodeMemManager.DisposeNode

Return a node to the free list


TBaseAVLTreeNodeManager

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: avl_tree.pp line 45

type TBaseAVLTreeNodeManager = class

public

  procedure DisposeNode(); virtual; abstract;

  function NewNode; virtual; abstract;

end;

Inheritance

TBaseAVLTreeNodeManager
|

TObject


TBaseAVLTreeNodeManager


TBaseAVLTreeNodeManager
 | DisposeNode
 | NewNode


TBaseAVLTreeNodeManager.DisposeNode

Declaration

Source position: avl_tree.pp line 47

public procedure TBaseAVLTreeNodeManager.DisposeNode(

  ANode: TAVLTreeNode

); virtual; abstract;


TBaseAVLTreeNodeManager.NewNode

Declaration

Source position: avl_tree.pp line 48

public function TBaseAVLTreeNodeManager.NewNode: TAVLTreeNode; virtual; abstract;


EBase64DecodingException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised on errors

Declaration

Source position: base64.pp line 87

type EBase64DecodingException = class(Exception) end;

Inheritance

EBase64DecodingException

Exception raised on errors
|

Exception
|

TObject

Description

EBase64DecodeException is raised when the stream contains errors against the encoding format. Whether or not this exception is raised depends on the mode in which the stream is decoded.


EBase64DecodingException
Exception
 | HelpContext
 | Message


EBase64DecodingException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


Create (Exception)

CreateFmt (Exception)

CreateFmtHelp (Exception)

CreateHelp (Exception)

CreateRes (Exception)

CreateResFmt (Exception)

CreateResFmtHelp (Exception)

CreateResHelp (Exception)


EBase64DecodingException

Exception


TBase64DecodingStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base64 Decoding stream

Declaration

Source position: base64.pp line 62

type TBase64DecodingStream = class(TOwnerStream)
protected
CurPos: Int64;
DecodedSize: Int64;
ReadBase64ByteCount: Int64;
Buf: ;
BufPos: Integer;
FEOF: Boolean;
public
procedure Create(); | Create a new instance of the TBase64DecodingStream class
procedure Reset; | Reset the stream
function Read(); override; | Read and decrypt data from the source stream
function Seek(); override; | Set stream position.
property EOF: Boolean; [r] |
property Mode: TBase64DecodingMode; [rw] | Decoding mode
end;

Inheritance

TBase64DecodingStream

Base64 Decoding stream

|

TOwnerStream
|

TObject

Description

TBase64DecodingStream can be used to read data from a stream (the source stream) that contains Base64 encoded data. The data is read and decoded on-the-fly.

The decoding stream is read-only, and provides a limited forward-seek capability.

See also

TBase64EncodingStream

Base64 encoding stream.


TBase64DecodingStream
 | ro | EOF
 |  | Mode
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | EOF (TBase64DecodingStream)
 | Mode (TBase64DecodingStream)
ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)


TBase64DecodingStream
 | Create
 | Reset
 | Read
 | Seek
TOwnerStream
 | Create
 | Destroy


Create (TOwnerStream)

Create (TBase64DecodingStream)

Destroy (TOwnerStream)

Read (TBase64DecodingStream)

Reset (TBase64DecodingStream)

Seek (TBase64DecodingStream)


TBase64DecodingStream

TOwnerStream


TBase64DecodingStream.Buf

Declaration

Source position: base64.pp line 72

protected TBase64DecodingStream.Buf: array [0..2] of Byte;


TBase64DecodingStream.BufPos

Declaration

Source position: base64.pp line 73

protected TBase64DecodingStream.BufPos: Integer;


TBase64DecodingStream.Create

Create a new instance of the TBase64DecodingStream class

Declaration

Source position: line 0

public constructor TBase64DecodingStream.Create(

  ASource: TStream

);

constructor TBase64DecodingStream.Create(

  ASource: TStream;

  AMode: TBase64DecodingMode

);

Arguments

ASource

Source stream from which to read encoded data

Arguments

ASource | Source stream from which to read encoded data
AMode | Encoding mode to be used when encoding

Description

Create creates a new instance of the TBase64DecodingStream class. It stores the source stream ASource for reading the data from.

The optional AMode parameter determines the mode in which the decoding will be done. If omitted, bdmMIME is used.

See also

TBase64EncodingStream.Create | Create a new instance of the TBase64EncodingStream class.
TBase64DecodingMode | Decoding mode for stream


TBase64DecodingStream.CurPos

Declaration

Source position: base64.pp line 70

protected TBase64DecodingStream.CurPos: Int64;


TBase64DecodingStream.DecodedSize

Declaration

Source position: base64.pp line 70

protected TBase64DecodingStream.DecodedSize: Int64;


TBase64DecodingStream.EOF

Declaration

Source position: base64.pp line 83

public property TBase64DecodingStream.EOF: Boolean
  read fEOF;


TBase64DecodingStream.FEOF

Declaration

Source position: base64.pp line 74

protected TBase64DecodingStream.FEOF: Boolean;


TBase64DecodingStream.Mode

Decoding mode

Declaration

Source position: base64.pp line 84

public property TBase64DecodingStream.Mode: TBase64DecodingMode
  read FMode
  write SetMode;

Description

Mode is the mode in which the stream is read. It can be set when creating the stream or at any time afterwards.

See also

TBase64DecodingStream

Base64 Decoding stream


TBase64DecodingStream.Read

Read and decrypt data from the source stream

Declaration

Source position: base64.pp line 80

public function TBase64DecodingStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Buffer to store data in.
Count | Maxmimum number of bytes to store in buffer.

Function result

Number of bytes stored in buffer.

Description

Read reads encrypted data from the source stream and stores this data in Buffer. At most Count bytes will be stored in the buffer, but more bytes will be read from the source stream: the encoding algorithm multiplies the number of bytes.

The function returns the number of bytes stored in the buffer.

Errors

If an error occurs during the read from the source stream, an exception may occur.

See also

TBase64DecodingStream.Write | Write data to the stream
TBase64DecodingStream.Seek | Set stream position.
TStream.Read


TBase64DecodingStream.ReadBase64ByteCount

Declaration

Source position: base64.pp line 71

protected TBase64DecodingStream.ReadBase64ByteCount: Int64;


TBase64DecodingStream.Reset

Reset the stream

Declaration

Source position: base64.pp line 78

public procedure TBase64DecodingStream.Reset;

Description

Reset resets the data as if it was again on the start of the decoding stream.

Errors

None.

See also

TBase64DecodingStream.EOF |
TBase64DecodingStream.Read | Read and decrypt data from the source stream


TBase64DecodingStream.Seek

Set stream position.

Declaration

Source position: base64.pp line 81

public function TBase64DecodingStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset, relative to origin.
Origin | Origin of the seek operation.

Function result

New absolute position in the stream.

Description

Seek sets the position of the stream. In the TBase64DecodingStream class, the seek operation is forward only, it does not support backward seeks. The forward seek is emulated by reading and discarding data till the desired position is reached.

For an explanation of the parameters, see TStream.Seek

Errors

In case of an unsupported operation, an EStreamError exception is raised.

See also

TBase64DecodingStream.Read | Read and decrypt data from the source stream
TBase64DecodingStream.Write | Write data to the stream
TBase64EncodingStream.Seek | Position the stream
TStream.Seek


TBase64EncodingStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base64 encoding stream.

Declaration

Source position: base64.pp line 33

type TBase64EncodingStream = class(TOwnerStream)
protected
TotalBytesProcessed: LongWord;
BytesWritten: LongWord;
Buf: ;
BufSize: Integer;
public
constructor Create(); | Create a new instance of the TBase64EncodingStream class.
destructor Destroy; override; | Remove a TBase64EncodingStream instannce from memory
function Write(); override; | Write data to the stream.
function Seek(); override; | Position the stream
end;

Inheritance

TBase64EncodingStream

Base64 encoding stream.
|

TOwnerStream
|

TObject

Description

TBase64EncodingStream can be used to encode data using the base64 algorithm. At creation time, a destination stream is specified. Any data written to the TBase64EncodingStream instance will be base64 encoded, and subsequently written to the destination stream.

The TBase64EncodingStream stream is a write-only stream. Obviously it is also not seekable. It is meant to be included in a chain of streams.

See also

TBase64DecodingStream

Base64 Decoding stream


TBase64EncodingStream
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)


TBase64EncodingStream
 | Create
 | Destroy
 | Write
 | Seek
TOwnerStream
 | Create
 | Destroy


Create (TOwnerStream)

Create (TBase64EncodingStream)

Destroy (TOwnerStream)

Destroy (TBase64EncodingStream)

Seek (TBase64EncodingStream)

Write (TBase64EncodingStream)


TBase64EncodingStream

TOwnerStream


TBase64EncodingStream.Buf

Declaration

Source position: base64.pp line 36

protected TBase64EncodingStream.Buf: array [0..2] of Byte;


TBase64EncodingStream.BufSize

Declaration

Source position: base64.pp line 37

protected TBase64EncodingStream.BufSize: Integer;


TBase64EncodingStream.BytesWritten

Declaration

Source position: base64.pp line 35

protected TBase64EncodingStream.BytesWritten: LongWord;


TBase64EncodingStream.Create

Create a new instance of the TBase64EncodingStream class.

Declaration

Source position: base64.pp line 39

public constructor TBase64EncodingStream.Create(

  ASource: TStream

);

Arguments

ASource

Destination stream for encoded data

Description

Create instantiates a new TBase64EncodingStream class. The ASource stream is stored and used to write the encoded data to.

See also

TBase64EncodingStream.Destroy | Remove a TBase64EncodingStream instannce from memory
TBase64DecodingStream.Create | Create a new instance of the TBase64DecodingStream class


TBase64EncodingStream.Destroy

Remove a TBase64EncodingStream instannce from memory

Declaration

Source position: base64.pp line 40

public destructor TBase64EncodingStream.Destroy; override;

Description

Destroy flushes any remaining output and then removes the TBase64EncodingStream instance from memory by calling the inherited destructor.

Errors

An exception may be raised if the destination stream no longer exists or is closed.

See also

TBase64EncodingStream.Create

Create a new instance of the TBase64EncodingStream class.


TBase64EncodingStream.Seek

Position the stream

Declaration

Source position: base64.pp line 43

public function TBase64EncodingStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset from origin
Origin | Origin for the seek operation.

Function result

New position in the stream

Description

Seek always raises an EStreamError exception unless the arguments it received it don't change the current file pointer position. The encryption stream is not seekable.

Errors

An EStreamError error is raised.

See also

TBase64EncodingStream.Read | Read data from the stream
TBase64EncodingStream.Write | Write data to the stream.
TStream.Seek


TBase64EncodingStream.TotalBytesProcessed

Declaration

Source position: base64.pp line 35

protected TBase64EncodingStream.TotalBytesProcessed: LongWord;


TBase64EncodingStream.Write

Write data to the stream.

Declaration

Source position: base64.pp line 42

public function TBase64EncodingStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Buffer with data to write
Count | Number of bytes from buffer to write

Function result

Number of bytes from buffer actually used

Description

Write encodes Count bytes from Buffer using the Base64 mechanism, and then writes the encoded data to the destination stream. It returns the number of bytes from Buffer that were actually written. Note that this is not the number of bytes written to the destination stream: the base64 mechanism writes more bytes to the destination stream.

Errors

If there is an error writing to the destination stream, an error may occur.

See also

TBase64EncodingStream.Seek | Position the stream
TBase64EncodingStream.Read | Read data from the stream
TBase64DecodingStream.Write | Write data to the stream
TStream.Write


EBlowFishError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception used to report errors.

Declaration

Source position: blowfish.pp line 48

type EBlowFishError = class(EStreamError) end;

Inheritance

EBlowFishError

Exception used to report errors.
|

EStreamError
|

TObject

Description

EBlowFishError is used by the TBlowFishStream, TBlowFishEncryptStream and TBlowFishDecryptStream classes to report errors.

See also

TBlowFishStream | Parent class for blowfish encryption/decryption streams
TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
TBlowFishDecryptStream | On-the-fly Blowfish decryption stream


EBlowFishError

EStreamError


TBlowFish

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class implementing blowfish encryption/decription

Declaration

Source position: blowfish.pp line 36

type TBlowFish = class(TObject)
public
constructor Create(); | Create a new instance of the TBlowFish class
procedure Encrypt(); | Encrypt a block
procedure Decrypt(); | Decrypt a block
end;

Inheritance

TBlowFish

Class implementing blowfish encryption/decription
|

TObject

Description

TBlowFish is a simple class that can be used to encrypt/decrypt a single TBFBlock data block with the Encrypt and Decrypt calls. It is used internally by the TBlowFishEnCryptStream and TBlowFishDeCryptStream classes to encrypt or decrypt the actual data.

See also

TBlowFishEnCryptStream | On-the-fly Blowfish encryption stream
TBlowFishDeCryptStream | On-the-fly Blowfish decryption stream


TBlowFish


TBlowFish
 | Create
 | Encrypt
 | Decrypt


TBlowFish.Create

Create a new instance of the TBlowFish class

Declaration

Source position: blowfish.pp line 42

public constructor TBlowFish.Create(

  Key: TBlowFishKey;

  KeySize: Integer

);

Arguments

Key | Encryption key
KeySize | Actual size of encryption key

Description

Create initializes a new instance of the TBlowFish class: it stores the key Key in the internal data structures so it can be used in later calls to Encrypt and Decrypt.

See also

Encrypt | Encrypt a block
Decrypt | Decrypt a block


TBlowFish.Decrypt

Decrypt a block

Declaration

Source position: blowfish.pp line 44

public procedure TBlowFish.Decrypt(

  var Block: TBFBlock

);

Arguments

Block

Encrypted data to decrypt

Description

ncrypt decrypts the data in Block (always 8 bytes) using the key specified when the TBlowFish instance was created. The data must have been encrypted with the same key and the Encrypt call.

See also

TBlowFishKey | Array to hold blowfish encryption keys
Encrypt | Encrypt a block
Create | Create a new instance of the TBlowFish class


TBlowFish.Encrypt

Encrypt a block

Declaration

Source position: blowfish.pp line 43

public procedure TBlowFish.Encrypt(

  var Block: TBFBlock

);

Arguments

Block

Data to encrypt

Description

Encrypt encrypts the data in Block (always 8 bytes) using the key specified when the TBlowFish instance was created.

See also

TBlowFishKey | Array to hold blowfish encryption keys
Decrypt | Decrypt a block
Create | Create a new instance of the TBlowFish class


TBlowFishDeCryptStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

On-the-fly Blowfish decryption stream

Declaration

Source position: blowfish.pp line 73

type TBlowFishDeCryptStream = class(TBlowFishStream)
public
function Read(); override; | Read data from the stream
function Seek(); override; | Set the stream position.
end;

Inheritance

TBlowFishDeCryptStream | On-the-fly Blowfish decryption stream
|
TBlowFishStream | Parent class for blowfish encryption/decryption streams
|
TOwnerStream
|
TObject

Description

The TBlowFishDecryptStream provides On-the-fly Blowfish decryption: all data that is read from the source stream is decrypted before it is placed in the output buffer. The source stream must be specified when the TBlowFishDecryptStream instance is created. The Decryption key must also be created when the stream instance is created, and must be the same key as the one used when encrypting the data.

This is a read-only stream: it is seekable only in a forward direction, and data can only be read from it, writing is not possible. For writing data so it is encrypted, the TBlowFishEncryptStream stream must be used.

See also

Create | Create a new instance of the TBlowFishStream class
TBlowFishEncryptStream | On-the-fly Blowfish encryption stream


TBlowFishDeCryptStream
TBlowFishStream
 | ro | BlowFish
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | BlowFish (TBlowFishStream)
ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)


TBlowFishDeCryptStream
 | Read
 | Seek
TBlowFishStream
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


Create (TOwnerStream)

Create (TBlowFishStream)

Destroy (TOwnerStream)

Destroy (TBlowFishStream)

Read (TBlowFishDeCryptStream)

Seek (TBlowFishDeCryptStream)


TBlowFishDeCryptStream

TBlowFishStream

TOwnerStream


TBlowFishDeCryptStream.Read

Read data from the stream

Declaration

Source position: blowfish.pp line 75

public function TBlowFishDeCryptStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer in which to place data
Count | Number of bytes to read from the stream

Function result

Actual number of bytes read

Description

Read reads Count bytes from the source stream, decrypts them using the key provided when the TBlowFishDeCryptStream instance was created, and writes the decrypted data to Buffer

See also

Create | Create a new instance of the TBlowFishStream class
TBlowFishEncryptStream | On-the-fly Blowfish encryption stream


TBlowFishDeCryptStream.Seek

Set the stream position.

Declaration

Source position: blowfish.pp line 76

public function TBlowFishDeCryptStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset. Only zero or positive values allowed.
Origin | Origin. Only soFromCurrent allowed.

Function result

New position in the stream

Description

Seek emulates a forward seek by reading and discarding data. The discarded data is lost. Since it is a forward seek, this means that only soFromCurrent can be specified for Origin with a positive (or zero) Offset value. All other values will result in an exception. The function returns the new position in the stream.

Errors

If any other combination of Offset and Origin than the allowed combination is specified, then an EBlowFishError exception will be raised.

See also

Read | Read data from the stream
EBlowFishError | Exception used to report errors.


TBlowFishEncryptStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

On-the-fly Blowfish encryption stream

Declaration

Source position: blowfish.pp line 65

type TBlowFishEncryptStream = class(TBlowFishStream)
public
destructor Destroy; override; | Free the TBlowFishEncryptStream
function Write(); override; | Write data to the stream
function Seek(); override; | Set the position in the stream
procedure Flush; | Flush the encryption buffer
end;

Inheritance

TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
|
TBlowFishStream | Parent class for blowfish encryption/decryption streams
|
TOwnerStream
|
TObject

Description

The TBlowFishEncryptStream provides On-the-fly Blowfish encryption: all data that is written to it is encrypted and then written to a destination stream, which must be specified when the TBlowFishEncryptStream instance is created. The encryption key must also be created when the stream instance is created.

This is a write-only stream: it is not seekable, and data can only be written to it, reading is not possible. For reading encrypted data, the TBlowFishDecryptStream stream must be used.

See also

Create | Create a new instance of the TBlowFishStream class
TBlowFishDecryptStream | On-the-fly Blowfish decryption stream


TBlowFishEncryptStream
TBlowFishStream
 | ro | BlowFish
TOwnerStream
 | ro | Source
 |  | SourceOwner


TBlowFishEncryptStream
 | Destroy
 | Write
 | Seek
 | Flush
TBlowFishStream
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


Create (TOwnerStream)

Create (TBlowFishStream)

Destroy (TOwnerStream)

Destroy (TBlowFishStream)

Destroy (TBlowFishEncryptStream)

Flush (TBlowFishEncryptStream)

Seek (TBlowFishEncryptStream)

Write (TBlowFishEncryptStream)


TBlowFishEncryptStream

TBlowFishStream

TOwnerStream


TBlowFishEncryptStream.Destroy

Free the TBlowFishEncryptStream

Declaration

Source position: blowfish.pp line 67

public destructor TBlowFishEncryptStream.Destroy; override;

Description

Destroy flushes the encryption buffer, and writes it to the destination stream. After that the Inherited destructor is called to clean up the TBlowFishEncryptStream instance.

See also

Flush | Flush the encryption buffer
Create | Create a new instance of the TBlowFishStream class


TBlowFishEncryptStream.Flush

Flush the encryption buffer

Declaration

Source position: blowfish.pp line 70

public procedure TBlowFishEncryptStream.Flush;

Description

Flush writes the remaining data in the encryption buffer to the destination stream.

For efficiency, data is always written 4 bytes at a time, since this is the amount of bytes required by the Blowfish algorithm. If no multiple of 4 was written to the destination stream, the Flush mechanism can be used to write the remaining bytes.

Flush is called automatically when the stream is destroyed, so there is no need to call it after all data was written and the stream is no longer needed.

See also

Write | Write data to the stream
TBFBlock | Internal blowfish data structure


TBlowFishEncryptStream.Seek

Set the position in the stream

Declaration

Source position: blowfish.pp line 69

public function TBlowFishEncryptStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset from origin
Origin | Origin for seek operation

Function result

New position in the stream

Description

Read will raise an EBlowFishError exception: TBlowFishEncryptStream is a write-only stream, and cannot be positioned.

Errors

Calling this function always results in an EBlowFishError exception.

See also

TBlowFishEncryptStream.Write

Write data to the stream


TBlowFishEncryptStream.Write

Write data to the stream

Declaration

Source position: blowfish.pp line 68

public function TBlowFishEncryptStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Buffer containing data to be written.
Count | Number of bytes to write.

Function result

Actual number of bytes written

Description

Write will encrypt and write Count bytes from Buffer to the destination stream. The function returns the actual number of bytes written. The data is not encrypted in-place, but placed in a special buffer for encryption.

Data is always written 4 bytes at a time, since this is the amount of bytes required by the Blowfish algorithm. If no multiple of 4 was written to the destination stream, the Flush mechanism can be used to write the remaining bytes.

See also

TBlowFishEncryptStream.Read

Read data from the stream


TBlowFishStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Parent class for blowfish encryption/decryption streams

Declaration

Source position: blowfish.pp line 52

type TBlowFishStream = class(TOwnerStream)
public
procedure Create(); | Create a new instance of the TBlowFishStream class
destructor Destroy; override; | Destroy the TBlowFishStream instance.
property BlowFish: TBlowFish; [r] | Blowfish instance used when encrypting/descrypting
end;

Inheritance

TBlowFishStream

Parent class for blowfish encryption/decryption streams
|

TOwnerStream
|

TObject

Description

TBlowFishStream is an abstract class which is used as a parent class for TBlowFishEncryptStream and TBlowFishDecryptStream. It simply provides a constructor and storage for a TBlowFish instance and for the source or destination stream.

Do not create an instance of TBlowFishStream directly. Instead create one of the descendent classes TBlowFishEncryptStream or TBlowFishDecryptStream.

See also

TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
TBlowFishDecryptStream | On-the-fly Blowfish decryption stream
TBlowFish | Class implementing blowfish encryption/decription


TBlowFishStream
 | ro | BlowFish
TOwnerStream
 | ro | Source
 |  | SourceOwner


TBlowFishStream
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


Create (TOwnerStream)

Create (TBlowFishStream)

Destroy (TOwnerStream)

Destroy (TBlowFishStream)


TBlowFishStream

TOwnerStream


TBlowFishStream.BlowFish

Blowfish instance used when encrypting/descrypting

Declaration

Source position: blowfish.pp line 62

public property TBlowFishStream.BlowFish: TBlowFish
  read FBF;

Description

BlowFish is the TBlowFish instance which is created when the TBlowFishStream class is initialized. Normally it should not be used directly, it's intended for access by the descencent classes TBlowFishEncryptStream and TBlowFishDecryptStream.

See also

TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
TBlowFishDecryptStream | On-the-fly Blowfish decryption stream
TBlowFish | Class implementing blowfish encryption/decription


TBlowFishStream.Create

Create a new instance of the TBlowFishStream class

Declaration

Source position: line 0

public constructor TBlowFishStream.Create(

  AKey: TBlowFishKey;

  AKeySize: Byte;

  Dest: TStream

);

constructor TBlowFishStream.Create(

  const KeyPhrase: String;

  Dest: TStream

);

Arguments

AKey | Encryption/Decryption key
AKeySize | Actual key size.
Dest | Destination stream

Arguments

KeyPhrase | String to compute key from
Dest | Destination stream

Description

Create initializes a new instance of TBlowFishStream, and creates an internal instance of TBlowFish using AKey and AKeySize. The Dest stream is stored so the descendent classes can refer to it.

Do not create an instance of TBlowFishStream directly. Instead create one of the descendent classes TBlowFishEncryptStream or TBlowFishDecryptStream.

The overloaded version with the KeyPhrase string argument is used for easy access: it computes the blowfish key from the given string.

See also

TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
TBlowFishDecryptStream | On-the-fly Blowfish decryption stream
TBlowFish | Class implementing blowfish encryption/decription


TBlowFishStream.Destroy

Destroy the TBlowFishStream instance.

Declaration

Source position: blowfish.pp line 61

public destructor TBlowFishStream.Destroy; override;

Description

Destroy cleans up the internal TBlowFish instance.

See also

Create | Create a new instance of the TBlowFishStream class
TBlowFish | Class implementing blowfish encryption/decription


TBufStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Common ancestor for buffered streams

Declaration

Source position: bufstream.pp line 32

type TBufStream = class(TOwnerStream)
protected
procedure BufferError();
procedure FillBuffer; virtual;
procedure FlushBuffer; virtual;
public
procedure Create(); | Create a new TBufStream instance.
destructor Destroy; override; | Destroys the TBufStream instance
property Buffer: Pointer; [r] | The current buffer
property Capacity: Integer; [rw] | Current buffer capacity
property BufferPos: Integer; [r] | Current buffer position.
property BufferSize: Integer; [r] | Amount of data in the buffer
end;

Inheritance

TBufStream

Common ancestor for buffered streams
|

TOwnerStream
|

TObject

Description

TBufStream is the common ancestor for the TReadBufStream and TWriteBufStream streams. It completely handles the buffer memory management and position management. An instance of TBufStream should never be created directly. It also keeps the instance of the source stream.

See also

TReadBufStream | Read-only buffered stream.
TWriteBufStream | Write-only buffered stream.


TBufStream
 | ro | Buffer
 |  | Capacity
 | ro | BufferPos
 | ro | BufferSize
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | Buffer (TBufStream)
ro | BufferPos (TBufStream)
ro | BufferSize (TBufStream)
 | Capacity (TBufStream)
ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)


TBufStream
pt | BufferError
pt | FillBuffer
pt | FlushBuffer
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


pt | BufferError (TBufStream)
 | Create (TOwnerStream)
 | Create (TBufStream)
 | Destroy (TOwnerStream)
 | Destroy (TBufStream)
pt | FillBuffer (TBufStream)
pt | FlushBuffer (TBufStream)


TBufStream

TOwnerStream


TBufStream.Buffer

The current buffer

Declaration

Source position: bufstream.pp line 48

public property TBufStream.Buffer: Pointer
  read Fbuffer;

Description

Buffer is a pointer to the actual buffer in use.

See also

TBufStream.Create | Create a new TBufStream instance.
TBufStream.Capacity | Current buffer capacity
TBufStream.BufferSize | Amount of data in the buffer


TBufStream.BufferError

Declaration

Source position: bufstream.pp line 41

protected procedure TBufStream.BufferError(

  const Msg: String

);


TBufStream.BufferPos

Current buffer position.

Declaration

Source position: bufstream.pp line 50

public property TBufStream.BufferPos: Integer
  read FBufPos;

Description

BufPos is the current stream position in the buffer. Depending on whether the stream is used for reading or writing, data will be read from this position, or will be written at this position in the buffer.

See also

TBufStream.Create | Create a new TBufStream instance.
TBufStream.Buffer | The current buffer
TBufStream.BufferSize | Amount of data in the buffer
TBufStream.Capacity | Current buffer capacity


TBufStream.BufferSize

Amount of data in the buffer

Declaration

Source position: bufstream.pp line 51

public property TBufStream.BufferSize: Integer
  read FBufSize;

Description

BufferSize is the actual amount of data in the buffer. This is always less than or equal to the Capacity.

See also

TBufStream.Create | Create a new TBufStream instance.
TBufStream.Buffer | The current buffer
TBufStream.BufferPos | Current buffer position.
TBufStream.Capacity | Current buffer capacity


TBufStream.Capacity

Current buffer capacity

Declaration

Source position: bufstream.pp line 49

public property TBufStream.Capacity: Integer
  read FCapacity
  write SetCapacity;

Description

Capacity is the amount of memory the buffer occupies. To change the buffer size, the capacity can be set. Note that the capacity cannot be set to a value that is less than the current buffer size, i.e. the current amount of data in the buffer.

See also

TBufStream.Create | Create a new TBufStream instance.
TBufStream.Buffer | The current buffer
TBufStream.BufferSize | Amount of data in the buffer
TBufStream.BufferPos | Current buffer position.


TBufStream.Create

Create a new TBufStream instance.

Declaration

Source position: line 0

public constructor TBufStream.Create(

  ASource: TStream;

  ACapacity: Integer

);

constructor TBufStream.Create(

  ASource: TStream

);

Arguments

ASource | Source stream to buffer data from
ACapacity | Buffer capacity

Arguments

ASource

Source stream to buffer data from

Description

Create creates a new TBufStream instance. A buffer of size ACapacity is allocated, and the ASource source (or destination) stream is stored. If no capacity is specified, then DefaultBufferCapacity is used as the capacity.

An instance of TBufStream should never be instantiated directly. Instead, an instance of TReadBufStream or TWriteBufStream should be created.

Errors

If not enough memory is available for the buffer, then an exception may be raised.

See also

TBufStream.Destroy | Destroys the TBufStream instance
TReadBufStream | Read-only buffered stream.
TWriteBufStream | Write-only buffered stream.


TBufStream.Destroy

Destroys the TBufStream instance

Declaration

Source position: bufstream.pp line 47

public destructor TBufStream.Destroy; override;

Description

Destroy destroys the instance of TBufStream. It flushes the buffer, deallocates it, and then destroys the TBufStream instance.

See also

TBufStream.Create | Create a new TBufStream instance.
TReadBufStream | Read-only buffered stream.
TWriteBufStream | Write-only buffered stream.


TBufStream.FillBuffer

Declaration

Source position: bufstream.pp line 42

protected procedure TBufStream.FillBuffer; virtual;


TBufStream.FlushBuffer

Declaration

Source position: bufstream.pp line 43

protected procedure TBufStream.FlushBuffer; virtual;


TReadBufStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Read-only buffered stream.

Declaration

Source position: bufstream.pp line 56

type TReadBufStream = class(TBufStream)
public
function Seek(); override; | Set location in the buffer
function Read(); override; | Reads data from the stream
end;

Inheritance

TReadBufStream | Read-only buffered stream.
|
TBufStream | Common ancestor for buffered streams
|
TOwnerStream
|
TObject

Description

TReadBufStream is a read-only buffered stream. It implements the needed methods to read data from the buffer and fill the buffer with additional data when needed.

The stream provides limited forward-seek possibilities.

See also

TBufStream | Common ancestor for buffered streams
TWriteBufStream | Write-only buffered stream.


TReadBufStream
TBufStream
 | ro | Buffer
 |  | Capacity
 | ro | BufferPos
 | ro | BufferSize
TOwnerStream
 | ro | Source
 |  | SourceOwner


TReadBufStream
 | Seek
 | Read
TBufStream
pt | BufferError
pt | FillBuffer
pt | FlushBuffer
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


pt | BufferError (TBufStream)
 | Create (TOwnerStream)
 | Create (TBufStream)
 | Destroy (TOwnerStream)
 | Destroy (TBufStream)
pt | FillBuffer (TBufStream)
pt | FlushBuffer (TBufStream)
 | Read (TReadBufStream)
 | Seek (TReadBufStream)


TReadBufStream

TBufStream

TOwnerStream


TReadBufStream.Read

Reads data from the stream

Declaration

Source position: bufstream.pp line 59

public function TReadBufStream.Read(

  var ABuffer;

  ACount: LongInt

):Integer; override;

Arguments

ABuffer | Buffer to place read data in
ACount | Number of bytes to read

Function result

Number of bytes read

Description

Read reads at most ACount bytes from the stream and places them in Buffer. The number of actually read bytes is returned.

TReadBufStream first reads whatever data is still available in the buffer, and then refills the buffer, after which it continues to read data from the buffer. This is repeated untill ACount bytes are read, or no more data is available.

See also

TReadBufStream.Seek | Set location in the buffer
TReadBufStream.Read | Reads data from the stream


TReadBufStream.Seek

Set location in the buffer

Declaration

Source position: bufstream.pp line 58

public function TReadBufStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset (in bytes) of origin
Origin | Origin of seek operation

Function result

New position

Description

Seek sets the location in the buffer. Currently, only a forward seek is allowed. It is emulated by reading and discarding data. For an explanation of the parameters, see TStream.Seek"

The seek method needs enhancement to enable it to do a full-featured seek. This may be implemented in a future release of Free Pascal.

Errors

In case an illegal seek operation is attempted, an exception is raised.

See also

TWriteBufStream.Seek | Set stream position.
TReadBufStream.Read | Reads data from the stream
TReadBufStream.Write | Writes data to the stream


TWriteBufStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Write-only buffered stream.

Declaration

Source position: bufstream.pp line 64

type TWriteBufStream = class(TBufStream)
public
destructor Destroy; override; | Remove the TWriteBufStream instance from memory
function Seek(); override; | Set stream position.
function Write(); override; | Write data to the stream
end;

Inheritance

TWriteBufStream | Write-only buffered stream.
|
TBufStream | Common ancestor for buffered streams
|
TOwnerStream
|
TObject

Description

TWriteBufStream is a write-only buffered stream. It implements the needed methods to write data to the buffer and flush the buffer (i.e., write its contents to the source stream) when needed.

See also

TBufStream | Common ancestor for buffered streams
TReadBufStream | Read-only buffered stream.


TWriteBufStream
TBufStream
 | ro | Buffer
 |  | Capacity
 | ro | BufferPos
 | ro | BufferSize
TOwnerStream
 | ro | Source
 |  | SourceOwner


TWriteBufStream
 | Destroy
 | Seek
 | Write
TBufStream
pt | BufferError
pt | FillBuffer
pt | FlushBuffer
 | Create
 | Destroy
TOwnerStream
 | Create
 | Destroy


pt | BufferError (TBufStream)
 | Create (TOwnerStream)
 | Create (TBufStream)
 | Destroy (TOwnerStream)
 | Destroy (TBufStream)
 | Destroy (TWriteBufStream)
pt | FillBuffer (TBufStream)
pt | FlushBuffer (TBufStream)
 | Seek (TWriteBufStream)
 | Write (TWriteBufStream)


TWriteBufStream

TBufStream

TOwnerStream


TWriteBufStream.Destroy

Remove the TWriteBufStream instance from memory

Declaration

Source position: bufstream.pp line 66

public destructor TWriteBufStream.Destroy; override;

Description

Destroy flushes the buffer and then calls the inherited Destroy.

Errors

If an error occurs during flushing of the buffer, an exception may be raised.

See also

Create | Create a new TBufStream instance.
TBufStream.Destroy | Destroys the TBufStream instance


TWriteBufStream.Seek

Set stream position.

Declaration

Source position: bufstream.pp line 67

public function TWriteBufStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset (in bytes) of origin
Origin | Origin of seek operation

Function result

New position

Description

Seek always raises an EStreamError exception, except when the seek operation would not alter the current position.

A later implementation may perform a proper seek operation by flushing the buffer and doing a seek on the source stream.

See also

TWriteBufStream.Write | Write data to the stream
TWriteBufStream.Read | Read data from the stream
TReadBufStream.Seek | Set location in the buffer


TWriteBufStream.Write

Write data to the stream

Declaration

Source position: bufstream.pp line 68

public function TWriteBufStream.Write(

  const ABuffer;

  ACount: LongInt

):Integer; override;

Arguments

ABuffer | Buffer containing data to write
ACount | Number of bytes to write to stream

Function result

Number of bytes written

Description

Write writes at most ACount bytes from ABuffer to the stream. The data is written to the internal buffer first. As soon as the internal buffer is full, it is flushed to the destination stream, and the internal buffer is filled again. This process continues till all data is written (or an error occurs).

Errors

An exception may occur if the destination stream has problems writing.

See also

TWriteBufStream.Seek | Set stream position.
TWriteBufStream.Read | Read data from the stream
TReadBufStream.Write | Writes data to the stream


ECacheError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception class used in the cachecls unit.

Declaration

Source position: cachecls.pp line 32

type ECacheError = class(Exception) end;

Inheritance

ECacheError

Exception class used in the cachecls unit.
|

Exception
|

TObject


ECacheError
Exception
 | HelpContext
 | Message


ECacheError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


ECacheError

Exception


TCache

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Cache class

Declaration

Source position: cachecls.pp line 63

type TCache = class
protected
FSlotCount: Integer;
FSlots: PCacheSlotArray;
FMRUSlot: PCacheSlot;
FLRUSlot: PCacheSlot;
public
constructor Create(); | Create a new cache class.
destructor Destroy; override; | Free the TCache class from memory
function Add(); | Add a data element to the list.
function AddNew(); | Add a new item to the list.
function FindSlot(); | Find data pointer in the list
function IndexOf(); | Return index of a data pointer in the list.
procedure Remove(); | Remove a data item from the list.
property Data: Pointer; [rw] | Indexed access to data items
property MRUSlot: PCacheSlot; [rw] | Most recent item slot.
property LRUSlot: PCacheSlot; [r] | Last used item
property SlotCount: Integer; [rw] | Number of slots in the list
property Slots: PCacheSlot; [r] | Indexed array to the slots
property OnIsDataEqual: TOnIsDataEqual; [rw] | Event to compare 2 items.
property OnFreeSlot: TOnFreeSlot; [rw] | Event called when a slot is freed
end;

Inheritance

TCache

Cache class
|

TObject

Description

TCache implements a cache class: it is a list-like class, but which uses a counting mechanism, and keeps a Most-Recent-Used list; this list represents the 'cache'. The list is internally kept as a doubly-linked list.

The Data property offers indexed access to the array of items. When accessing the array through this property, the MRUSlot property is updated.


TCache
 |  | Data
 |  | MRUSlot
 | ro | LRUSlot
 |  | SlotCount
 | ro | Slots


ro | LRUSlot (TCache)
 | MRUSlot (TCache)
 | SlotCount (TCache)
ro | Slots (TCache)


TCache
 | Create
 | Destroy
 | Add
 | AddNew
 | FindSlot
 | IndexOf
 | Remove


Add (TCache)

AddNew (TCache)

Create (TCache)

Destroy (TCache)

FindSlot (TCache)

IndexOf (TCache)

Remove (TCache)


TCache
 | OnIsDataEqual
 | OnFreeSlot


TCache.Add

Add a data element to the list.

Declaration

Source position: cachecls.pp line 81

public function TCache.Add(

  AData: Pointer

):Integer;

Arguments

AData

Data pointer to add to the cache.

Function result

Index at which item was added.

Description

Add checks whether AData is already in the list. If so, the item is added to the top of the MRU list. If the item is not yet in the list, then the item is added to the list and placed at the top of the MRU list using the AddNew call.

The function returns the index at which the item was added.

If the maximum number of slots is reached, and a new item is being added, the least used item is dropped from the list.

See also

TCache.AddNew | Add a new item to the list.
TCache.FindSlot | Find data pointer in the list
TCache.IndexOf | Return index of a data pointer in the list.
TCache.Data | Indexed access to data items
TCache.MRUSlot | Most recent item slot.


TCache.AddNew

Add a new item to the list.

Declaration

Source position: cachecls.pp line 82

public function TCache.AddNew(

  AData: Pointer

):Integer;

Arguments

AData

Data pointer to add to the list

Function result

Position at which item is added to the list

Description

AddNew adds a new item to the list: in difference with the Add call, no checking is performed to see whether the item is already in the list.

The function returns the index at which the item was added.

If the maximum number of slots is reached, and a new item is being added, the least used item is dropped from the list.

See also

TCache.Add | Add a data element to the list.
TCache.FindSlot | Find data pointer in the list
TCache.IndexOf | Return index of a data pointer in the list.
TCache.Data | Indexed access to data items
TCache.MRUSlot | Most recent item slot.


TCache.Create

Create a new cache class.

Declaration

Source position: cachecls.pp line 78

public constructor TCache.Create(

  ASlotCount: Integer

);

Arguments

ASlotCount

Initial slot count

Description

Create instantiates a new instance of TCache. It allocates room for ASlotCount entries in the list. The number of slots can be increased later.

See also

TCache.SlotCount

Number of slots in the list


TCache.Data

Indexed access to data items

Declaration

Source position: cachecls.pp line 88

public property TCache.Data: Pointer
  read GetData
  write SetData;

Description

Data offers index-based access to the data pointers in the cache. By accessing an item in the list in this manner, the item is moved to the front of the MRU list, i.e. MRUSlot will point to the accessed item. The access is both read and write.

The index is zero-based and can maximally be SlotCount-1. Providing an invalid index will result in an exception.

See also

TCache.MRUSlot

Most recent item slot.


TCache.Destroy

Free the TCache class from memory

Declaration

Source position: cachecls.pp line 79

public destructor TCache.Destroy; override;

Description

Destroy cleans up the array for the elements, and calls the inherited Destroy. The elements in the array are not freed by this action.

See also

TCache.Create

Create a new cache class.


TCache.FindSlot

Find data pointer in the list

Declaration

Source position: cachecls.pp line 83

public function TCache.FindSlot(

  AData: Pointer

):PCacheSlot;

Arguments

AData

Data pointer to look for.

Function result

Slot which contains AData

Description

FindSlot checks all items in the list, and returns the slot which contains a data pointer that matches the pointer AData.

If no item with data pointer that matches AData is found, Nil is returned.

For this function to work correctly, the OnIsDataEqual event must be set.

Errors

If OnIsDataEqual is not set, an exception wil be raised.

See also

TCache.IndexOf | Return index of a data pointer in the list.
TCache.Add | Add a data element to the list.
TCache.OnIsDataEqual | Event to compare 2 items.


TCache.FLRUSlot

Declaration

Source position: cachecls.pp line 76

protected TCache.FLRUSlot: PCacheSlot;


TCache.FMRUSlot

Declaration

Source position: cachecls.pp line 76

protected TCache.FMRUSlot: PCacheSlot;


TCache.FSlotCount

Declaration

Source position: cachecls.pp line 73

protected TCache.FSlotCount: Integer;


TCache.FSlots

Declaration

Source position: cachecls.pp line 74

protected TCache.FSlots: PCacheSlotArray;


TCache.IndexOf

Return index of a data pointer in the list.

Declaration

Source position: cachecls.pp line 84

public function TCache.IndexOf(

  AData: Pointer

):Integer;

Arguments

AData

Data pointer to search for.

Function result

Index of item that matches AData

Description

IndexOF searches in the list for a slot with data pointer that matches AData and returns the index of the slot.

If no item with data pointer that matches AData is found, -1 is returned.

For this function to work correctly, the OnIsDataEqual event must be set.

Errors

If OnIsDataEqual is not set, an exception wil be raised.

See also

TCache.FindSlot | Find data pointer in the list
TCache.Add | Add a data element to the list.
TCache.OnIsDataEqual | Event to compare 2 items.


TCache.LRUSlot

Last used item

Declaration

Source position: cachecls.pp line 90

public property TCache.LRUSlot: PCacheSlot
  read FLRUSlot;

Description

LRUSlot points to the least recent used slot. It is the last item in the chain of slots.

See also

TCache.Add | Add a data element to the list.
TCache.AddNew | Add a new item to the list.
TCache.Data | Indexed access to data items
TCache.MRUSlot | Most recent item slot.


TCache.MRUSlot

Most recent item slot.

Declaration

Source position: cachecls.pp line 89

public property TCache.MRUSlot: PCacheSlot
  read FMRUSlot
  write SetMRUSlot;

Description

MRUSlot points to the most recent used slot. The most recent used slot is updated when the list is accessed through the Data property, or when an item is added to the list with Add or AddNew

See also

TCache.Add | Add a data element to the list.
TCache.AddNew | Add a new item to the list.
TCache.Data | Indexed access to data items
TCache.LRUSlot | Last used item


TCache.OnFreeSlot

Event called when a slot is freed

Declaration

Source position: cachecls.pp line 98

public property TCache.OnFreeSlot: TOnFreeSlot
  read FOnFreeSlot
  write FOnFreeSlot;

Description

OnFreeSlot is called when an item needs to be freed, i.e. when a new item is added to a full list, and the least recent used item needs to be dropped from the list.

The cache class instance and the index of the item to be removed are passed to the callback.

See also

TCache.Add | Add a data element to the list.
TCache.AddNew | Add a new item to the list.
TCache.SlotCount | Number of slots in the list


TCache.OnIsDataEqual

Event to compare 2 items.

Declaration

Source position: cachecls.pp line 94

public property TCache.OnIsDataEqual: TOnIsDataEqual
  read FOnIsDataEqual
  write FOnIsDataEqual;

Description

OnIsDataEqual is used by FindSlot and IndexOf to compare items when looking for a particular item. These functions are called by the Add method. Failing to set this event will result in an exception. The function should return True if the 2 data pointers should be considered equal.

See also

TCache.FindSlot | Find data pointer in the list
TCache.IndexOf | Return index of a data pointer in the list.
TCache.Add | Add a data element to the list.


TCache.Remove

Remove a data item from the list.

Declaration

Source position: cachecls.pp line 85

public procedure TCache.Remove(

  AData: Pointer

);

Arguments

AData

Data pointer to remove

Description

Remove searches the slot which matches AData and if it is found, sets the data pointer to Nil, thus effectively removing the pointer from the list.

Errors

None.

See also

TCache.FindSlot

Find data pointer in the list


TCache.SlotCount

Number of slots in the list

Declaration

Source position: cachecls.pp line 91

public property TCache.SlotCount: Integer
  read FSlotCount
  write SetSlotCount;

Description

SlotCount is the number of slots in the list. Its initial value is set when the TCache instance is created, but this can be changed at any time. If items are added to the list and the list is full, then the number of slots is not increased, but the least used item is dropped from the list. In that case OnFreeSlot is called.

See also

TCache.Create | Create a new cache class.
TCache.Data | Indexed access to data items
TCache.Slots | Indexed array to the slots


TCache.Slots

Indexed array to the slots

Declaration

Source position: cachecls.pp line 92

public property TCache.Slots: PCacheSlot
  read GetSlot;

Description

Slots provides index-based access to the TCacheSlot records in the list. Accessing the records directly does not change their position in the MRU list.

The index is zero-based and can maximally be SlotCount-1. Providing an invalid index will result in an exception.

See also

TCache.Data | Indexed access to data items
TCache.SlotCount | Number of slots in the list


TCacheSlot

Record representing 1 item in the cache list.

Declaration

Source position: cachecls.pp line 45

type TCacheSlot = record
Prev: PCacheSlot; | Pointer to previous element in the list.
Next: PCacheSlot; | Pointer to next element in the list.
Data: Pointer; | Data pointer for this item.
Index: Integer; | Index in the list.
end;

Description

TCacheSlot is internally used by the TCache class. It represents 1 element in the linked list.

See also

TCache | Cache class
PCacheSlot | Pointer to TCacheSlot record.


TCacheSlotArray

Array of TCacheSlot

Declaration

Source position: cachecls.pp line 52

type TCacheSlotArray = array [0..MaxIntdivSizeOf(TCacheSlot)-1] of TCacheSlot;

Description

TCacheSlotArray is an array of TCacheSlot items. Do not use TCacheSlotArray directly, instead, use PCacheSlotArray and allocate memory dynamically.

See also

TCacheSlot | Record representing 1 item in the cache list.
PCacheSlotArray | Pointer to TCacheSlotArray array


EDuplicate

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a key is stored twice in a hash table.

Declaration

Source position: contnrs.pp line 476

type EDuplicate = class(Exception) end;

Inheritance

EDuplicate

Exception raised when a key is stored twice in a hash table.
|

Exception
|

TObject

See also

TFPCustomHashTable.Add

Add a new key and its associated data to the hash.


EDuplicate
Exception
 | HelpContext
 | Message


EDuplicate
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EDuplicate

Exception


EKeyNotFound

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when a key is not found.

Declaration

Source position: contnrs.pp line 477

type EKeyNotFound = class(Exception) end;

Inheritance

EKeyNotFound

Exception raised when a key is not found.
|

Exception
|

TObject

See also

TFPCustomHashTable.Delete

Delete a key from the hash list.


EKeyNotFound
Exception
 | HelpContext
 | Message


EKeyNotFound
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EKeyNotFound

Exception


TBucketList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Default bucket list implementation.

Declaration

Source position: contnrs.pp line 546

type TBucketList = class(TCustomBucketList)

protected

  function BucketFor(); override;

public

  constructor Create();

Create a new TBucketList instance.

end;

Inheritance

TBucketList | Default bucket list implementation.
|
TCustomBucketList | Custom bucket list class
|
TObject

Description

TBucketList is a descendent of TCustomBucketList which allows to specify a bucket count which is a multiple of 2, up to 256 buckets. The size is passed to the constructor and cannot be changed in the lifetime of the bucket list instance.

The buckets for an item is determined by looking at the last bits of the item pointer: For 2 buckets, the last bit is examined, for 4 buckets, the last 2 bits are taken and so on. The algorithm takes into account the average granularity (4) of heap pointers.

See also

TCustomBucketList

Custom bucket list class


TBucketList
TCustomBucketList
pt | ro | Buckets
pt |  | BucketCount
 |  | Data


pt |  | BucketCount (TCustomBucketList)
pt | ro | Buckets (TCustomBucketList)
 |  | Data (TCustomBucketList)


TBucketList
pt | BucketFor
 | Create
TCustomBucketList
pt | GetBucketItem
pt | AddItem
pt | BucketFor
pt | DeleteItem
pt | Error
pt | FindItem
 | Destroy
 | Clear
 | Add
 | Assign
 | Exists
 | Find
 | ForEach
 | Remove


pt | AddItem (TCustomBucketList)
 | Assign (TCustomBucketList)
pt | BucketFor (TCustomBucketList)
pt | BucketFor (TBucketList)
 | Clear (TCustomBucketList)
 | Create (TBucketList)
pt | DeleteItem (TCustomBucketList)
 | Destroy (TCustomBucketList)
pt | Error (TCustomBucketList)
 | Exists (TCustomBucketList)
 | Find (TCustomBucketList)
pt | FindItem (TCustomBucketList)
 | ForEach (TCustomBucketList)
pt | GetBucketItem (TCustomBucketList)
 | Remove (TCustomBucketList)


TBucketList

TCustomBucketList


TBucketList.BucketFor

Declaration

Source position: contnrs.pp line 550

protected function TBucketList.BucketFor(

  AItem: Pointer

):Integer; override;


TBucketList.Create

Create a new TBucketList instance.

Declaration

Source position: contnrs.pp line 552

public constructor TBucketList.Create(

  ABuckets: TBucketListSizes = bl16

);

Arguments

ABuckets

Number of buckets to create

Description

Create instantiates a new bucketlist instance with a number of buckets determined by ABuckets. After creation, the number of buckets can no longer be changed.

Errors

If not enough memory is available to create the instance, an exception may be raised.

See also

TBucketListSizes

Enumerated type to indicate bucket list size


TBucketListSizes

Enumerated type to indicate bucket list size

Declaration

Source position: contnrs.pp line 542

type TBucketListSizes = (
bl2, | List with 2 buckets
bl4, | List with 4 buckets
bl8, | List with 8 buckets
bl16, | List with 16 buckets
bl32, | List with 32 buckets
bl64, | List with 64 buckets
bl128, | List with 128 buckets
bl256 | List with 256 buckets
);

Description

TBucketListSizes is used to set the bucket list size: It specified the number of buckets created by TBucketList.

See also

TBucketList | Default bucket list implementation.
TBucketList.Create | Create a new TBucketList instance.


TClassList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

List of classes.

Declaration

Source position: contnrs.pp line 114

type TClassList = class(TList)
protected
function GetItems();
procedure SetItems();
public
function Add(); | Add a new class pointer to the list.
function Extract(); | Extract a class pointer from the list.
function Remove(); | Remove a class pointer from the list.
function IndexOf(); | Search for a class pointer in the list.
function First; | Return first non-nil class pointer
function Last; | Return last non-Nil class pointer
procedure Insert(); | Insert a new class pointer in the list.
property Items: TClass; default; [rw] | Index based access to class pointers.
end;

Inheritance

TClassList

List of classes.
|

TList
|

TObject

Description

TClassList is a Tlist descendent which stores class references instead of pointers. It introduces no new behaviour other than ensuring all stored pointers are class pointers.

The OwnsObjects property as found in TComponentList and TObjectList is not implemented as there are no actual instances.

See also

#rtl.classes.tlist
TComponentList | List to manage component instances.
TObjectList | List to manage object instances.


TClassList
 |  | Items
TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List


 | Capacity (TList)
 | Count (TList)
 | Items (TList)
 | Items (TClassList)
ro | List (TList)


TClassList
pt | GetItems
pt | SetItems
 | Add
 | Extract
 | Remove
 | IndexOf
 | First
 | Last
 | Insert
TList
 | CopyMove
 | MergeMove
 | DoCopy
 | DoSrcUnique
 | DoAnd
 | DoDestUnique
 | DoOr
 | DoXOr
 | Get
 | Grow
 | Put
 | Notify
 | SetCapacity
 | GetCapacity
 | SetCount
 | GetCount
 | GetList
 | Create
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort


 | Add (TList)
 | Add (TClassList)
 | AddList (TList)
 | Assign (TList)
 | Clear (TList)
 | CopyMove (TList)
 | Create (TList)
 | Delete (TList)
 | Destroy (TList)
 | DoAnd (TList)
 | DoCopy (TList)
 | DoDestUnique (TList)
 | DoOr (TList)
 | DoSrcUnique (TList)
 | DoXOr (TList)
 | Error (TList)
 | Exchange (TList)
 | Expand (TList)
 | Extract (TList)
 | Extract (TClassList)
 | First (TList)
 | First (TClassList)
 | Get (TList)
 | GetCapacity (TList)
 | GetCount (TList)
pt | GetItems (TClassList)
 | GetList (TList)
 | Grow (TList)
 | IndexOf (TList)
 | IndexOf (TClassList)
 | Insert (TList)
 | Insert (TClassList)
 | Last (TList)
 | Last (TClassList)
 | MergeMove (TList)
 | Move (TList)
 | Notify (TList)
 | Pack (TList)
 | Put (TList)
 | Remove (TList)
 | Remove (TClassList)
 | SetCapacity (TList)
 | SetCount (TList)
pt | SetItems (TClassList)
 | Sort (TList)


TClassList

TList


TClassList.Add

Add a new class pointer to the list.

Declaration

Source position: contnrs.pp line 119

public function TClassList.Add(

  AClass: TClass

):Integer;

Arguments

AClass

Class pointer to add.

Function result

Index at which the class pointer was added.

Description

Add adds AClass to the list, and returns the position at which it was added. It simply overrides the TList bevahiour, and introduces no new functionality.

Errors

If not enough memory is available to expand the list, an exception may be raised.

See also

TClassList.Extract

Extract a class pointer from the list.

#rtl.classes.tlist.add


TClassList.Extract

Extract a class pointer from the list.

Declaration

Source position: contnrs.pp line 120

public function TClassList.Extract(

  Item: TClass

):TClass;

Arguments

Item

Class pointer to extract from the list

Function result

The extracted class pointer or Nil if none was found.

Description

Extract extracts a class pointer Item from the list, if it is present in the list. It returns the extracted class pointer, or Nil if the class pointer was not present in the list. It simply overrides the implementation in TList so it accepts a class pointer instead of a simple pointer. No new behaviour is introduced.

Errors

None.

See also

TClassList.Remove

Remove a class pointer from the list.

#rtl.classes.Tlist.Extract


TClassList.First

Return first non-nil class pointer

Declaration

Source position: contnrs.pp line 123

public function TClassList.First: TClass;

Function result

The first non-Nil class pointer in the list.

Description

First returns a reference to the first non-Nil class pointer in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TClassList.Last

Return last non-Nil class pointer

TClassList.Pack


TClassList.GetItems

Declaration

Source position: contnrs.pp line 116

protected function TClassList.GetItems(

  Index: Integer

):TClass;


TClassList.IndexOf

Search for a class pointer in the list.

Declaration

Source position: contnrs.pp line 122

public function TClassList.IndexOf(

  AClass: TClass

):Integer;

Arguments

AClass

Class pointer to search for

Function result

Position of the class pointer, or -1 if not found.

Description

IndexOf searches for AClass in the list, and returns it's position if it was found, or -1 if it was not found in the list.

Errors

None.

See also

#rtl.classes.tlist.indexof


TClassList.Insert

Insert a new class pointer in the list.

Declaration

Source position: contnrs.pp line 125

public procedure TClassList.Insert(

  Index: Integer;

  AClass: TClass

);

Arguments

Index | Position to insert class pointer at.
AClass | Class pointer to insert.

Description

Insert inserts a class pointer in the list at position Index. It simply overrides the parent implementation so it only accepts class pointers. It introduces no new behaviour.

Errors

None.

See also

#rtl.classes.TList.Insert
TClassList.Add | Add a new class pointer to the list.
TClassList.Remove | Remove a class pointer from the list.


TClassList.Items

Index based access to class pointers.

Declaration

Source position: contnrs.pp line 126

public property TClassList.Items: TClass
  read GetItems
  write SetItems;
  default;

Description

Items provides index-based access to the class pointers in the list. TClassList overrides the default Items implementation of TList so it returns class pointers instead of pointers.

See also

#rtl.classes.TList.Items

#rtl.classes.TList.Count


TClassList.Last

Return last non-Nil class pointer

Declaration

Source position: contnrs.pp line 124

public function TClassList.Last: TClass;

Function result

The last non-Nil class pointer in the list.

Description

Last returns a reference to the last non-Nil class pointer in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TClassList.First

Return first non-nil class pointer

TClassList.Pack


TClassList.Remove

Remove a class pointer from the list.

Declaration

Source position: contnrs.pp line 121

public function TClassList.Remove(

  AClass: TClass

):Integer;

Arguments

AClass

Class pointer to remove from the list.

Function result

Index of the removed item

Description

Remove removes a class pointer Item from the list, if it is present in the list. It returns the index of the removed class pointer, or -1 if the class pointer was not present in the list. It simply overrides the implementation in TList so it accepts a class pointer instead of a simple pointer. No new behaviour is introduced.

Errors

None.

See also

TClassList.Extract

Extract a class pointer from the list.

#rtl.classes.Tlist.Remove


TClassList.SetItems

Declaration

Source position: contnrs.pp line 117

protected procedure TClassList.SetItems(

  Index: Integer;

  AClass: TClass

);


TComponentList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

List to manage component instances.

Declaration

Source position: contnrs.pp line 94

type TComponentList = class(TObjectList)
protected
procedure Notify(); override;
function GetItems();
procedure SetItems();
procedure HandleFreeNotify();
public
destructor Destroy; override; | Destroys the instance
function Add(); | Add a component to the list.
function Extract(); | Remove a component from the list without destroying it.
function Remove(); | Remove a component from the list, possibly destroying it.
function IndexOf(); | Search for an instance in the list
function First; | First non-nil instance in the list.
function Last; | Last non-nil instance in the list.
procedure Insert(); | Insert a new component in the list
property Items: TComponent; default; [rw] | Index-based access to the elements in the list.
end;

Inheritance

TComponentList | List to manage component instances.
|
TObjectList | List to manage object instances.
|
TList
|
TObject

Description

TComponentList is a TObjectList descendent which has as the default array property TComponents instead of objects. It overrides some methods so only components can be added.

In difference with TObjectList, TComponentList removes any TComponent from the list if the TComponent instance was freed externally. It uses the FreeNotification mechanism for this.

See also

#rtl.classes.TList
TFPObjectList | TFPList descendent which manages objects.
TObjectList | List to manage object instances.
TClassList | List of classes.


TComponentList
 |  | Items
TObjectList
 |  | OwnsObjects
 |  | Items
TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List


 | Capacity (TList)
 | Count (TList)
 | Items (TList)
 | Items (TObjectList)
 | Items (TComponentList)
ro | List (TList)
 | OwnsObjects (TObjectList)


TComponentList
pt | Notify
pt | GetItems
pt | SetItems
pt | HandleFreeNotify
 | Destroy
 | Add
 | Extract
 | Remove
 | IndexOf
 | First
 | Last
 | Insert
TObjectList
pt | Notify
pt | GetItem
pt | SetItem
 | create
 | Add
 | Extract
 | Remove
 | IndexOf
 | FindInstanceOf
 | Insert
 | First
 | Last
TList
 | CopyMove
 | MergeMove
 | DoCopy
 | DoSrcUnique
 | DoAnd
 | DoDestUnique
 | DoOr
 | DoXOr
 | Get
 | Grow
 | Put
 | Notify
 | SetCapacity
 | GetCapacity
 | SetCount
 | GetCount
 | GetList
 | Create
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort


 | Add (TList)
 | Add (TObjectList)
 | Add (TComponentList)
 | AddList (TList)
 | Assign (TList)
 | Clear (TList)
 | CopyMove (TList)
 | Create (TList)
 | create (TObjectList)
 | Delete (TList)
 | Destroy (TList)
 | Destroy (TComponentList)
 | DoAnd (TList)
 | DoCopy (TList)
 | DoDestUnique (TList)
 | DoOr (TList)
 | DoSrcUnique (TList)
 | DoXOr (TList)
 | Error (TList)
 | Exchange (TList)
 | Expand (TList)
 | Extract (TList)
 | Extract (TObjectList)
 | Extract (TComponentList)
 | FindInstanceOf (TObjectList)
 | First (TList)
 | First (TObjectList)
 | First (TComponentList)
 | Get (TList)
 | GetCapacity (TList)
 | GetCount (TList)
pt | GetItem (TObjectList)
pt | GetItems (TComponentList)
 | GetList (TList)
 | Grow (TList)
pt | HandleFreeNotify (TComponentList)
 | IndexOf (TList)
 | IndexOf (TObjectList)
 | IndexOf (TComponentList)
 | Insert (TList)
 | Insert (TObjectList)
 | Insert (TComponentList)
 | Last (TList)
 | Last (TObjectList)
 | Last (TComponentList)
 | MergeMove (TList)
 | Move (TList)
 | Notify (TList)
pt | Notify (TObjectList)
pt | Notify (TComponentList)
 | Pack (TList)
 | Put (TList)
 | Remove (TList)
 | Remove (TObjectList)
 | Remove (TComponentList)
 | SetCapacity (TList)
 | SetCount (TList)
pt | SetItem (TObjectList)
pt | SetItems (TComponentList)
 | Sort (TList)


TComponentList

TObjectList

TList


TComponentList.Add

Add a component to the list.

Declaration

Source position: contnrs.pp line 104

public function TComponentList.Add(

  AComponent: TComponent

):Integer;

Arguments

AComponent

The component to add.

Function result

Index at which the component was added.

Description

Add overrides the Add operation of it's ancestors, so it only accepts TComponent instances. It introduces no new behaviour.

The function returns the index at which the component was added.

Errors

If not enough memory is available to expand the list, an exception may be raised.

See also

TObectList.Add


TComponentList.Destroy

Destroys the instance

Declaration

Source position: contnrs.pp line 103

public destructor TComponentList.Destroy; override;

Description

Destroy unhooks the free notification handler and then calls the inherited destroy to clean up the TComponentList instance.

Errors

None.

See also

TObjectList

List to manage object instances.

#rtl.classes.TComponent


TComponentList.Extract

Remove a component from the list without destroying it.

Declaration

Source position: contnrs.pp line 105

public function TComponentList.Extract(

  Item: TComponent

):TComponent;

Arguments

Item

The component to extract.

Function result

The extracted component, or Nil if none was found.

Description

Extract removes a component (Item) from the list, without destroying it. It overrides the implementation of TObjectList so only TComponent descendents can be extracted. It introduces no new behaviour.

Extract returns the instance that was extracted, or Nil if no instance was found.

See also

TComponentList.Remove | Remove a component from the list, possibly destroying it.
TObjectList.Extract | Extract an object from the list.


TComponentList.First

First non-nil instance in the list.

Declaration

Source position: contnrs.pp line 108

public function TComponentList.First: TComponent;

Function result

The first non-nil instance in the list, or Nil

Description

First overrides the implementation of it's ancestors to return the first non-nil instance of TComponent in the list. If no non-nil instance is found, Nil is returned.

Errors

None.

See also

TComponentList.Last | Last non-nil instance in the list.
TObjectList.First | Return the first non-nil object in the list


TComponentList.GetItems

Declaration

Source position: contnrs.pp line 99

protected function TComponentList.GetItems(

  Index: Integer

):TComponent;


TComponentList.HandleFreeNotify

Declaration

Source position: contnrs.pp line 101

protected procedure TComponentList.HandleFreeNotify(

  Sender: TObject;

  AComponent: TComponent

);


TComponentList.IndexOf

Search for an instance in the list

Declaration

Source position: contnrs.pp line 107

public function TComponentList.IndexOf(

  AComponent: TComponent

):Integer;

Arguments

AComponent

Instance to look for.

Function result

Index of the found instance

Description

IndexOf searches for an instance in the list and returns it's position in the list. The position is zero-based. If no instance is found, -1 is returned.

IndexOf just overrides the implementation of the parent class so it accepts only TComponent instances. It introduces no new behaviour.

Errors

None.

See also

TObjectList.IndexOf

Search for an object in the list


TComponentList.Insert

Insert a new component in the list

Declaration

Source position: contnrs.pp line 110

public procedure TComponentList.Insert(

  Index: Integer;

  AComponent: TComponent

);

Arguments

Index | Position in the list where the component should be inserted
AComponent | Component instance to insert.

Description

Insert inserts a TComponent instance (AComponent) in the list at position Index. It simply overrides the parent implementation so it only accepts TComponent instances. It introduces no new behaviour.

Errors

None.

See also

TObjectList.Insert | Insert an object in the list.
TComponentList.Add | Add a component to the list.
TComponentList.Remove | Remove a component from the list, possibly destroying it.


TComponentList.Items

Index-based access to the elements in the list.

Declaration

Source position: contnrs.pp line 111

public property TComponentList.Items: TComponent
  read GetItems
  write SetItems;
  default;

Description

Items provides access to the components in the list using an index. It simply overrides the default property of the parent classes so it returns/accepts TComponent instances only. Note that the index is zero based.

See also

TObjectList.Items

Indexed access to the elements of the list.


TComponentList.Last

Last non-nil instance in the list.

Declaration

Source position: contnrs.pp line 109

public function TComponentList.Last: TComponent;

Function result

The last non-nil instance in the list, or Nil

Description

Last overrides the implementation of it's ancestors to return the last non-nil instance of TComponent in the list. If no non-nil instance is found, Nil is returned.

Errors

None.

See also

TComponentList.First | First non-nil instance in the list.
TObjectList.Last | Return the last non-nil object in the list.


TComponentList.Notify

Declaration

Source position: contnrs.pp line 98

protected procedure TComponentList.Notify(

  Ptr: Pointer;

  Action: TListNotification

); override;


TComponentList.Remove

Remove a component from the list, possibly destroying it.

Declaration

Source position: contnrs.pp line 106

public function TComponentList.Remove(

  AComponent: TComponent

):Integer;

Arguments

AComponent

Component to remove from the list

Function result

The index of the removed instance

Description

Remove removes item from the list, and if the list owns it's items, it also destroys it. It returns the index of the item that was removed, or -1 if no item was removed.

Remove simply overrides the implementation in TObjectList so it only accepts TComponent descendents. It introduces no new behaviour.

Errors

None.

See also

TComponentList.Extract | Remove a component from the list without destroying it.
TObjectList.Remove | Remove (and possibly free) an element from the list.


TComponentList.SetItems

Declaration

Source position: contnrs.pp line 100

protected procedure TComponentList.SetItems(

  Index: Integer;

  AComponent: TComponent

);


TCustomBucketList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Custom bucket list class

Declaration

Source position: contnrs.pp line 508

type TCustomBucketList = class(TObject)
protected
procedure GetBucketItem();
function AddItem(); virtual;
function BucketFor(); virtual; abstract;
function DeleteItem(); virtual;
procedure Error();
function FindItem(); virtual;
property Buckets: TBucketArray; [r]
property BucketCount: Integer; [rw]
public
destructor Destroy; override; | Frees the bucketlist from memory
procedure Clear; | Clear the list
function Add(); | Add an item to the list
procedure Assign(); | Assign one bucket list to another
function Exists(); | Check if an item exists in the list.
function Find(); | Find an item in the list
function ForEach(); | Loop over all items.
function Remove(); | Remove an item from the list.
property Data: Pointer; default; [rw] | Associative array for data pointers
end;

Inheritance

TCustomBucketList

Custom bucket list class
|

TObject

Description

TCustomBucketList is an associative list using buckets for storage. It scales better than a regular TList list class, escpecially when an item must be searched in the list.

Since the list associates a data pointer with each item pointer, it follows that each item pointer must be unique, and can be added to the list only once.

The TCustomBucketList class does not determine the number of buckets or the bucket hash mechanism, this must be done by descendent classes such as TBucketList. TCustomBucketList only takes care of storage and retrieval of items in the various buckets.

Because TCustomBucketList is an abstract class - it does not determine the number of buckets - one should never instantiate an instance of TCustomBucketList, but always use a descendent class such as TCustomBucketList.

See also

TBucketList

Default bucket list implementation.


TCustomBucketList
pt | ro | Buckets
pt |  | BucketCount
 |  | Data


TCustomBucketList
pt | GetBucketItem
pt | AddItem
pt | BucketFor
pt | DeleteItem
pt | Error
pt | FindItem
 | Destroy
 | Clear
 | Add
 | Assign
 | Exists
 | Find
 | ForEach
 | Remove


pt | AddItem (TCustomBucketList)
 | Assign (TCustomBucketList)
pt | BucketFor (TCustomBucketList)
 | Clear (TCustomBucketList)
pt | DeleteItem (TCustomBucketList)
 | Destroy (TCustomBucketList)
pt | Error (TCustomBucketList)
 | Exists (TCustomBucketList)
 | Find (TCustomBucketList)
pt | FindItem (TCustomBucketList)
 | ForEach (TCustomBucketList)
pt | GetBucketItem (TCustomBucketList)
 | Remove (TCustomBucketList)


TCustomBucketList


TCustomBucketList.Add

Add an item to the list

Declaration

Source position: contnrs.pp line 527

public function TCustomBucketList.Add(

  AItem: Pointer;

  AData: Pointer

):Pointer;

Arguments

AItem | Item to add to the list. Must uniquely identify AData.
AData | Data to be associated with AItem

Function result

The result is always AData

Description

Add adds AItem with it's associated AData to the list and returns AData.

Errors

If AItem is already in the list, an ElistError exception will be raised.

See also

TCustomBucketList.Exists | Check if an item exists in the list.
TCustomBucketList.Clear | Clear the list


TCustomBucketList.AddItem

Declaration

Source position: contnrs.pp line 517

protected function TCustomBucketList.AddItem(

  ABucket: Integer;

  AItem: Pointer;

  AData: Pointer

):Pointer; virtual;


TCustomBucketList.Assign

Assign one bucket list to another

Declaration

Source position: contnrs.pp line 528

public procedure TCustomBucketList.Assign(

  AList: TCustomBucketList

);

Arguments

AList

Source list to copy items from

Description

Assign is implemented by TCustomBucketList to copy the contents of another bucket list to the bucket list. It clears the contents prior to the copy operation.

See also

TCustomBucketList.Add | Add an item to the list
TCustomBucketList.Clear | Clear the list


TCustomBucketList.BucketCount

Declaration

Source position: contnrs.pp line 523

protected property TCustomBucketList.BucketCount: Integer
  read GetBucketCount
  write SetBucketCount;


TCustomBucketList.BucketFor

Declaration

Source position: contnrs.pp line 518

protected function TCustomBucketList.BucketFor(

  AItem: Pointer

):Integer; virtual; abstract;


TCustomBucketList.Buckets

Declaration

Source position: contnrs.pp line 522

protected property TCustomBucketList.Buckets: TBucketArray
  read FBuckets;


TCustomBucketList.Clear

Clear the list

Declaration

Source position: contnrs.pp line 526

public procedure TCustomBucketList.Clear;

Description

Clear clears the list. The items and their data themselves are not disposed of, this must be done separately. Clear only removes all references to the items from the list.

Errors

None.

See also

TCustomBucketList.Add

Add an item to the list


TCustomBucketList.Data

Associative array for data pointers

Declaration

Source position: contnrs.pp line 534

public property TCustomBucketList.Data: Pointer
  read GetData
  write SetData;
  default;

Description

Data provides direct access to the Data pointers associated with the AItem pointers. If AItem is not in the list of pointers, an EListError exception will be raised.

See also

TCustomBucketList.Find | Find an item in the list
TCustomBucketList.Exists | Check if an item exists in the list.


TCustomBucketList.DeleteItem

Declaration

Source position: contnrs.pp line 519

protected function TCustomBucketList.DeleteItem(

  ABucket: Integer;

  AIndex: Integer

):Pointer; virtual;


TCustomBucketList.Destroy

Frees the bucketlist from memory

Declaration

Source position: contnrs.pp line 525

public destructor TCustomBucketList.Destroy; override;

Description

Detsroy frees all storage for the buckets from memory. The items themselves are not freed from memory.


TCustomBucketList.Error

Declaration

Source position: contnrs.pp line 520

protected procedure TCustomBucketList.Error(

  Msg: String;

  Args: array of Const

);


TCustomBucketList.Exists

Check if an item exists in the list.

Declaration

Source position: contnrs.pp line 529

public function TCustomBucketList.Exists(

  AItem: Pointer

):Boolean;

Arguments

AItem

Item to search for

Function result

True if the item exists in the list, False if not.

Description

Exists searches the list and returns True if the AItem is already present in the list. If the item is not yet in the list, False is returne5Ad.

If the data pointer associated with AItem is also needed, then it is better to use Find.

See also

TCustomBucketList.Find

Find an item in the list


TCustomBucketList.Find

Find an item in the list

Declaration

Source position: contnrs.pp line 530

public function TCustomBucketList.Find(

  AItem: Pointer;

  out AData: Pointer

):Boolean;

Arguments

AItem | Item to search for in the list
AData | On return, contains the data pointer associated with AItem.

Function result

True if the item is present in the list.

Description

Find searches for AItem in the list and returns the data pointer associated with it in AData if the item was found. In that case the return value is True. If AItem is not found in the list, False is returned.

See also

TCustomBucketList.Exists

Check if an item exists in the list.


TCustomBucketList.FindItem

Declaration

Source position: contnrs.pp line 521

protected function TCustomBucketList.FindItem(

  AItem: Pointer;

  out ABucket: Integer;

  out AIndex: Integer

):Boolean; virtual;


TCustomBucketList.ForEach

Loop over all items.

Declaration

Source position: line 0

public function TCustomBucketList.ForEach(

  AProc: TBucketProc;

  AInfo: Pointer = nil

):Boolean;

function TCustomBucketList.ForEach(

  AProc: TBucketProcObject

):Boolean;

Arguments

AProc | Callback handler to call for each item in the list.
AInfo | Extra info to pass to the procedural variant of the method.

Function result

True if all items were processed, False if the loop was stopped.

Arguments

AProc

Callback handler to call for each item in the list.

Function result

True if all items were processed, False if the loop was stopped.

Description

Foreach loops over all items in the list and calls AProc, passing it in turn each item in the list.

AProc exists in 2 variants: one which is a simple procedure, and one which is a method. In the case of the simple procedure, the AInfo argument is passed as well in each call to AProc.

The loop stops when all items have been processed, or when the AContinue argument of AProc contains False on return.

The result of the function is True if all items were processed, or False if the loop was interrupted with a AContinue return of False.

Errors

None.

See also

TCustomBucketList.Data

Associative array for data pointers


TCustomBucketList.GetBucketItem

Declaration

Source position: contnrs.pp line 516

protected procedure TCustomBucketList.GetBucketItem(

  AItem: Pointer;

  out ABucket: Integer;

  out AIndex: Integer

);


TCustomBucketList.Remove

Remove an item from the list.

Declaration

Source position: contnrs.pp line 533

public function TCustomBucketList.Remove(

  AItem: Pointer

):Pointer;

Arguments

AItem

Item to remove from the list.

Function result

Data pointer associated with AItem

Description

Remove removes AItem from the list, and returns the associated data pointer of the removed item. If the item was not in the list, then Nil is returned.

See also

Find

Find an item in the list


TFPCustomHashTable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash class

Declaration

Source position: contnrs.pp line 352

type TFPCustomHashTable = class(TObject)
protected
function CreateNewNode(); virtual; abstract;
procedure AddNode(); virtual; abstract;
function ChainLength(); virtual;
function FindOrCreateNew(); virtual;
procedure SetHashFunction(); virtual;
function FindChainForAdd();
public
constructor Create; | Instantiate a new TFPCustomHashTable instance using the default hash mechanism
constructor CreateWith(); | Instantiate a new TFPCustomHashTable instance with given algorithm and size
destructor Destroy; override; | Free the hash table.
procedure ChangeTableSize(); virtual; | Change the table size of the hash table.
procedure Clear; virtual; | Clear the hash table.
procedure Delete(); virtual; | Delete a key from the hash list.
function Find(); | Search for an item with a certain key value.
function IsEmpty; | Check if the hash table is empty.
property HashFunction: THashFunction; [rw] | Hash function currently in use
property Count: LongWord; [r] | Number of items in the hash table.
property HashTableSize: LongWord; [rw] | Size of the hash table
property HashTable: TFPObjectList; [r] | Hash table instance
property VoidSlots: LongWord; [r] | Number of empty slots in the hash table.
property LoadFactor: double; [r] | Fraction of count versus size
property AVGChainLen: double; [r] | Average chain length
property MaxChainLength: LongWord; [r] | Maximum chain length
property NumberOfCollisions: LongWord; [r] | Number of extra items
property Density: LongWord; [r] | Number of filled slots
end;

Inheritance

TFPCustomHashTable

Hash class
|

TObject

Description

TFPCustomHashTable is a general-purpose hashing class. It can store string keys and pointers associated with these strings. The hash mechanism is configurable and can be optionally be specified when a new instance of the class is created; A default hash mechanism is implemented in RSHash.

A TFPHasList should be used when fast lookup of data based on some key is required. The other container objects only offer linear search methods, while the hash list offers faster search mechanisms.

See also

THTCustomNode | Single item in the hash table.
TFPObjectList | TFPList descendent which manages objects.
RSHash | Standard hash value calculating function.


TFPCustomHashTable
 |  | HashFunction
 | ro | Count
 |  | HashTableSize
 | ro | HashTable
 | ro | VoidSlots
 | ro | LoadFactor
 | ro | AVGChainLen
 | ro | MaxChainLength
 | ro | NumberOfCollisions
 | ro | Density


ro | AVGChainLen (TFPCustomHashTable)
ro | Count (TFPCustomHashTable)
ro | Density (TFPCustomHashTable)
 | HashFunction (TFPCustomHashTable)
ro | HashTable (TFPCustomHashTable)
 | HashTableSize (TFPCustomHashTable)
ro | LoadFactor (TFPCustomHashTable)
ro | MaxChainLength (TFPCustomHashTable)
ro | NumberOfCollisions (TFPCustomHashTable)
ro | VoidSlots (TFPCustomHashTable)


TFPCustomHashTable
pt | CreateNewNode
pt | AddNode
pt | ChainLength
pt | FindOrCreateNew
pt | SetHashFunction
pt | FindChainForAdd
 | Create
 | CreateWith
 | Destroy
 | ChangeTableSize
 | Clear
 | Delete
 | Find
 | IsEmpty


pt | AddNode (TFPCustomHashTable)
pt | ChainLength (TFPCustomHashTable)
 | ChangeTableSize (TFPCustomHashTable)
 | Clear (TFPCustomHashTable)
 | Create (TFPCustomHashTable)
pt | CreateNewNode (TFPCustomHashTable)
 | CreateWith (TFPCustomHashTable)
 | Delete (TFPCustomHashTable)
 | Destroy (TFPCustomHashTable)
 | Find (TFPCustomHashTable)
pt | FindChainForAdd (TFPCustomHashTable)
pt | FindOrCreateNew (TFPCustomHashTable)
 | IsEmpty (TFPCustomHashTable)
pt | SetHashFunction (TFPCustomHashTable)


TFPCustomHashTable


TFPCustomHashTable.AddNode

Declaration

Source position: contnrs.pp line 369

protected procedure TFPCustomHashTable.AddNode(

  ANode: THTCustomNode

); virtual; abstract;


TFPCustomHashTable.AVGChainLen

Average chain length

Declaration

Source position: contnrs.pp line 389

public property TFPCustomHashTable.AVGChainLen: double
  read GetAVGChainLen;

Description

AVGChainLen is the average chain length, i.e. the ratio of elements in the table versus the number of filled slots. Calculating this is an expensive operation.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.LoadFactor | Fraction of count versus size
TFPCustomHashTable.MaxChainLength | Maximum chain length
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots
TFPCustomHashTable.NumberOfCollisions | Number of extra items


TFPCustomHashTable.ChainLength

Declaration

Source position: contnrs.pp line 370

protected function TFPCustomHashTable.ChainLength(

  const ChainIndex: LongWord

):LongWord; virtual;


TFPCustomHashTable.ChangeTableSize

Change the table size of the hash table.

Declaration

Source position: contnrs.pp line 378

public procedure TFPCustomHashTable.ChangeTableSize(

  const ANewSize: LongWord

); virtual;

Arguments

ANewSize

New hash table size

Description

ChangeTableSize changes the size of the hash table: it recomputes the hash value for all of the keys in the table, so this is an expensive operation.

Errors

If no memory is available, an exception may be raised.

See also

HashTableSize

Size of the hash table


TFPCustomHashTable.Clear

Clear the hash table.

Declaration

Source position: contnrs.pp line 379

public procedure TFPCustomHashTable.Clear; virtual;

Description

Clear removes all keys and their associated data from the hash table. The data itself is not freed from memory, this should be done by the programmer.

Errors

None.

See also

Destroy

Free the hash table.


TFPCustomHashTable.Count

Number of items in the hash table.

Declaration

Source position: contnrs.pp line 384

public property TFPCustomHashTable.Count: LongWord
  read FCount;

Description

Count is the number of items in the hash table.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.HashTableSize | Size of the hash table
TFPCustomHashTable.AVGChainLen | Average chain length
TFPCustomHashTable.MaxChainLength | Maximum chain length


TFPCustomHashTable.Create

Instantiate a new TFPCustomHashTable instance using the default hash mechanism

Declaration

Source position: contnrs.pp line 375

public constructor TFPCustomHashTable.Create;

Description

Create creates a new instance of TFPCustomHashTable with hash size 196613 and hash algorithm RSHash

Errors

If no memory is available, an exception may be raised.

See also

CreateWith

Instantiate a new TFPCustomHashTable instance with given algorithm and size


TFPCustomHashTable.CreateNewNode

Declaration

Source position: contnrs.pp line 368

protected function TFPCustomHashTable.CreateNewNode(

  const aKey: String

):THTCustomNode; virtual; abstract;


TFPCustomHashTable.CreateWith

Instantiate a new TFPCustomHashTable instance with given algorithm and size

Declaration

Source position: contnrs.pp line 376

public constructor TFPCustomHashTable.CreateWith(

  AHashTableSize: LongWord;

  aHashFunc: THashFunction

);

Arguments

AHashTableSize | Size of the hash table.
aHashFunc | Hash calculating function.

Description

CreateWith creates a new instance of TFPCustomHashTable with hash size AHashTableSize and hash calculating algorithm aHashFunc.

Errors

If no memory is available, an exception may be raised.

See also

Create

Instantiate a new TFPCustomHashTable instance using the default hash mechanism


TFPCustomHashTable.Delete

Delete a key from the hash list.

Declaration

Source position: contnrs.pp line 380

public procedure TFPCustomHashTable.Delete(

  const aKey: String

); virtual;

Arguments

aKey

Key to delete from the list

Description

Delete deletes all keys with value AKey from the hash table. It does not free the data associated with key. If AKey is not in the list, nothing is removed.

Errors

None.

See also

TFPCustomHashTable.Find | Search for an item with a certain key value.
TFPCustomHashTable.Add | Add a new key and its associated data to the hash.


TFPCustomHashTable.Density

Number of filled slots

Declaration

Source position: contnrs.pp line 392

public property TFPCustomHashTable.Density: LongWord
  read GetDensity;

Description

Density is the number of filled slots in the hash table.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.LoadFactor | Fraction of count versus size
TFPCustomHashTable.AvgChainLength
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots


TFPCustomHashTable.Destroy

Free the hash table.

Declaration

Source position: contnrs.pp line 377

public destructor TFPCustomHashTable.Destroy; override;

Description

Destroy removes the hash table from memory. If any data was associated with the keys in the hash table, then this data is not freed. This must be done by the programmer.

Errors

None.

See also

Destroy | Free the hash table.
Create | Instantiate a new TFPCustomHashTable instance using the default hash mechanism
Create | Instantiate a new TFPCustomHashTable instance with given algorithm and size
THTCustomNode.Data | Data associated with this hash value.


TFPCustomHashTable.Find

Search for an item with a certain key value.

Declaration

Source position: contnrs.pp line 381

public function TFPCustomHashTable.Find(

  const aKey: String

):THTCustomNode;

Arguments

aKey

Key value to look for.

Function result

THTCustomNode instance matching AKey

Description

Find searches for the THTCustomNode instance with key value equal to Akey and if it finds it, it returns the instance. If no matching value is found, Nil is returned.

Note that the instance returned by this function cannot be freed; If it should be removed from the hash table, the Delete method should be used instead.

Errors

None.

See also

Add | Add a new key and its associated data to the hash.
Delete | Delete a key from the hash list.


TFPCustomHashTable.FindChainForAdd

Declaration

Source position: contnrs.pp line 373

protected function TFPCustomHashTable.FindChainForAdd(

  const aKey: String

):TFPObjectList;


TFPCustomHashTable.FindOrCreateNew

Declaration

Source position: contnrs.pp line 371

protected function TFPCustomHashTable.FindOrCreateNew(

  const aKey: String

):THTCustomNode; virtual;


TFPCustomHashTable.HashFunction

Hash function currently in use

Declaration

Source position: contnrs.pp line 383

public property TFPCustomHashTable.HashFunction: THashFunction
  read FHashFunction
  write SetHashFunction;

Description

HashFunction is the hash function currently in use to calculate hash values from keys. The property can be set, this simply calls SetHashFunction. Note that setting the hash function does NOT the hash value of all keys to be recomputed, so changing the value while there are still keys in the table is not a good idea.

See also

SetHashFunction

HashTableSize

Size of the hash table


TFPCustomHashTable.HashTable

Hash table instance

Declaration

Source position: contnrs.pp line 386

public property TFPCustomHashTable.HashTable: TFPObjectList
  read FHashTable;

Description

TFPCustomHashTable is the internal list object (TFPObjectList used for the hash table. Each element in this table is again a TFPObjectList instance or Nil.


TFPCustomHashTable.HashTableSize

Size of the hash table

Declaration

Source position: contnrs.pp line 385

public property TFPCustomHashTable.HashTableSize: LongWord
  read FHashTableSize
  write SetHashTableSize;

Description

HashTableSize is the size of the hash table. It can be set, in which case it will be rounded to the nearest prime number suitable for RSHash.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.AVGChainLen | Average chain length
TFPCustomHashTable.MaxChainLength | Maximum chain length
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots


TFPCustomHashTable.IsEmpty

Check if the hash table is empty.

Declaration

Source position: contnrs.pp line 382

public function TFPCustomHashTable.IsEmpty: Boolean;

Function result

True if there are zero keys in the hashtable

Description

IsEmpty returns True if the hash table contains no elements, or False if there are still elements in the hash table.

See also

TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.HashTableSize | Size of the hash table
TFPCustomHashTable.AVGChainLen | Average chain length
TFPCustomHashTable.MaxChainLength | Maximum chain length


TFPCustomHashTable.LoadFactor

Fraction of count versus size

Declaration

Source position: contnrs.pp line 388

public property TFPCustomHashTable.LoadFactor: double
  read GetLoadFactor;

Description

LoadFactor is the ratio of elements in the table versus table size. Ideally, this should be as small as possible.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.AVGChainLen | Average chain length
TFPCustomHashTable.MaxChainLength | Maximum chain length
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots
TFPCustomHashTable.NumberOfCollisions | Number of extra items


TFPCustomHashTable.MaxChainLength

Maximum chain length

Declaration

Source position: contnrs.pp line 390

public property TFPCustomHashTable.MaxChainLength: LongWord
  read GetMaxChainLength;

Description

MaxChainLength is the length of the longest chain in the hash table. Calculating this is an expensive operation.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.LoadFactor | Fraction of count versus size
TFPCustomHashTable.AvgChainLength
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots
TFPCustomHashTable.NumberOfCollisions | Number of extra items


TFPCustomHashTable.NumberOfCollisions

Number of extra items

Declaration

Source position: contnrs.pp line 391

public property TFPCustomHashTable.NumberOfCollisions: LongWord
  read GetNumberOfCollisions;

Description

NumberOfCollisions is the number of items which are not the first item in a chain. If this number is too big, the hash size may be too small.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.LoadFactor | Fraction of count versus size
TFPCustomHashTable.AvgChainLength
TFPCustomHashTable.VoidSlots | Number of empty slots in the hash table.
TFPCustomHashTable.Density | Number of filled slots


TFPCustomHashTable.SetHashFunction

Declaration

Source position: contnrs.pp line 372

protected procedure TFPCustomHashTable.SetHashFunction(

  AHashFunction: THashFunction

); virtual;


TFPCustomHashTable.VoidSlots

Number of empty slots in the hash table.

Declaration

Source position: contnrs.pp line 387

public property TFPCustomHashTable.VoidSlots: LongWord
  read GetVoidSlots;

Description

VoidSlots is the number of empty slots in the hash table. Calculating this is an expensive operation.

See also

TFPCustomHashTable.IsEmpty | Check if the hash table is empty.
TFPCustomHashTable.Count | Number of items in the hash table.
TFPCustomHashTable.AVGChainLen | Average chain length
TFPCustomHashTable.MaxChainLength | Maximum chain length
TFPCustomHashTable.LoadFactor | Fraction of count versus size
TFPCustomHashTable.Density | Number of filled slots
TFPCustomHashTable.NumberOfCollisions | Number of extra items


TFPDataHashTable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash table for data pointers

Declaration

Source position: contnrs.pp line 410

type TFPDataHashTable = class(TFPCustomHashTable)
protected
function CreateNewNode(); override;
procedure AddNode(); override;
procedure SetData(); virtual;
function GetData(); virtual;
function ForEachCall(); virtual;
public
procedure Add(); virtual; | Add a data pointer to the list.
property Items: Pointer; default; [rw] | Key-based access to the items in the table
end;

Inheritance

TFPDataHashTable | Hash table for data pointers
|
TFPCustomHashTable | Hash class
|
TObject

Description

TFPDataHashTable is a TFPCustomHashTable descendent which stores simple data pointers together with the keys. In case the data associated with the keys are objects, it's better to use TFPObjectHashTable, or for string data, TFPStringHashTable is more suitable. The data pointers are exposed with their keys through the Items property.

See also

TFPObjectHashTable | Hash table for object instances
TFPStringHashTable | Hash table for string data.
Items | Key-based access to the items in the table


TFPDataHashTable
 |  | Items
TFPCustomHashTable
 |  | HashFunction
 | ro | Count
 |  | HashTableSize
 | ro | HashTable
 | ro | VoidSlots
 | ro | LoadFactor
 | ro | AVGChainLen
 | ro | MaxChainLength
 | ro | NumberOfCollisions
 | ro | Density


ro | AVGChainLen (TFPCustomHashTable)
ro | Count (TFPCustomHashTable)
ro | Density (TFPCustomHashTable)
 | HashFunction (TFPCustomHashTable)
ro | HashTable (TFPCustomHashTable)
 | HashTableSize (TFPCustomHashTable)
 | Items (TFPDataHashTable)
ro | LoadFactor (TFPCustomHashTable)
ro | MaxChainLength (TFPCustomHashTable)
ro | NumberOfCollisions (TFPCustomHashTable)
ro | VoidSlots (TFPCustomHashTable)


TFPDataHashTable
pt | CreateNewNode
pt | AddNode
pt | SetData
pt | GetData
pt | ForEachCall
 | Add
TFPCustomHashTable
pt | CreateNewNode
pt | AddNode
pt | ChainLength
pt | FindOrCreateNew
pt | SetHashFunction
pt | FindChainForAdd
 | Create
 | CreateWith
 | Destroy
 | ChangeTableSize
 | Clear
 | Delete
 | Find
 | IsEmpty


pt | AddNode (TFPCustomHashTable)
pt | AddNode (TFPDataHashTable)
pt | ChainLength (TFPCustomHashTable)
 | ChangeTableSize (TFPCustomHashTable)
 | Clear (TFPCustomHashTable)
 | Create (TFPCustomHashTable)
pt | CreateNewNode (TFPCustomHashTable)
pt | CreateNewNode (TFPDataHashTable)
 | CreateWith (TFPCustomHashTable)
 | Delete (TFPCustomHashTable)
 | Destroy (TFPCustomHashTable)
 | Find (TFPCustomHashTable)
pt | FindChainForAdd (TFPCustomHashTable)
pt | FindOrCreateNew (TFPCustomHashTable)
pt | ForEachCall (TFPDataHashTable)
pt | GetData (TFPDataHashTable)
 | IsEmpty (TFPCustomHashTable)
pt | SetData (TFPDataHashTable)
pt | SetHashFunction (TFPCustomHashTable)


TFPDataHashTable

TFPCustomHashTable


TFPDataHashTable.Add

Add a data pointer to the list.

Declaration

Source position: contnrs.pp line 418

public procedure TFPDataHashTable.Add(

  const aKey: String;

  AItem: pointer

); virtual;

Arguments

aKey | Key to insert in the hash table
AItem | Data pointer associated with AKey.

Description

Add adds a data pointer (AItem) to the list with key AKey.

Errors

If AKey already exists in the table, an exception is raised.

See also

TFPDataHashTable.Items

Key-based access to the items in the table


TFPDataHashTable.AddNode

Declaration

Source position: contnrs.pp line 413

protected procedure TFPDataHashTable.AddNode(

  ANode: THTCustomNode

); override;


TFPDataHashTable.CreateNewNode

Declaration

Source position: contnrs.pp line 412

protected function TFPDataHashTable.CreateNewNode(

  const aKey: String

):THTCustomNode; override;


TFPDataHashTable.ForEachCall

Declaration

Source position: contnrs.pp line 416

protected function TFPDataHashTable.ForEachCall(

  aMethod: TDataIteratorMethod

):THTDataNode; virtual;


TFPDataHashTable.GetData

Declaration

Source position: contnrs.pp line 415

protected function TFPDataHashTable.GetData(

  const index: String

):Pointer; virtual;


TFPDataHashTable.Items

Key-based access to the items in the table

Declaration

Source position: contnrs.pp line 419

public property TFPDataHashTable.Items: Pointer
  read GetData
  write SetData;
  default;

Description

Items provides access to the items in the hash table using their key: the array index Index is the key. A key which is not present will result in an Nil pointer.

See also

TFPStringHashTable.Add

Add a new string to the hash list


TFPDataHashTable.SetData

Declaration

Source position: contnrs.pp line 414

protected procedure TFPDataHashTable.SetData(

  const index: String;

  const AValue: Pointer

); virtual;


TFPHashList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash list class for pointer data

Declaration

Source position: contnrs.pp line 204

type TFPHashList = class(TObject)
protected
function Get();
procedure Put();
procedure SetCapacity();
procedure SetCount();
procedure RaiseIndexError();
function AddStr();
procedure AddToHashTable();
procedure StrExpand();
procedure SetStrCapacity();
procedure SetHashCapacity();
procedure ReHash;
public
constructor Create; | Create a new instance of the hashlist
destructor Destroy; override; | Removes an instance of the hashlist from the heap
function Add(); | Add a new key/data pair to the list
procedure Clear; | Clear the list
function NameOfIndex(); | Returns the key name of an item by index
function HashOfIndex(); | Return the hash valye of an item by index
function GetNextCollision(); | Get next collision number
procedure Delete(); | Delete an item from the list.
procedure Error(); | Raise an error
function Expand; | Expand the list
function Extract(); | Extract a pointer from the list
function IndexOf(); | Return the index of the data pointer
function Find(); | Find data associated with key
function FindIndexOf(); | Return index of named item.
function FindWithHash(); | Find first element with given name and hash value
function Rename(); | Rename a key
function Remove(); | Remove first instance of a pointer
procedure Pack; | Remove nil pointers from the list
procedure ShowStatistics; | Return some statistics for the list.
procedure ForEachCall(); | Call a procedure for each element in the list
property Capacity: Integer; [rw] | Capacity of the list.
property Count: Integer; [rw] | Current number of elements in the list.
property Items: Pointer; default; [rw] | Indexed array with pointers
property List: PHashItemList; [r] | Low-level hash list
property Strs: PChar; [r] | Low-level memory area with strings.
end;

Inheritance

TFPHashList

Hash list class for pointer data
|

TObject

Description

TFPHashList implements a fast hash class. The class is built for speed, therefore the key values can be shortstrings only, and the data can only be pointers.

if a base class for an own hash class is wanted, the TFPCustomHashTable class can be used. If a hash class for objects is needed instead of pointers, the TFPHashObjectList class can be used.

See also

TFPCustomHashTable | Hash class
TFPHashObjectList
TFPDataHashTable | Hash table for data pointers
TFPStringHashTable | Hash table for string data.


TFPHashList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List
 | ro | Strs


ro | List (TFPHashList)
ro | Strs (TFPHashList)


TFPHashList
pt | Get
pt | Put
pt | SetCapacity
pt | SetCount
pt | RaiseIndexError
pt | AddStr
pt | AddToHashTable
pt | StrExpand
pt | SetStrCapacity
pt | SetHashCapacity
pt | ReHash
 | Create
 | Destroy
 | Add
 | Clear
 | NameOfIndex
 | HashOfIndex
 | GetNextCollision
 | Delete
 | Error
 | Expand
 | Extract
 | IndexOf
 | Find
 | FindIndexOf
 | FindWithHash
 | Rename
 | Remove
 | Pack
 | ShowStatistics
 | ForEachCall


pt | AddStr (TFPHashList)
pt | AddToHashTable (TFPHashList)
 | Clear (TFPHashList)
 | Create (TFPHashList)
 | Delete (TFPHashList)
 | Destroy (TFPHashList)
 | Error (TFPHashList)
 | Expand (TFPHashList)
 | Extract (TFPHashList)
 | Find (TFPHashList)
 | FindIndexOf (TFPHashList)
 | FindWithHash (TFPHashList)
 | ForEachCall (TFPHashList)
pt | Get (TFPHashList)
 | GetNextCollision (TFPHashList)
 | HashOfIndex (TFPHashList)
 | IndexOf (TFPHashList)
 | NameOfIndex (TFPHashList)
 | Pack (TFPHashList)
pt | Put (TFPHashList)
pt | RaiseIndexError (TFPHashList)
pt | ReHash (TFPHashList)
 | Remove (TFPHashList)
 | Rename (TFPHashList)
pt | SetCapacity (TFPHashList)
pt | SetCount (TFPHashList)
pt | SetHashCapacity (TFPHashList)
pt | SetStrCapacity (TFPHashList)
 | ShowStatistics (TFPHashList)
pt | StrExpand (TFPHashList)


TFPHashList


TFPHashList.Add

Add a new key/data pair to the list

Declaration

Source position: contnrs.pp line 233

public function TFPHashList.Add(

  const AName: shortstring;

  Item: Pointer

):Integer;

Arguments

AName | Key name associated with data.
Item | Data pointer

Function result

Position of the new item in the list

Description

Add adds a new data pointer (Item) with key AName to the list. It returns the position of the item in the list.

Errors

If not enough memory is available to hold the key and data, an exception may be raised. If an item with this name already exists in the list, an exception is raised.

See also

TFPHashList.Extract | Extract a pointer from the list
TFPHashList.Remove | Remove first instance of a pointer
TFPHashList.Delete | Delete an item from the list.


TFPHashList.AddStr

Declaration

Source position: contnrs.pp line 224

protected function TFPHashList.AddStr(

  const s: shortstring

):Integer;


TFPHashList.AddToHashTable

Declaration

Source position: contnrs.pp line 225

protected procedure TFPHashList.AddToHashTable(

  Index: Integer

);


TFPHashList.Capacity

Capacity of the list.

Declaration

Source position: contnrs.pp line 252

public property TFPHashList.Capacity: Integer
  read FCapacity
  write SetCapacity;

Description

Capacity returns the current capacity of the list. The capacity is expanded as more elements are added to the list. If a good estimate of the number of elements that will be added to the list, the property can be set to a sufficiently large value to avoid reallocation of memory each time the list needs to grow.

See also

Count | Current number of elements in the list.
Items | Indexed array with pointers


TFPHashList.Clear

Clear the list

Declaration

Source position: contnrs.pp line 234

public procedure TFPHashList.Clear;

Description

Clear removes all items from the list. It does not free the data items themselves. It frees all memory needed to contain the items.

Errors

None.

See also

TFPHashList.Extract | Extract a pointer from the list
TFPHashList.Remove | Remove first instance of a pointer
TFPHashList.Delete | Delete an item from the list.
TFPHashList.Add | Add a new key/data pair to the list


TFPHashList.Count

Current number of elements in the list.

Declaration

Source position: contnrs.pp line 253

public property TFPHashList.Count: Integer
  read FCount
  write SetCount;

Description

Count is the current number of elements in the list.

See also

Capacity | Capacity of the list.
Items | Indexed array with pointers


TFPHashList.Create

Create a new instance of the hashlist

Declaration

Source position: contnrs.pp line 231

public constructor TFPHashList.Create;

Description

Create creates a new instance of TFPHashList on the heap and sets the hash capacity to 1.

See also

TFPHashList.Destroy

Removes an instance of the hashlist from the heap


TFPHashList.Delete

Delete an item from the list.

Declaration

Source position: contnrs.pp line 238

public procedure TFPHashList.Delete(

  Index: Integer

);

Arguments

Index

Index of item to remove from the list

Description

Delete deletes the item at position Index. The data to which it points is not freed from memory.

Errors

TFPHashList.Extract TFPHashList.Remove TFPHashList.Add


TFPHashList.Destroy

Removes an instance of the hashlist from the heap

Declaration

Source position: contnrs.pp line 232

public destructor TFPHashList.Destroy; override;

Description

Destroy cleans up the memory structures maintained by the hashlist and removes the TFPHashList instance from the heap.

Destroy should not be called directly, it's better to use Free or FreeAndNil instead.

See also

TFPHashList.Create | Create a new instance of the hashlist
TFPHashList.Clear | Clear the list


TFPHashList.Error

Raise an error

Declaration

Source position: contnrs.pp line 239

public procedure TFPHashList.Error(

  const Msg: String;

  Data: PtrInt

);

Arguments

Msg | Message string
Data | Data pointer

Description

Error raises an EListError exception, with message Msg. The Data pointer is used to format the message.


TFPHashList.Expand

Expand the list

Declaration

Source position: contnrs.pp line 240

public function TFPHashList.Expand: TFPHashList;

Function result

Returns self

Description

Expand enlarges the capacity of the list if the maximum capacity was reached. It returns itself.

Errors

If not enough memory is available, an exception may be raised.

See also

TFPHashList.Clear

Clear the list


TFPHashList.Extract

Extract a pointer from the list

Declaration

Source position: contnrs.pp line 241

public function TFPHashList.Extract(

  item: Pointer

):Pointer;

Arguments

item

Pointer to be removed.

Function result

The removed pointer or nil.

Description

Extract removes the data item from the list, if it is in the list. It returns the pointer if it was removed from the list, Nil otherwise.

Extract does a linear search, and is not very efficient.

See also

TFPHashList.Delete | Delete an item from the list.
TFPHashList.Remove | Remove first instance of a pointer
TFPHashList.Clear | Clear the list


TFPHashList.Find

Find data associated with key

Declaration

Source position: contnrs.pp line 243

public function TFPHashList.Find(

  const AName: shortstring

):Pointer;

Arguments

AName

Key name to search for.

Function result

Data associated with AName or Nil if it does not exist.

Description

Find searches (using the hash) for the data item associated with item AName and returns the data pointer associated with it. If the item is not found, Nil is returned. It uses the hash value of the key to perform the search.

See also

TFPHashList.HashOfIndex | Return the hash valye of an item by index
TFPHashList.NameOfIndex | Returns the key name of an item by index
TFPHashList.IndexOf | Return the index of the data pointer
TFPHashList.FindIndexOf | Return index of named item.
TFPHashList.FindWithHash | Find first element with given name and hash value


TFPHashList.FindIndexOf

Return index of named item.

Declaration

Source position: contnrs.pp line 244

public function TFPHashList.FindIndexOf(

  const AName: shortstring

):Integer;

Arguments

AName

Key value to look for

Function result

Index of the key

Description

FindIndexOf returns the index of the key AName, or -1 if the key does not exist in the list. It uses the hash value to search for the key.

See also

TFPHashList.HashOfIndex | Return the hash valye of an item by index
TFPHashList.NameOfIndex | Returns the key name of an item by index
TFPHashList.IndexOf | Return the index of the data pointer
TFPHashList.Find | Find data associated with key
TFPHashList.FindWithHash | Find first element with given name and hash value


TFPHashList.FindWithHash

Find first element with given name and hash value

Declaration

Source position: contnrs.pp line 245

public function TFPHashList.FindWithHash(

  const AName: shortstring;

  AHash: LongWord

):Pointer;

Arguments

AName | Key value to search for.
AHash | Hash value of the key AName

Function result

Data pointer associated with key AName

Description

FindWithHash searches for the item with key AName. It uses the provided hash value AHash to perform the search. If the item exists, the data pointer is returned, if not, the result is Nil.

See also

TFPHashList.HashOfIndex | Return the hash valye of an item by index
TFPHashList.NameOfIndex | Returns the key name of an item by index
TFPHashList.IndexOf | Return the index of the data pointer
TFPHashList.Find | Find data associated with key
TFPHashList.FindIndexOf | Return index of named item.


TFPHashList.ForEachCall

Call a procedure for each element in the list

Declaration

Source position: line 0

public procedure TFPHashList.ForEachCall(

  proc2call: TListCallback;

  arg: pointer

);

procedure TFPHashList.ForEachCall(

  proc2call: TListStaticCallback;

  arg: pointer

);

Arguments

proc2call | Callback procedure
arg | Additional argument passed to proc2call

Arguments

proc2call | Callback procedure
arg | Additional argument passed to proc2call

Description

ForEachCall loops over the items in the list and calls proc2call, passing it the item and arg.


TFPHashList.Get

Declaration

Source position: contnrs.pp line 219

protected function TFPHashList.Get(

  Index: Integer

):Pointer;


TFPHashList.GetNextCollision

Get next collision number

Declaration

Source position: contnrs.pp line 237

public function TFPHashList.GetNextCollision(

  Index: Integer

):Integer;

Arguments

Index

Index of hash item

Description

GetNextCollision returns the next collision in hash item Index. This is the count of items with the same hash.means that the next it


TFPHashList.HashOfIndex

Return the hash valye of an item by index

Declaration

Source position: contnrs.pp line 236

public function TFPHashList.HashOfIndex(

  Index: Integer

):LongWord;

Arguments

Index

Index of item for which to return hash value

Function result

Hash value of item Index

Description

HashOfIndex returns the hash value of the item at position Index.

Errors

If Index is out of the valid range, an exception is raised.

See also

TFPHashList.HashOfName
TFPHashList.Find | Find data associated with key
TFPHashList.FindIndexOf | Return index of named item.
TFPHashList.FindWithHash | Find first element with given name and hash value


TFPHashList.IndexOf

Return the index of the data pointer

Declaration

Source position: contnrs.pp line 242

public function TFPHashList.IndexOf(

  Item: Pointer

):Integer;

Arguments

Item

Data pointer to search for.

Function result

Index of Item in the list.

Description

IndexOf returns the index of the first occurrence of pointer Item. If the item is not in the list, -1 is returned.

The performed search is linear, and not very efficient.

See also

TFPHashList.HashOfIndex | Return the hash valye of an item by index
TFPHashList.NameOfIndex | Returns the key name of an item by index
TFPHashList.Find | Find data associated with key
TFPHashList.FindIndexOf | Return index of named item.
TFPHashList.FindWithHash | Find first element with given name and hash value


TFPHashList.Items

Indexed array with pointers

Declaration

Source position: contnrs.pp line 254

public property TFPHashList.Items: Pointer
  read Get
  write Put;
  default;

Description

Items provides indexed access to the pointers, the index runs from 0 to Count-1.

Errors

Specifying an invalid index will result in an exception.

See also

Capacity | Capacity of the list.
Count | Current number of elements in the list.


TFPHashList.List

Low-level hash list

Declaration

Source position: contnrs.pp line 255

public property TFPHashList.List: PHashItemList
  read FHashList;

Description

List exposes the low-level item list. It should not be used directly.

See also

Strs | Low-level memory area with strings.
THashItemList | array of THashItem records.


TFPHashList.NameOfIndex

Returns the key name of an item by index

Declaration

Source position: contnrs.pp line 235

public function TFPHashList.NameOfIndex(

  Index: Integer

):ShortString;

Arguments

Index

Index of item for which to return name

Function result

Key name of item Index

Description

NameOfIndex returns the key name of the item at position Index.

Errors

If Index is out of the valid range, an exception is raised.

See also

TFPHashList.HashOfIndex | Return the hash valye of an item by index
TFPHashList.Find | Find data associated with key
TFPHashList.FindIndexOf | Return index of named item.
TFPHashList.FindWithHash | Find first element with given name and hash value


TFPHashList.Pack

Remove nil pointers from the list

Declaration

Source position: contnrs.pp line 248

public procedure TFPHashList.Pack;

Description

Pack removes all Nil items from the list, and frees all unused memory.

See also

TFPHashList.Clear

Clear the list


TFPHashList.Put

Declaration

Source position: contnrs.pp line 220

protected procedure TFPHashList.Put(

  Index: Integer;

  Item: Pointer

);


TFPHashList.RaiseIndexError

Declaration

Source position: contnrs.pp line 223

protected procedure TFPHashList.RaiseIndexError(

  Index: Integer

);


TFPHashList.ReHash

Declaration

Source position: contnrs.pp line 229

protected procedure TFPHashList.ReHash;


TFPHashList.Remove

Remove first instance of a pointer

Declaration

Source position: contnrs.pp line 247

public function TFPHashList.Remove(

  Item: Pointer

):Integer;

Arguments

Item

Item to remove from the list.

Function result

Data pointer which was removed

Description

Remove removes the first occurence of the data pointer Item in the list, if it is present. The return value is the removed data pointer, or Nil if no data pointer was removed.

See also

TFPHashList.Delete | Delete an item from the list.
TFPHashList.Clear | Clear the list
TFPHashList.Extract | Extract a pointer from the list


TFPHashList.Rename

Rename a key

Declaration

Source position: contnrs.pp line 246

public function TFPHashList.Rename(

  const AOldName: shortstring;

  const ANewName: shortstring

):Integer;

Arguments

AOldName | Key to rename
ANewName | New name of key

Function result

New position in the list

Description

Rename renames key AOldname to ANewName. The hash value is recomputed and the item is moved in the list to it's new position.

Errors

If an item with ANewName already exists, an exception will be raised.


TFPHashList.SetCapacity

Declaration

Source position: contnrs.pp line 221

protected procedure TFPHashList.SetCapacity(

  NewCapacity: Integer

);


TFPHashList.SetCount

Declaration

Source position: contnrs.pp line 222

protected procedure TFPHashList.SetCount(

  NewCount: Integer

);


TFPHashList.SetHashCapacity

Declaration

Source position: contnrs.pp line 228

protected procedure TFPHashList.SetHashCapacity(

  NewCapacity: Integer

);


TFPHashList.SetStrCapacity

Declaration

Source position: contnrs.pp line 227

protected procedure TFPHashList.SetStrCapacity(

  NewCapacity: Integer

);


TFPHashList.ShowStatistics

Return some statistics for the list.

Declaration

Source position: contnrs.pp line 249

public procedure TFPHashList.ShowStatistics;

Description

ShowStatistics prints some information about the hash list to standard output. It prints the following values:

HashSize
Size of the hash table
HashMean
Mean hash value
HashStdDev
Standard deviation of hash values
ListSize
Size and capacity of the list
StringSize
Size and capacity of key strings


TFPHashList.StrExpand

Declaration

Source position: contnrs.pp line 226

protected procedure TFPHashList.StrExpand(

  MinIncSize: Integer

);


TFPHashList.Strs

Low-level memory area with strings.

Declaration

Source position: contnrs.pp line 256

public property TFPHashList.Strs: PChar
  read FStrs;

Description

Strs exposes the raw memory area with the strings.

See also

List

Low-level hash list


TFPHashObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash-list aware object

Declaration

Source position: contnrs.pp line 268

type TFPHashObject = class
protected
function GetName; virtual;
function GetHash; virtual;
public
constructor CreateNotOwned; | Create an instance not owned by any list.
constructor Create(); | Create a named instance, and insert in a hash list.
procedure ChangeOwner(); | Change the list owning the object.
procedure ChangeOwnerAndName(); | Simultaneously change the list owning the object and the name of the object.
procedure Rename(); | Rename the object
property Name: shortstring; [r] | Current name of the object
property Hash: LongWord; [r] | Hash value
end;

Inheritance

TFPHashObject

Hash-list aware object
|

TObject

Description

TFPHashObject is a TObject descendent which is aware of the TFPHashObjectList class. It has a name property and an owning list: if the name is changed, it will reposition itself in the list which owns it. It offers methods to change the owning list: the object will correctly remove itself from the list which currently owns it, and insert itself in the new list.

See also

TFPHashObject.Name | Current name of the object
TFPHashObject.ChangeOwner | Change the list owning the object.
TFPHashObject.ChangeOwnerAndName | Simultaneously change the list owning the object and the name of the object.


TFPHashObject
 | ro | Name
 | ro | Hash


ro | Hash (TFPHashObject)
ro | Name (TFPHashObject)


TFPHashObject
pt | GetName
pt | GetHash
 | CreateNotOwned
 | Create
 | ChangeOwner
 | ChangeOwnerAndName
 | Rename


 | ChangeOwner (TFPHashObject)
 | ChangeOwnerAndName (TFPHashObject)
 | Create (TFPHashObject)
 | CreateNotOwned (TFPHashObject)
pt | GetHash (TFPHashObject)
pt | GetName (TFPHashObject)
 | Rename (TFPHashObject)


TFPHashObject


TFPHashObject.ChangeOwner

Change the list owning the object.

Declaration

Source position: contnrs.pp line 280

public procedure TFPHashObject.ChangeOwner(

  HashObjectList: TFPHashObjectList

);

Arguments

HashObjectList

Hash list in which to insert object.

Description

ChangeOwner can be used to move the object between hash lists: The object will be removed correctly from the hash list that currently owns it, and will be inserted in the list HashObjectList.

Errors

If an object with the same name already is present in the new hash list, an exception will be raised.

See also

ChangeOwnerAndName | Simultaneously change the list owning the object and the name of the object.
Name | Current name of the object


TFPHashObject.ChangeOwnerAndName

Simultaneously change the list owning the object and the name of the object.

Declaration

Source position: contnrs.pp line 281

public procedure TFPHashObject.ChangeOwnerAndName(

  HashObjectList: TFPHashObjectList;

  const s: shortstring

);

Arguments

HashObjectList | Hash list in which to insert object.
s | New name with which to insert object.

Description

ChangeOwnerAndName can be used to move the object between hash lists: The object will be removed correctly from the hash list that currently owns it (using the current name), and will be inserted in the list HashObjectList with the new name S.

Errors

If the new name already is present in the new hash list, an exception will be raised.

See also

ChangeOwner | Change the list owning the object.
Name | Current name of the object


TFPHashObject.Create

Create a named instance, and insert in a hash list.

Declaration

Source position: contnrs.pp line 279

public constructor TFPHashObject.Create(

  HashObjectList: TFPHashObjectList;

  const s: shortstring

);

Arguments

HashObjectList | Hash list to which the object should be added.
s | Name for the object

Description

Create creates an instance of TFPHashObject, gives it the name S and inserts it in the hash list HashObjectList.

See also

CreateNotOwned | Create an instance not owned by any list.
TFPHashObject.ChangeOwner | Change the list owning the object.
TFPHashObject.Name | Current name of the object


TFPHashObject.CreateNotOwned

Create an instance not owned by any list.

Declaration

Source position: contnrs.pp line 278

public constructor TFPHashObject.CreateNotOwned;

Description

CreateNotOwned creates an instance of TFPHashObject which is not owned by any TFPHashObjectList hash list. It also has no name when created in this way.

See also

TFPHashObject.Name | Current name of the object
TFPHashObject.ChangeOwner | Change the list owning the object.
TFPHashObject.ChangeOwnerAndName | Simultaneously change the list owning the object and the name of the object.


TFPHashObject.GetHash

Declaration

Source position: contnrs.pp line 276

protected function TFPHashObject.GetHash: LongWord; virtual;


TFPHashObject.GetName

Declaration

Source position: contnrs.pp line 275

protected function TFPHashObject.GetName: shortstring; virtual;


TFPHashObject.Hash

Hash value

Declaration

Source position: contnrs.pp line 284

public property TFPHashObject.Hash: LongWord
  read GetHash;

Description

Hash is the hash value of the object in the hash list that owns it.

See also

Name

Current name of the object


TFPHashObject.Name

Current name of the object

Declaration

Source position: contnrs.pp line 283

public property TFPHashObject.Name: shortstring
  read GetName;

Description

Name is the name of the object, it is stored in the hash list using this name as the key.

See also

Rename | Rename the object
ChangeOwnerAndName | Simultaneously change the list owning the object and the name of the object.


TFPHashObject.Rename

Rename the object

Declaration

Source position: contnrs.pp line 282

public procedure TFPHashObject.Rename(

  const ANewName: shortstring

);

Arguments

ANewName

New name for the object

Description

Rename changes the name of the object, and notifies the hash list of this change.

Errors

If the new name already is present in the hash list, an exception will be raised.

See also

ChangeOwner | Change the list owning the object.
ChangeOwnerAndName | Simultaneously change the list owning the object and the name of the object.
Name | Current name of the object


TFPHashObjectList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: contnrs.pp line 287

type TFPHashObjectList = class(TObject)
protected
function GetItem();
procedure SetItem();
procedure SetCapacity();
function GetCapacity;
public
constructor Create(); | Create a new instance of the hashlist
destructor Destroy; override; | Removes an instance of the hashlist from the heap
procedure Clear; | Clear the list
function Add(); | Add a new key/data pair to the list
function NameOfIndex(); | Returns the key name of an object by index
function HashOfIndex(); | Return the hash valye of an object by index
function GetNextCollision(); | Get next collision number
procedure Delete(); | Delete an object from the list.
function Expand; | Expand the list
function Extract(); | Extract a object instance from the list
function Remove(); | Remove first occurrence of a object instance
function IndexOf(); | Return the index of the object instance
function Find(); | Find data associated with key
function FindIndexOf(); | Return index of named object.
function FindWithHash(); | Find first element with given name and hash value
function Rename(); | Rename a key
function FindInstanceOf(); | Search an instance of a certain class
procedure Pack; | Remove nil object instances from the list
procedure ShowStatistics; | Return some statistics for the list.
procedure ForEachCall(); | Call a procedure for each object in the list
property Capacity: Integer; [rw] | Capacity of the list.
property Count: Integer; [rw] | Current number of elements in the list.
property OwnsObjects: Boolean; [rw] | Does the list own the objects it contains
property Items: TObject; default; [rw] | Indexed array with object instances
property List: TFPHashList; [r] | Low-level hash list
end;

Inheritance

TFPHashObjectList
|

TObject


TFPHashObjectList
 |  | Capacity
 |  | Count
 |  | OwnsObjects
 |  | Items
 | ro | List


ro | List (TFPHashObjectList)
 | OwnsObjects (TFPHashObjectList)


TFPHashObjectList
pt | GetItem
pt | SetItem
pt | SetCapacity
pt | GetCapacity
 | Create
 | Destroy
 | Clear
 | Add
 | NameOfIndex
 | HashOfIndex
 | GetNextCollision
 | Delete
 | Expand
 | Extract
 | Remove
 | IndexOf
 | Find
 | FindIndexOf
 | FindWithHash
 | Rename
 | FindInstanceOf
 | Pack
 | ShowStatistics
 | ForEachCall


 | Add (TFPHashObjectList)
 | Clear (TFPHashObjectList)
 | Create (TFPHashObjectList)
 | Delete (TFPHashObjectList)
 | Destroy (TFPHashObjectList)
 | Expand (TFPHashObjectList)
 | Extract (TFPHashObjectList)
 | Find (TFPHashObjectList)
 | FindIndexOf (TFPHashObjectList)
 | FindInstanceOf (TFPHashObjectList)
 | FindWithHash (TFPHashObjectList)
 | ForEachCall (TFPHashObjectList)
pt | GetCapacity (TFPHashObjectList)
pt | GetItem (TFPHashObjectList)
 | GetNextCollision (TFPHashObjectList)
 | HashOfIndex (TFPHashObjectList)
 | IndexOf (TFPHashObjectList)
 | NameOfIndex (TFPHashObjectList)
 | Pack (TFPHashObjectList)
 | Remove (TFPHashObjectList)
 | Rename (TFPHashObjectList)
pt | SetCapacity (TFPHashObjectList)
pt | SetItem (TFPHashObjectList)
 | ShowStatistics (TFPHashObjectList)


TFPHashObjectList


TFPHashObjectList.Add

Add a new key/data pair to the list

Declaration

Source position: contnrs.pp line 302

public function TFPHashObjectList.Add(

  const AName: shortstring;

  AObject: TObject

):Integer;

Arguments

AName | Key name associated with object instance.
AObject | object instance

Function result

Position of the new object in the list

Description

Add adds a new object instance (AObject) with key AName to the list. It returns the position of the object in the list.

Errors

If not enough memory is available to hold the key and data, an exception may be raised. If an object with this name already exists in the list, an exception is raised.

See also

TFPHashObjectList.Extract | Extract a object instance from the list
TFPHashObjectList.Remove | Remove first occurrence of a object instance
TFPHashObjectList.Delete | Delete an object from the list.


TFPHashObjectList.Capacity

Capacity of the list.

Declaration

Source position: contnrs.pp line 320

public property TFPHashObjectList.Capacity: Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity returns the current capacity of the list. The capacity is expanded as more elements are added to the list. If a good estimate of the number of elements that will be added to the list, the property can be set to a sufficiently large value to avoid reallocation of memory each time the list needs to grow.

See also

Count | Current number of elements in the list.
Items | Indexed array with object instances


TFPHashObjectList.Clear

Clear the list

Declaration

Source position: contnrs.pp line 301

public procedure TFPHashObjectList.Clear;

Description

Clear removes all objects from the list. It does not free the objects themselves, unless OwnsObjects is True. It always frees all memory needed to contain the objects.

Errors

None.

See also

TFPHashObjectList.Extract | Extract a object instance from the list
TFPHashObjectList.Remove | Remove first occurrence of a object instance
TFPHashObjectList.Delete | Delete an object from the list.
TFPHashObjectList.Add | Add a new key/data pair to the list


TFPHashObjectList.Count

Current number of elements in the list.

Declaration

Source position: contnrs.pp line 321

public property TFPHashObjectList.Count: Integer
  read GetCount
  write SetCount;

Description

Count is the current number of elements in the list.

See also

Capacity | Capacity of the list.
Items | Indexed array with object instances


TFPHashObjectList.Create

Create a new instance of the hashlist

Declaration

Source position: contnrs.pp line 299

public constructor TFPHashObjectList.Create(

  FreeObjects: Boolean = true

);

Arguments

FreeObjects

Does the list own the objects

Description

Create creates a new instance of TFPHashObjectList on the heap and sets the hash capacity to 1.

If FreeObjects is True (the default), then the list owns the objects: when an object is removed from the list, it is destroyed (freed from memory). Clearing the list will free all objects in the list.

See also

TFPHashObjectList.Destroy | Removes an instance of the hashlist from the heap
TFPHashObjectList.OwnsObjects | Does the list own the objects it contains


TFPHashObjectList.Delete

Delete an object from the list.

Declaration

Source position: contnrs.pp line 306

public procedure TFPHashObjectList.Delete(

  Index: Integer

);

Arguments

Index

Index of object to remove from the list

Description

Delete deletes the object at position Index. If OwnsObjects is True, then the object itself is also freed from memory.

See also

TFPHashObjectList.Extract | Extract a object instance from the list
TFPHashObjectList.Remove | Remove first occurrence of a object instance
TFPHashObjectList.Add | Add a new key/data pair to the list
OwnsObjects | Does the list own the objects it contains


TFPHashObjectList.Destroy

Removes an instance of the hashlist from the heap

Declaration

Source position: contnrs.pp line 300

public destructor TFPHashObjectList.Destroy; override;

Description

Destroy cleans up the memory structures maintained by the hashlist and removes the TFPHashObjectList instance from the heap. If the list owns its objects, they are freed from memory as well.

Destroy should not be called directly, it's better to use Free or FreeAndNil instead.

See also

TFPHashObjectList.Create | Create a new instance of the hashlist
TFPHashObjectList.Clear | Clear the list


TFPHashObjectList.Expand

Expand the list

Declaration

Source position: contnrs.pp line 307

public function TFPHashObjectList.Expand: TFPHashObjectList;

Function result

Returns self

Description

Expand enlarges the capacity of the list if the maximum capacity was reached. It returns itself.

Errors

If not enough memory is available, an exception may be raised.

See also

TFPHashObjectList.Clear

Clear the list


TFPHashObjectList.Extract

Extract a object instance from the list

Declaration

Source position: contnrs.pp line 308

public function TFPHashObjectList.Extract(

  Item: TObject

):TObject;

Arguments

Item

Object instance to be removed.

Function result

The removed object instance or nil.

Description

Extract removes the data object from the list, if it is in the list. It returns the object instance if it was removed from the list, Nil otherwise. The object is not freed from memory, regardless of the value of OwnsObjects.

Extract does a linear search, and is not very efficient.

See also

TFPHashObjectList.Delete | Delete an object from the list.
TFPHashObjectList.Remove | Remove first occurrence of a object instance
TFPHashObjectList.Clear | Clear the list


TFPHashObjectList.Find

Find data associated with key

Declaration

Source position: contnrs.pp line 311

public function TFPHashObjectList.Find(

  const s: shortstring

):TObject;

Arguments

s

Key name to search for.

Function result

Object associated with AName or Nil if it does not exist.

Description

Find searches (using the hash) for the data object associated with key AName and returns the data object instance associated with it. If the object is not found, Nil is returned. It uses the hash value of the key to perform the search.

See also

TFPHashObjectList.HashOfIndex | Return the hash valye of an object by index
TFPHashObjectList.NameOfIndex | Returns the key name of an object by index
TFPHashObjectList.IndexOf | Return the index of the object instance
TFPHashObjectList.FindIndexOf | Return index of named object.
TFPHashObjectList.FindWithHash | Find first element with given name and hash value


TFPHashObjectList.FindIndexOf

Return index of named object.

Declaration

Source position: contnrs.pp line 312

public function TFPHashObjectList.FindIndexOf(

  const s: shortstring

):Integer;

Arguments

s

Key value to look for

Function result

Index of the key

Description

FindIndexOf returns the index of the key AName, or -1 if the key does not exist in the list. It uses the hash value to search for the key.

See also

TFPHashObjectList.HashOfIndex | Return the hash valye of an object by index
TFPHashObjectList.NameOfIndex | Returns the key name of an object by index
TFPHashObjectList.IndexOf | Return the index of the object instance
TFPHashObjectList.Find | Find data associated with key
TFPHashObjectList.FindWithHash | Find first element with given name and hash value


TFPHashObjectList.FindInstanceOf

Search an instance of a certain class

Declaration

Source position: contnrs.pp line 315

public function TFPHashObjectList.FindInstanceOf(

  AClass: TClass;

  AExact: Boolean;

  AStartAt: Integer

):Integer;

Arguments

AClass | Class to search for.
AExact | Should the class match exactly, or also consider descendents
AStartAt | Position in list to start search.

Function result

First instance of AClass after position AStartAt

Description

FindInstanceOf searches the list for an instance of class AClass. It starts searching at position AStartAt. If AExact is True, only instances of class AClass are considered. If AExact is False, then descendent classes of AClass are also taken into account when searching. If no instance is found, Nil is returned.


TFPHashObjectList.FindWithHash

Find first element with given name and hash value

Declaration

Source position: contnrs.pp line 313

public function TFPHashObjectList.FindWithHash(

  const AName: shortstring;

  AHash: LongWord

):Pointer;

Arguments

AName | Key value to search for.
AHash | Hash value of the key AName

Function result

Object instance associated with key AName

Description

FindWithHash searches for the object with key AName. It uses the provided hash value AHash to perform the search. If the object exists, the data object instance is returned, if not, the result is Nil.

See also

TFPHashObjectList.HashOfIndex | Return the hash valye of an object by index
TFPHashObjectList.NameOfIndex | Returns the key name of an object by index
TFPHashObjectList.IndexOf | Return the index of the object instance
TFPHashObjectList.Find | Find data associated with key
TFPHashObjectList.FindIndexOf | Return index of named object.


TFPHashObjectList.ForEachCall

Call a procedure for each object in the list

Declaration

Source position: line 0

public procedure TFPHashObjectList.ForEachCall(

  proc2call: TObjectListCallback;

  arg: pointer

);

procedure TFPHashObjectList.ForEachCall(

  proc2call: TObjectListStaticCallback;

  arg: pointer

);

Arguments

proc2call | Callback procedure
arg | Additional argument passed to proc2call

Arguments

proc2call | Callback procedure
arg | Additional argument passed to proc2call

Description

ForEachCall loops over the objects in the list and calls proc2call, passing it the object and arg.


TFPHashObjectList.GetCapacity

Declaration

Source position: contnrs.pp line 297

protected function TFPHashObjectList.GetCapacity: Integer;


TFPHashObjectList.GetItem

Declaration

Source position: contnrs.pp line 294

protected function TFPHashObjectList.GetItem(

  Index: Integer

):TObject;


TFPHashObjectList.GetNextCollision

Get next collision number

Declaration

Source position: contnrs.pp line 305

public function TFPHashObjectList.GetNextCollision(

  Index: Integer

):Integer;

Arguments

Index

Index of hash item


TFPHashObjectList.HashOfIndex

Return the hash valye of an object by index

Declaration

Source position: contnrs.pp line 304

public function TFPHashObjectList.HashOfIndex(

  Index: Integer

):LongWord;

Arguments

Index

Index of object for which to return hash value

Function result

Hash value of object at position Index

Description

HashOfIndex returns the hash value of the object at position Index.

Errors

If Index is out of the valid range, an exception is raised.

See also

TFPHashObjectList.HashOfName
TFPHashObjectList.Find | Find data associated with key
TFPHashObjectList.FindIndexOf | Return index of named object.
TFPHashObjectList.FindWithHash | Find first element with given name and hash value


TFPHashObjectList.IndexOf

Return the index of the object instance

Declaration

Source position: contnrs.pp line 310

public function TFPHashObjectList.IndexOf(

  AObject: TObject

):Integer;

Arguments

AObject

Data object instance to search for.

Function result

Index of Item in the list.

Description

IndexOf returns the index of the first occurrence of object instance AObject. If the object is not in the list, -1 is returned.

The performed search is linear, and not very efficient.

See also

TFPHashObjectList.HashOfIndex | Return the hash valye of an object by index
TFPHashObjectList.NameOfIndex | Returns the key name of an object by index
TFPHashObjectList.Find | Find data associated with key
TFPHashObjectList.FindIndexOf | Return index of named object.
TFPHashObjectList.FindWithHash | Find first element with given name and hash value


TFPHashObjectList.Items

Indexed array with object instances

Declaration

Source position: contnrs.pp line 323

public property TFPHashObjectList.Items: TObject
  read GetItem
  write SetItem;
  default;

Description

Items provides indexed access to the object instances, the index runs from 0 to Count-1.

Errors

Specifying an invalid index will result in an exception.

See also

Capacity | Capacity of the list.
Count | Current number of elements in the list.


TFPHashObjectList.List

Low-level hash list

Declaration

Source position: contnrs.pp line 324

public property TFPHashObjectList.List: TFPHashList
  read FHashList;

Description

List exposes the low-level hash list. It should not be used directly.

See also

TFPHashList

Hash list class for pointer data


TFPHashObjectList.NameOfIndex

Returns the key name of an object by index

Declaration

Source position: contnrs.pp line 303

public function TFPHashObjectList.NameOfIndex(

  Index: Integer

):ShortString;

Arguments

Index

Index of object for which to return name

Function result

Key name of object at position Index

Description

NameOfIndex returns the key name of the object at position Index.

Errors

If Index is out of the valid range, an exception is raised.

See also

TFPHashObjectList.HashOfIndex | Return the hash valye of an object by index
TFPHashObjectList.Find | Find data associated with key
TFPHashObjectList.FindIndexOf | Return index of named object.
TFPHashObjectList.FindWithHash | Find first element with given name and hash value


TFPHashObjectList.OwnsObjects

Does the list own the objects it contains

Declaration

Source position: contnrs.pp line 322

public property TFPHashObjectList.OwnsObjects: Boolean
  read FFreeObjects
  write FFreeObjects;

Description

OwnsObjects determines what to do when an object is removed from the list: if it is True (the default), then the list owns the objects: when an object is removed from the list, it is destroyed (freed from memory). Clearing the list will free all objects in the list.

The value of OwnsObjects is set when the hash list is created, and cannot be changed during the lifetime of the hash list.

See also

TFPHashObjectList.Create

Create a new instance of the hashlist


TFPHashObjectList.Pack

Remove nil object instances from the list

Declaration

Source position: contnrs.pp line 316

public procedure TFPHashObjectList.Pack;

Description

Pack removes all Nil objects from the list, and frees all unused memory.

See also

TFPHashObjectList.Clear

Clear the list


TFPHashObjectList.Remove

Remove first occurrence of a object instance

Declaration

Source position: contnrs.pp line 309

public function TFPHashObjectList.Remove(

  AObject: TObject

):Integer;

Arguments

AObject

Object instance to remove from the list.

Function result

Position of object instance which was removed

Description

Remove removes the first occurence of the object instance Item in the list, if it is present. The return value is the location of the removed object instance, or -1 if no object instance was removed.

If OwnsObjects is True, then the object itself is also freed from memory.

See also

TFPHashObjectList.Delete | Delete an object from the list.
TFPHashObjectList.Clear | Clear the list
TFPHashObjectList.Extract | Extract a object instance from the list


TFPHashObjectList.Rename

Rename a key

Declaration

Source position: contnrs.pp line 314

public function TFPHashObjectList.Rename(

  const AOldName: shortstring;

  const ANewName: shortstring

):Integer;

Arguments

AOldName | Key to rename
ANewName | New name of key

Function result

New position in the list

Description

Rename renames key AOldname to ANewName. The hash value is recomputed and the object is moved in the list to it's new position.

Errors

If an object with ANewName already exists, an exception will be raised.


TFPHashObjectList.SetCapacity

Declaration

Source position: contnrs.pp line 296

protected procedure TFPHashObjectList.SetCapacity(

  NewCapacity: Integer

);


TFPHashObjectList.SetItem

Declaration

Source position: contnrs.pp line 295

protected procedure TFPHashObjectList.SetItem(

  Index: Integer;

  AObject: TObject

);


TFPHashObjectList.ShowStatistics

Return some statistics for the list.

Declaration

Source position: contnrs.pp line 317

public procedure TFPHashObjectList.ShowStatistics;

Description

ShowStatistics prints some information about the hash list to standard output. It prints the following values:

HashSize
Size of the hash table
HashMean
Mean hash value
HashStdDev
Standard deviation of hash values
ListSize
Size and capacity of the list
StringSize
Size and capacity of key strings


TFPObjectHashTable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash table for object instances

Declaration

Source position: contnrs.pp line 459

type TFPObjectHashTable = class(TFPCustomHashTable)
protected
function CreateNewNode(); override;
procedure AddNode(); override;
procedure SetData(); virtual;
function GetData(); virtual;
function ForEachCall(); virtual;
public
constructor Create(); | Create a new instance of TFPObjectHashTable
constructor CreateWith(); | Create a new hash table with given size and hash function
procedure Add(); virtual; | Add a new object to the hash table
property Items: TObject; default; [rw] | Key-based access to the objects
property OwnsObjects: Boolean; [rw] | Does the hash table own the objects ?
end;

Inheritance

TFPObjectHashTable | Hash table for object instances
|
TFPCustomHashTable | Hash class
|
TObject

Description

TFPStringHashTable is a TFPCustomHashTable descendent which stores object instances together with the keys. In case the data associated with the keys are strings themselves, it's better to use TFPStringHashTable, or for arbitrary pointer data, TFPDataHashTable is more suitable. The objects are exposed with their keys through the Items property.

See also

TFPStringHashTable | Hash table for string data.
TFPDataHashTable | Hash table for data pointers
TFPObjectHashTable.Items | Key-based access to the objects


TFPObjectHashTable
 |  | Items
 |  | OwnsObjects
TFPCustomHashTable
 |  | HashFunction
 | ro | Count
 |  | HashTableSize
 | ro | HashTable
 | ro | VoidSlots
 | ro | LoadFactor
 | ro | AVGChainLen
 | ro | MaxChainLength
 | ro | NumberOfCollisions
 | ro | Density


ro | AVGChainLen (TFPCustomHashTable)
ro | Count (TFPCustomHashTable)
ro | Density (TFPCustomHashTable)
 | HashFunction (TFPCustomHashTable)
ro | HashTable (TFPCustomHashTable)
 | HashTableSize (TFPCustomHashTable)
 | Items (TFPObjectHashTable)
ro | LoadFactor (TFPCustomHashTable)
ro | MaxChainLength (TFPCustomHashTable)
ro | NumberOfCollisions (TFPCustomHashTable)
 | OwnsObjects (TFPObjectHashTable)
ro | VoidSlots (TFPCustomHashTable)


TFPObjectHashTable
pt | CreateNewNode
pt | AddNode
pt | SetData
pt | GetData
pt | ForEachCall
 | Create
 | CreateWith
 | Add
TFPCustomHashTable
pt | CreateNewNode
pt | AddNode
pt | ChainLength
pt | FindOrCreateNew
pt | SetHashFunction
pt | FindChainForAdd
 | Create
 | CreateWith
 | Destroy
 | ChangeTableSize
 | Clear
 | Delete
 | Find
 | IsEmpty


pt | AddNode (TFPCustomHashTable)
pt | AddNode (TFPObjectHashTable)
pt | ChainLength (TFPCustomHashTable)
 | ChangeTableSize (TFPCustomHashTable)
 | Clear (TFPCustomHashTable)
 | Create (TFPCustomHashTable)
 | Create (TFPObjectHashTable)
pt | CreateNewNode (TFPCustomHashTable)
pt | CreateNewNode (TFPObjectHashTable)
 | CreateWith (TFPCustomHashTable)
 | CreateWith (TFPObjectHashTable)
 | Delete (TFPCustomHashTable)
 | Destroy (TFPCustomHashTable)
 | Find (TFPCustomHashTable)
pt | FindChainForAdd (TFPCustomHashTable)
pt | FindOrCreateNew (TFPCustomHashTable)
pt | ForEachCall (TFPObjectHashTable)
pt | GetData (TFPObjectHashTable)
 | IsEmpty (TFPCustomHashTable)
pt | SetData (TFPObjectHashTable)
pt | SetHashFunction (TFPCustomHashTable)


TFPObjectHashTable

TFPCustomHashTable


TFPObjectHashTable.Add

Add a new object to the hash table

Declaration

Source position: contnrs.pp line 471

public procedure TFPObjectHashTable.Add(

  const aKey: String;

  AItem: TObject

); virtual;

Arguments

aKey | key Associated with object
AItem | Object to store

Description

Add adds the object AItem to the hash table, and associates it with key aKey.

Errors

If the key aKey is already in the hash table, an exception will be raised.

See also

TFPObjectHashTable.Items

Key-based access to the objects


TFPObjectHashTable.AddNode

Declaration

Source position: contnrs.pp line 464

protected procedure TFPObjectHashTable.AddNode(

  ANode: THTCustomNode

); override;


TFPObjectHashTable.Create

Create a new instance of TFPObjectHashTable

Declaration

Source position: contnrs.pp line 469

public constructor TFPObjectHashTable.Create(

  AOwnsObjects: Boolean = true

);

Arguments

AOwnsObjects

Does the hash table own the objects stored in it?

Description

Create creates a new instance of TFPObjectHashTable on the heap. It sets the OwnsObjects property to AOwnsObjects, and then calls the inherited Create. If AOwnsObjects is set to True, then the hash table owns the objects: whenever an object is removed from the list, it is automatically freed.

Errors

If not enough memory is available on the heap, an exception may be raised.

See also

TFPObjectHashTable.OwnsObjects | Does the hash table own the objects ?
TFPObjectHashTable.CreateWith | Create a new hash table with given size and hash function
TFPObjectHashTable.Items | Key-based access to the objects


TFPObjectHashTable.CreateNewNode

Declaration

Source position: contnrs.pp line 463

protected function TFPObjectHashTable.CreateNewNode(

  const aKey: String

):THTCustomNode; override;


TFPObjectHashTable.CreateWith

Create a new hash table with given size and hash function

Declaration

Source position: contnrs.pp line 470

public constructor TFPObjectHashTable.CreateWith(

  AHashTableSize: LongWord;

  aHashFunc: THashFunction;

  AOwnsObjects: Boolean = true

);

Arguments

AHashTableSize | Hash table size
aHashFunc | Hash function to use
AOwnsObjects | Does the hash table own the objects stored in it?

Description

CreateWith sets the OwnsObjects property to AOwnsObjects, and then calls the inherited CreateWith. If AOwnsObjects is set to True, then the hash table owns the objects: whenever an object is removed from the list, it is automatically freed.

This constructor should be used when a table size and hash algorithm should be specified that differ from the default table size and hash algorithm.

Errors

If not enough memory is available on the heap, an exception may be raised.

See also

TFPObjectHashTable.OwnsObjects | Does the hash table own the objects ?
TFPObjectHashTable.Create | Create a new instance of TFPObjectHashTable
TFPObjectHashTable.Items | Key-based access to the objects


TFPObjectHashTable.ForEachCall

Declaration

Source position: contnrs.pp line 467

protected function TFPObjectHashTable.ForEachCall(

  aMethod: TObjectIteratorMethod

):THTObjectNode; virtual;


TFPObjectHashTable.GetData

Declaration

Source position: contnrs.pp line 466

protected function TFPObjectHashTable.GetData(

  const index: String

):TObject; virtual;


TFPObjectHashTable.Items

Key-based access to the objects

Declaration

Source position: contnrs.pp line 472

public property TFPObjectHashTable.Items: TObject
  read GetData
  write SetData;
  default;

Description

Items provides access to the objects in the hash table using their key: the array index Index is the key. A key which is not present will result in an Nil instance.

See also

TFPObjectHashTable.Add

Add a new object to the hash table


TFPObjectHashTable.OwnsObjects

Does the hash table own the objects ?

Declaration

Source position: contnrs.pp line 473

public property TFPObjectHashTable.OwnsObjects: Boolean
  read FOwnsObjects
  write FOwnsObjects;

Description

OwnsObjects determines what happens with objects which are removed from the hash table: if True, then removing an object from the hash list will free the object. If False, the object is not freed. Note that way in which the object is removed is not relevant: be it Delete, Remove or Clear.

See also

TFPObjectHashTable.Create | Create a new instance of TFPObjectHashTable
TFPObjectHashTable.Items | Key-based access to the objects


TFPObjectHashTable.SetData

Declaration

Source position: contnrs.pp line 465

protected procedure TFPObjectHashTable.SetData(

  const Index: String;

  AObject: TObject

); virtual;


TFPObjectList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPList descendent which manages objects.

Declaration

Source position: contnrs.pp line 31

type TFPObjectList = class(TObject)
protected
function GetItem();
procedure SetItem();
procedure SetCapacity();
function GetCapacity;
public
procedure Create(); | Create a new object list
destructor Destroy; override; | Clears the list and destroys the list instance
procedure Clear; | Clear all elements in the list.
function Add(); | Add an object to the list.
procedure Delete(); | Delete an element from the list.
procedure Exchange(); | Exchange the location of two objects
function Expand; | Expand the capacity of the list.
function Extract(); | Extract an object from the list
function Remove(); | Remove an item from the list.
function IndexOf(); | Search for an object in the list
function FindInstanceOf(); | Search for an instance of a certain class
procedure Insert(); | Insert a new object in the list
function First; | Return the first non-nil object in the list
function Last; | Return the last non-nil object in the list.
procedure Move(); | Move an object to another location in the list.
procedure Assign(); | Copy the contents of a list.
procedure Pack; | Remove all Nil references from the list
procedure Sort(); | Sort the list of objects
procedure ForEachCall(); | For each object in the list, call a method or procedure, passing it the object.
property Capacity: Integer; [rw] | Capacity of the list
property Count: Integer; [rw] | Number of elements in the list.
property OwnsObjects: Boolean; [rw] | Should the list free elements when they are removed.
property Items: TObject; default; [rw] | Indexed access to the elements of the list.
property List: TFPList; [r] | Internal list used to keep the objects.
end;

Inheritance

TFPObjectList

TFPList descendent which manages objects.
|

TObject

Description

TFPObjectList is a TFPList based list which has as the default array property TObjects instead of pointers. By default it also manages the objects: when an object is deleted or removed from the list, it is automatically freed. This behaviour can be disabled when the list is created.

In difference with TObjectList, TFPObjectList offers no notification mechanism of list operations, allowing it to be faster than TObjectList. For the same reason, it is also not a descendent of TFPList (although it uses one internally).

See also

#rtl.classes.TFPList

TObjectList

List to manage object instances.


TFPObjectList
 |  | Capacity
 |  | Count
 |  | OwnsObjects
 |  | Items
 | ro | List


ro | List (TFPObjectList)
 | OwnsObjects (TFPObjectList)


TFPObjectList
pt | GetItem
pt | SetItem
pt | SetCapacity
pt | GetCapacity
 | Create
 | Destroy
 | Clear
 | Add
 | Delete
 | Exchange
 | Expand
 | Extract
 | Remove
 | IndexOf
 | FindInstanceOf
 | Insert
 | First
 | Last
 | Move
 | Assign
 | Pack
 | Sort
 | ForEachCall


 | Add (TFPObjectList)
 | Assign (TFPObjectList)
 | Clear (TFPObjectList)
 | Create (TFPObjectList)
 | Delete (TFPObjectList)
 | Destroy (TFPObjectList)
 | Exchange (TFPObjectList)
 | Expand (TFPObjectList)
 | Extract (TFPObjectList)
 | FindInstanceOf (TFPObjectList)
 | First (TFPObjectList)
 | ForEachCall (TFPObjectList)
pt | GetCapacity (TFPObjectList)
pt | GetItem (TFPObjectList)
 | IndexOf (TFPObjectList)
 | Insert (TFPObjectList)
 | Last (TFPObjectList)
 | Move (TFPObjectList)
 | Pack (TFPObjectList)
 | Remove (TFPObjectList)
pt | SetCapacity (TFPObjectList)
pt | SetItem (TFPObjectList)
 | Sort (TFPObjectList)


TFPObjectList


TFPObjectList.Add

Add an object to the list.

Declaration

Source position: contnrs.pp line 47

public function TFPObjectList.Add(

  AObject: TObject

):Integer;

Arguments

AObject

The object to add

Function result

The index of the object in the list.

Description

Add adds AObject to the list and returns the index of the object in the list.

Note that when OwnsObjects is True, an object should not be added twice to the list: this will result in memory corruption when the object is freed (as it will be freed twice). The Add method does not check this, however.

Errors

None.

See also

TFPObjectList.OwnsObjects | Should the list free elements when they are removed.
TFPObjectList.Delete | Delete an element from the list.


TFPObjectList.Assign

Copy the contents of a list.

Declaration

Source position: contnrs.pp line 59

public procedure TFPObjectList.Assign(

  Obj: TFPObjectList

);

Arguments

Obj

The source list to copy from.

Description

Assign copies the contents of Obj if Obj is of type TFPObjectList

Errors

None.


TFPObjectList.Capacity

Capacity of the list

Declaration

Source position: contnrs.pp line 64

public property TFPObjectList.Capacity: Integer
  read GetCapacity
  write SetCapacity;

Description

Capacity is the number of elements that the list can contain before it needs to expand itself, i.e., reserve more memory for pointers. It is always equal or larger than Count.

See also

TFPObjectList.Count

Number of elements in the list.


TFPObjectList.Clear

Clear all elements in the list.

Declaration

Source position: contnrs.pp line 46

public procedure TFPObjectList.Clear;

Description

Removes all objects from the list, freeing all objects in the list if OwnsObjects is True.

See also

TObjectList.Destroy


TFPObjectList.Count

Number of elements in the list.

Declaration

Source position: contnrs.pp line 65

public property TFPObjectList.Count: Integer
  read GetCount
  write SetCount;

Description

Count is the number of elements in the list. Note that this includes Nil elements.

See also

TFPObjectList.Capacity

Capacity of the list


TFPObjectList.Create

Create a new object list

Declaration

Source position: line 0

public constructor TFPObjectList.Create;

constructor TFPObjectList.Create(

  FreeObjects: Boolean

);

Arguments

FreeObjects

Should objects be freed when removing them from the list

Description

Create instantiates a new object list. The FreeObjects parameter determines whether objects that are removed from the list should also be freed from memory. By default this is True. This behaviour can be changed after the list was instantiated.

Errors

None.

See also

TFPObjectList.Destroy | Clears the list and destroys the list instance
TFPObjectList.OwnsObjects | Should the list free elements when they are removed.
TObjectList | List to manage object instances.


TFPObjectList.Delete

Delete an element from the list.

Declaration

Source position: contnrs.pp line 48

public procedure TFPObjectList.Delete(

  Index: Integer

);

Arguments

Index

Index of the object to delete.

Description

Delete removes the object at index Index from the list. When OwnsObjects is True, the object is also freed.

Errors

An access violation may occur when OwnsObjects is True and either the object was freed externally, or when the same object is in the same list twice.

See also

TTFPObjectList.Remove
TFPObjectList.Extract | Extract an object from the list
TFPObjectList.OwnsObjects | Should the list free elements when they are removed.
TTFPObjectList.Add
TTFPObjectList.Clear


TFPObjectList.Destroy

Clears the list and destroys the list instance

Declaration

Source position: contnrs.pp line 45

public destructor TFPObjectList.Destroy; override;

Description

Destroy clears the list, freeing all objects in the list if OwnsObjects is True.

See also

TFPObjectList.OwnsObjects | Should the list free elements when they are removed.
TObjectList.Create | Create a new object list.


TFPObjectList.Exchange

Exchange the location of two objects

Declaration

Source position: contnrs.pp line 49

public procedure TFPObjectList.Exchange(

  Index1: Integer;

  Index2: Integer

);

Arguments

Index1 | Location of first object
Index2 | Location of second object

Description

Exchange exchanges the objects at indexes Index1 and Index2 in a direct operation (i.e. no delete/add is performed).

Errors

If either Index1 or Index2 is invalid, an exception will be raised.

See also

TTFPObjectList.Add

TTFPObjectList.Delete


TFPObjectList.Expand

Expand the capacity of the list.

Declaration

Source position: contnrs.pp line 50

public function TFPObjectList.Expand: TFPObjectList;

Function result

A reference to the expanded list.

Description

Expand increases the capacity of the list. It calls #rtl.classes.tfplist.expand and then returns a reference to itself.

Errors

If there is not enough memory to expand the list, an exception will be raised.

See also

TFPObjectList.Pack | Remove all Nil references from the list
TFPObjectList.Clear | Clear all elements in the list.
#rtl.classes.tfplist.expand


TFPObjectList.Extract

Extract an object from the list

Declaration

Source position: contnrs.pp line 51

public function TFPObjectList.Extract(

  Item: TObject

):TObject;

Arguments

Item

The object to extract

Function result

The extracted object, or Nil if none was extracted.

Description

Extract removes Item from the list, if it is present in the list. It returns Item if it was found, Nil if item was not present in the list.

Note that the object is not freed, and that only the first found object is removed from the list.

Errors

None.

See also

TFPObjectList.Pack | Remove all Nil references from the list
TFPObjectList.Clear | Clear all elements in the list.
TFPObjectList.Remove | Remove an item from the list.
TFPObjectList.Delete | Delete an element from the list.


TFPObjectList.FindInstanceOf

Search for an instance of a certain class

Declaration

Source position: contnrs.pp line 54

public function TFPObjectList.FindInstanceOf(

  AClass: TClass;

  AExact: Boolean;

  AStartAt: Integer

):Integer;

Arguments

AClass | The class to look for
AExact | Should the class match exact or nor
AStartAt | Index to start the search at

Function result

The first instance of the requested class.

Description

FindInstanceOf will look through the instances in the list and will return the first instance which is a descendent of class AClass if AExact is False. If AExact is true, then the instance should be of class AClass.

If no instance of the requested class is found, Nil is returned.

Errors

None.

See also

TFPObjectList.IndexOf

Search for an object in the list


TFPObjectList.First

Return the first non-nil object in the list

Declaration

Source position: contnrs.pp line 56

public function TFPObjectList.First: TObject;

Function result

The first non-nil element in the list.

Description

First returns a reference to the first non-Nil element in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TFPObjectList.Last | Return the last non-nil object in the list.
TFPObjectList.Pack | Remove all Nil references from the list


TFPObjectList.ForEachCall

For each object in the list, call a method or procedure, passing it the object.

Declaration

Source position: line 0

public procedure TFPObjectList.ForEachCall(

  proc2call: TObjectListCallback;

  arg: pointer

);

procedure TFPObjectList.ForEachCall(

  proc2call: TObjectListStaticCallback;

  arg: pointer

);

Arguments

proc2call | Procedure or method to be called.
arg | Additional pointer passed to proc2call

Arguments

proc2call | Procedure or method to be called.
arg | Additional pointer passed to proc2call

Description

ForEachCall loops through all objects in the list, and calls proc2call, passing it the object in the list. Additionally, arg is also passed to the procedure. Proc2call can be a plain procedure or can be a method of a class.

Errors

None.

See also

TObjectListStaticCallback | Plan procedure callback type for TFPObjectList.ForEachCall
TObjectListCallback | Method callback type for TFPObjectList.ForEachCall


TFPObjectList.GetCapacity

Declaration

Source position: contnrs.pp line 41

protected function TFPObjectList.GetCapacity: Integer;


TFPObjectList.GetItem

Declaration

Source position: contnrs.pp line 38

protected function TFPObjectList.GetItem(

  Index: Integer

):TObject;


TFPObjectList.IndexOf

Search for an object in the list

Declaration

Source position: contnrs.pp line 53

public function TFPObjectList.IndexOf(

  AObject: TObject

):Integer;

Arguments

AObject

Object instance to search for.

Function result

Index of the object in the list, -1 if not present.

Description

IndexOf searches for the presence of AObject in the list, and returns the location (index) in the list. The index is 0-based, and -1 is returned if AObject was not found in the list.

Errors

None.

See also

TFPObjectList.Items | Indexed access to the elements of the list.
TFPObjectList.Remove | Remove an item from the list.
TFPObjectList.Extract | Extract an object from the list


TFPObjectList.Insert

Insert a new object in the list

Declaration

Source position: contnrs.pp line 55

public procedure TFPObjectList.Insert(

  Index: Integer;

  AObject: TObject

);

Arguments

Index | Position Index to insert the object in
AObject | Object to insert in the list

Description

Insert inserts AObject at position Index in the list. All elements in the list after this position are shifted. The index is zero based, i.e. an insert at position 0 will insert an object at the first position of the list.

Errors

None.

See also

TFPObjectList.Add | Add an object to the list.
TFPObjectList.Delete | Delete an element from the list.


TFPObjectList.Items

Indexed access to the elements of the list.

Declaration

Source position: contnrs.pp line 67

public property TFPObjectList.Items: TObject
  read GetItem
  write SetItem;
  default;

Description

Items is the default property of the list. It provides indexed access to the elements in the list. The index Index is zero based, i.e., runs from 0 (zero) to Count-1.

See also

TFPObjectList.Count

Number of elements in the list.


TFPObjectList.Last

Return the last non-nil object in the list.

Declaration

Source position: contnrs.pp line 57

public function TFPObjectList.Last: TObject;

Function result

The last non-nil object in the list.

Description

Last returns a reference to the last non-Nil element in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TFPObjectList.First | Return the first non-nil object in the list
TFPObjectList.Pack | Remove all Nil references from the list


TFPObjectList.List

Internal list used to keep the objects.

Declaration

Source position: contnrs.pp line 68

public property TFPObjectList.List: TFPList
  read FList;

Description

List is a reference to the TFPList instance used to manage the elements in the list.

See also

#rtl.classes.tfplist


TFPObjectList.Move

Move an object to another location in the list.

Declaration

Source position: contnrs.pp line 58

public procedure TFPObjectList.Move(

  CurIndex: Integer;

  NewIndex: Integer

);

Arguments

CurIndex | The current index of the object
NewIndex | The new index of the object

Description

Move moves the object at current location CurIndex to location NewIndex. Note that the NewIndex is determined after the object was removed from location CurIndex, and can hence be shifted with 1 position if CurIndex is less than NewIndex.

Contrary to exchange, the move operation is done by extracting the object from it's current location and inserting it at the new location.

Errors

If either CurIndex or NewIndex is out of range, an exception may occur.

See also

TFPObjectList.Exchange | Exchange the location of two objects
TFPObjectList.Delete | Delete an element from the list.
TFPObjectList.Insert | Insert a new object in the list


TFPObjectList.OwnsObjects

Should the list free elements when they are removed.

Declaration

Source position: contnrs.pp line 66

public property TFPObjectList.OwnsObjects: Boolean
  read FFreeObjects
  write FFreeObjects;

Description

OwnsObjects determines whether the objects in the list should be freed when they are removed (not extracted) from the list, or when the list is cleared. If the property is True then they are freed. If the property is False the elements are not freed.

The value is usually set in the constructor, and is seldom changed during the lifetime of the list. It defaults to True.

See also

TFPObjectList.Create | Create a new object list
TFPObjectList.Delete | Delete an element from the list.
TFPObjectList.Remove | Remove an item from the list.
TFPObjectList.Clear | Clear all elements in the list.


TFPObjectList.Pack

Remove all Nil references from the list

Declaration

Source position: contnrs.pp line 60

public procedure TFPObjectList.Pack;

Description

Pack removes all Nil elements from the list.

Errors

None.

See also

TFPObjectList.First | Return the first non-nil object in the list
TFPObjectList.Last | Return the last non-nil object in the list.


TFPObjectList.Remove

Remove an item from the list.

Declaration

Source position: contnrs.pp line 52

public function TFPObjectList.Remove(

  AObject: TObject

):Integer;

Arguments

AObject

Object to remove from the list.

Function result

Index of the removed object or -1 if none was removed.

Description

Remove removes Item from the list, if it is present in the list. It frees Item if OwnsObjects is True, and returns the index of the object that was found in the list, or -1 if the object was not found.

Note that only the first found object is removed from the list.

Errors

None.

See also

TFPObjectList.Pack | Remove all Nil references from the list
TFPObjectList.Clear | Clear all elements in the list.
TFPObjectList.Delete | Delete an element from the list.
TFPObjectList.Extract | Extract an object from the list


TFPObjectList.SetCapacity

Declaration

Source position: contnrs.pp line 40

protected procedure TFPObjectList.SetCapacity(

  NewCapacity: Integer

);


TFPObjectList.SetItem

Declaration

Source position: contnrs.pp line 39

protected procedure TFPObjectList.SetItem(

  Index: Integer;

  AObject: TObject

);


TFPObjectList.Sort

Sort the list of objects

Declaration

Source position: contnrs.pp line 61

public procedure TFPObjectList.Sort(

  Compare: TListSortCompare

);

Arguments

Compare

Compare function for two objects.

Description

Sort will perform a quick-sort on the list, using Compare as the compare algorithm. This function should accept 2 pointers and should return the following result:

less than 0
If the first pointer comes before the second.
equal to 0
If the pointers have the same value.
larger than 0
If the first pointer comes after the second.

The function should be able to deal with Nil values.

Errors

None.

See also

#rtl.classes.TList.Sort


TFPStringHashTable

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Hash table for string data.

Declaration

Source position: contnrs.pp line 431

type TFPStringHashTable = class(TFPCustomHashTable)
protected
function CreateNewNode(); override;
procedure AddNode(); override;
procedure SetData(); virtual;
function GetData(); virtual;
function ForEachCall(); virtual;
public
procedure Add(); virtual; | Add a new string to the hash list
property Items: String; default; [rw] | Key based access to the strings in the hash table
end;

Inheritance

TFPStringHashTable | Hash table for string data.
|
TFPCustomHashTable | Hash class
|
TObject

Description

TFPStringHashTable is a TFPCustomHashTable descendent which stores simple strings together with the keys. In case the data associated with the keys are objects, it's better to use TFPObjectHashTable, or for arbitrary pointer data, TFPDataHashTable is more suitable. The strings are exposed with their keys through the Items property.

See also

TFPObjectHashTable | Hash table for object instances
TFPDataHashTable | Hash table for data pointers
Items | Key based access to the strings in the hash table


TFPStringHashTable
 |  | Items
TFPCustomHashTable
 |  | HashFunction
 | ro | Count
 |  | HashTableSize
 | ro | HashTable
 | ro | VoidSlots
 | ro | LoadFactor
 | ro | AVGChainLen
 | ro | MaxChainLength
 | ro | NumberOfCollisions
 | ro | Density


ro | AVGChainLen (TFPCustomHashTable)
ro | Count (TFPCustomHashTable)
ro | Density (TFPCustomHashTable)
 | HashFunction (TFPCustomHashTable)
ro | HashTable (TFPCustomHashTable)
 | HashTableSize (TFPCustomHashTable)
 | Items (TFPStringHashTable)
ro | LoadFactor (TFPCustomHashTable)
ro | MaxChainLength (TFPCustomHashTable)
ro | NumberOfCollisions (TFPCustomHashTable)
ro | VoidSlots (TFPCustomHashTable)


TFPStringHashTable
pt | CreateNewNode
pt | AddNode
pt | SetData
pt | GetData
pt | ForEachCall
 | Add
TFPCustomHashTable
pt | CreateNewNode
pt | AddNode
pt | ChainLength
pt | FindOrCreateNew
pt | SetHashFunction
pt | FindChainForAdd
 | Create
 | CreateWith
 | Destroy
 | ChangeTableSize
 | Clear
 | Delete
 | Find
 | IsEmpty


pt | AddNode (TFPCustomHashTable)
pt | AddNode (TFPStringHashTable)
pt | ChainLength (TFPCustomHashTable)
 | ChangeTableSize (TFPCustomHashTable)
 | Clear (TFPCustomHashTable)
 | Create (TFPCustomHashTable)
pt | CreateNewNode (TFPCustomHashTable)
pt | CreateNewNode (TFPStringHashTable)
 | CreateWith (TFPCustomHashTable)
 | Delete (TFPCustomHashTable)
 | Destroy (TFPCustomHashTable)
 | Find (TFPCustomHashTable)
pt | FindChainForAdd (TFPCustomHashTable)
pt | FindOrCreateNew (TFPCustomHashTable)
pt | ForEachCall (TFPStringHashTable)
pt | GetData (TFPStringHashTable)
 | IsEmpty (TFPCustomHashTable)
pt | SetData (TFPStringHashTable)
pt | SetHashFunction (TFPCustomHashTable)


TFPStringHashTable

TFPCustomHashTable


TFPStringHashTable.Add

Add a new string to the hash list

Declaration

Source position: contnrs.pp line 439

public procedure TFPStringHashTable.Add(

  const aKey: String;

  const aItem: String

); virtual;

Arguments

aKey | Key value associated with aItem
aItem | String data

Description

Add adds a new string AItem to the hash list with key AKey.

Errors

If a string with key Akey already exists in the hash table, an exception will be raised.

See also

TFPStringHashTable.Items

Key based access to the strings in the hash table


TFPStringHashTable.AddNode

Declaration

Source position: contnrs.pp line 434

protected procedure TFPStringHashTable.AddNode(

  ANode: THTCustomNode

); override;


TFPStringHashTable.CreateNewNode

Declaration

Source position: contnrs.pp line 433

protected function TFPStringHashTable.CreateNewNode(

  const aKey: String

):THTCustomNode; override;


TFPStringHashTable.ForEachCall

Declaration

Source position: contnrs.pp line 437

protected function TFPStringHashTable.ForEachCall(

  aMethod: TStringIteratorMethod

):THTStringNode; virtual;


TFPStringHashTable.GetData

Declaration

Source position: contnrs.pp line 436

protected function TFPStringHashTable.GetData(

  const index: String

):String; virtual;


TFPStringHashTable.Items

Key based access to the strings in the hash table

Declaration

Source position: contnrs.pp line 440

public property TFPStringHashTable.Items: String
  read GetData
  write SetData;
  default;

Description

Items provides access to the strings in the hash table using their key: the array index Index is the key. A key which is not present will result in an empty string.

See also

TFPStringHashTable.Add

Add a new string to the hash list


TFPStringHashTable.SetData

Declaration

Source position: contnrs.pp line 435

protected procedure TFPStringHashTable.SetData(

  const Index: String;

  const AValue: String

); virtual;


THTCustomNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Single item in the hash table.

Declaration

Source position: contnrs.pp line 339

type THTCustomNode = class(TObject)
public
constructor CreateWith(); | Create a new instance of THTCustomNode
function HasKey(); | Check whether this node matches the given key.
property Key: String; [r] | Key value associated with this hash item.
end;

Inheritance

THTCustomNode

Single item in the hash table.
|

TObject

Description

THTCustomNode is used by the TFPCustomHashTable class to store the keys and associated values.

See also

TFPHashTable


THTCustomNode

ro

Key


ro

Key (THTCustomNode)


THTCustomNode
 | CreateWith
 | HasKey


THTCustomNode


THTCustomNode.CreateWith

Create a new instance of THTCustomNode

Declaration

Source position: contnrs.pp line 343

public constructor THTCustomNode.CreateWith(

  const AString: String

);

Arguments

AString

Key value for this node.

Description

CreateWith creates a new instance of THTCustomNode and stores the string AString in it. It should never be necessary to call this method directly, it will be called by the TFPHashTable class when needed.

Errors

If no more memory is available, an exception may be raised.

See also

TFPHashTable


THTCustomNode.HasKey

Check whether this node matches the given key.

Declaration

Source position: contnrs.pp line 344

public function THTCustomNode.HasKey(

  const AKey: String

):Boolean;

Arguments

AKey

Key to check for

Function result

True if the key matches, False if not.

Description

HasKey checks whether this node matches the given key AKey, by comparing it with the stored key. It returns True if it does, False if not.

Errors

None.

See also

THTCustomNode.Key

Key value associated with this hash item.


THTCustomNode.Key

Key value associated with this hash item.

Declaration

Source position: contnrs.pp line 345

public property THTCustomNode.Key: String
  read FKey;

Description

Key is the key value associated with this hash item. It is stored when the item is created, and is read-only.

See also

THTCustomNode.CreateWith

Create a new instance of THTCustomNode


THTCustomNodeClass

Class of THTCustomNodeClass.

Declaration

Source position: contnrs.pp line 347

type THTCustomNodeClass = class of THTCustomNode;

Description

THTCustomNodeClass is used by THTCustomHashTable to decide which class should be created for elements in the list.

See also

THTCustomHashTable

THTCustomNode

Single item in the hash table.


THTDataNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Data node for pointer hashtable

Declaration

Source position: contnrs.pp line 397

type THTDataNode = class(THTCustomNode)

public

  property Data: pointer; [rw]

Data pointer

end;

Inheritance

THTDataNode | Data node for pointer hashtable
|
THTCustomNode | Single item in the hash table.
|
TObject

Description

THTDataNode is used by TDataHashTable to store the hash items in. It simply holds the data pointer.

It should not be necessary to use THTDataNode directly, it's only for inner use by TFPDataHashTable

See also

TDataHashTable
THTObjectNode | Node type for TFPObjectHashTable
THTStringNode | Node type for TFPStringHashTable


THTDataNode
 |  | Data
THTCustomNode
 | ro | Key


ro | Key (THTCustomNode)


THTDataNode
THTCustomNode
 | CreateWith
 | HasKey


THTDataNode

THTCustomNode


THTDataNode.Data

Data pointer

Declaration

Source position: contnrs.pp line 401

public property THTDataNode.Data: pointer
  read FData
  write FData;

Description

Pointer containing the user data associated with the hash value.


THTObjectNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Node type for TFPObjectHashTable

Declaration

Source position: contnrs.pp line 446

type THTObjectNode = class(THTCustomNode)

public

  property Data: TObject; [rw]

Object instance

end;

Inheritance

THTObjectNode | Node type for TFPObjectHashTable
|
THTCustomNode | Single item in the hash table.
|
TObject

Description

THTObjectNode is a THTCustomNode descendent which holds the data in the TFPObjectHashTable hash table. It exposes a data string.

It should not be necessary to use THTObjectNode directly, it's only for inner use by TFPObjectHashTable

See also

TFPObjectHashTable

Hash table for object instances


THTObjectNode
 |  | Data
THTCustomNode
 | ro | Key


THTObjectNode
THTCustomNode
 | CreateWith
 | HasKey


THTObjectNode

THTCustomNode


THTObjectNode.Data

Object instance

Declaration

Source position: contnrs.pp line 450

public property THTObjectNode.Data: TObject
  read FData
  write FData;

Description

Data is the object instance associated with the key value. It is exposed in TFPObjectHashTable.Items

See also

TFPObjectHashTable | Hash table for object instances
TFPObjectHashTable.Items | Key-based access to the objects
THTOwnedObjectNode | Node type for owned objects.


THTOwnedObjectNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Node type for owned objects.

Declaration

Source position: contnrs.pp line 453

type THTOwnedObjectNode = class(THTObjectNode)

public

  destructor Destroy; override;

Destroys the node and the object.

end;

Inheritance

THTOwnedObjectNode | Node type for owned objects.
|
THTObjectNode | Node type for TFPObjectHashTable
|
THTCustomNode | Single item in the hash table.
|
TObject

Description

THTOwnedObjectNode is used instead of THTObjectNode in case TFPObjectHashTable owns it's objects. When this object is destroyed, the associated data object is also destroyed.

See also

TFPObjectHashTable | Hash table for object instances
THTObjectNode | Node type for TFPObjectHashTable
TFPObjectHashTable.OwnsObjects | Does the hash table own the objects ?


THTOwnedObjectNode
THTObjectNode
 |  | Data
THTCustomNode
 | ro | Key


THTOwnedObjectNode
 | Destroy
THTObjectNode
THTCustomNode
 | CreateWith
 | HasKey


THTOwnedObjectNode

THTObjectNode

THTCustomNode


THTOwnedObjectNode.Destroy

Destroys the node and the object.

Declaration

Source position: contnrs.pp line 455

public destructor THTOwnedObjectNode.Destroy; override;

Description

Destroy first frees the data object, and then only frees itself.

See also

THTOwnedObjectNode | Node type for owned objects.
TFPObjectHashTable.OwnsObjects | Does the hash table own the objects ?


THTStringNode

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Node type for TFPStringHashTable

Declaration

Source position: contnrs.pp line 423

type THTStringNode = class(THTCustomNode)

public

  property Data: String; [rw]

String data

end;

Inheritance

THTStringNode | Node type for TFPStringHashTable
|
THTCustomNode | Single item in the hash table.
|
TObject

Description

THTStringNode is a THTCustomNode descendent which holds the data in the TFPStringHashTable hash table. It exposes a data string.

It should not be necessary to use THTStringNode directly, it's only for inner use by TFPStringHashTable

See also

TFPStringHashTable

Hash table for string data.


THTStringNode
 |  | Data
THTCustomNode
 | ro | Key


THTStringNode
THTCustomNode
 | CreateWith
 | HasKey


THTStringNode

THTCustomNode


THTStringNode.Data

String data

Declaration

Source position: contnrs.pp line 427

public property THTStringNode.Data: String
  read FData
  write FData;

Description

Data is the data of this has node. The data is a string, associated with the key. It is also exposed in TFPStringHashTable.Items

See also

TFPStringHashTable

Hash table for string data.


TObjectBucketList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Bucket list using objects instead of pointers.

Declaration

Source position: contnrs.pp line 561

type TObjectBucketList = class(TBucketList)
protected
function GetData();
procedure SetData();
public
function Add(); | Add an object to the list
function Remove(); | Remove an object from the list
property Data: TObject; default; [rw] | Associative array of data items
end;

Inheritance

TObjectBucketList | Bucket list using objects instead of pointers.
|
TBucketList | Default bucket list implementation.
|
TCustomBucketList | Custom bucket list class
|
TObject

Description

TObjectBucketList is a class that redefines the associative Data array using TObject instead of Pointer. It also adds some overloaded versions of the Add and Remove calls using TObject instead of Pointer for the argument and result types.

See also

TObjectBucketList

Bucket list using objects instead of pointers.


TObjectBucketList
 |  | Data
TBucketList
TCustomBucketList
pt | ro | Buckets
pt |  | BucketCount
 |  | Data


pt |  | BucketCount (TCustomBucketList)
pt | ro | Buckets (TCustomBucketList)
 |  | Data (TCustomBucketList)
 |  | Data (TObjectBucketList)


TObjectBucketList
pt | GetData
pt | SetData
 | Add
 | Remove
TBucketList
pt | BucketFor
 | Create
TCustomBucketList
pt | GetBucketItem
pt | AddItem
pt | BucketFor
pt | DeleteItem
pt | Error
pt | FindItem
 | Destroy
 | Clear
 | Add
 | Assign
 | Exists
 | Find
 | ForEach
 | Remove


pt | AddItem (TCustomBucketList)
 | Assign (TCustomBucketList)
pt | BucketFor (TCustomBucketList)
pt | BucketFor (TBucketList)
 | Clear (TCustomBucketList)
 | Create (TBucketList)
pt | DeleteItem (TCustomBucketList)
 | Destroy (TCustomBucketList)
pt | Error (TCustomBucketList)
 | Exists (TCustomBucketList)
 | Find (TCustomBucketList)
pt | FindItem (TCustomBucketList)
 | ForEach (TCustomBucketList)
pt | GetBucketItem (TCustomBucketList)
pt | GetData (TObjectBucketList)
 | Remove (TCustomBucketList)
 | Remove (TObjectBucketList)
pt | SetData (TObjectBucketList)


TObjectBucketList

TBucketList

TCustomBucketList


TObjectBucketList.Add

Add an object to the list

Declaration

Source position: contnrs.pp line 566

public function TObjectBucketList.Add(

  AItem: TObject;

  AData: TObject

):TObject;

Arguments

AItem | Item to add to the list
AData | Data associated with AItem

Function result

The result is always AData

Description

Add adds AItem to the list and associated AData with it.

See also

TObjectBucketList.Data | Associative array of data items
TObjectBucketList.Remove | Remove an object from the list


TObjectBucketList.Data

Associative array of data items

Declaration

Source position: contnrs.pp line 568

public property TObjectBucketList.Data: TObject
  read GetData
  write SetData;
  default;

Description

Data provides associative access to the data in the list: it returns the data object associated with the AItem object. If the AItem object is not in the list, an EListError exception is raised.

See also

TObjectBucketList.Add

Add an object to the list


TObjectBucketList.GetData

Declaration

Source position: contnrs.pp line 563

protected function TObjectBucketList.GetData(

  AItem: TObject

):TObject;


TObjectBucketList.Remove

Remove an object from the list

Declaration

Source position: contnrs.pp line 567

public function TObjectBucketList.Remove(

  AItem: TObject

):TObject;

Arguments

AItem

Object to remove from the list

Function result

Data item associated with AItem

Description

Remove removes the object AItem from the list. It returns the Data object which was associated with the item. If AItem was not in the list, then Nil is returned.

See also

TObjectBucketList.Add | Add an object to the list
TObjectBucketList.Data | Associative array of data items


TObjectBucketList.SetData

Declaration

Source position: contnrs.pp line 564

protected procedure TObjectBucketList.SetData(

  AItem: TObject;

  const AData: TObject

);


TObjectList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

List to manage object instances.

Declaration

Source position: contnrs.pp line 72

type TObjectList = class(TList)
protected
procedure Notify(); override;
function GetItem();
procedure SetItem();
public
procedure create(); | Create a new object list.
function Add(); | Add an object to the list.
function Extract(); | Extract an object from the list.
function Remove(); | Remove (and possibly free) an element from the list.
function IndexOf(); | Search for an object in the list
function FindInstanceOf(); | Search for an instance of a certain class
procedure Insert(); | Insert an object in the list.
function First; | Return the first non-nil object in the list
function Last; | Return the last non-nil object in the list.
property OwnsObjects: Boolean; [rw] | Should the list free elements when they are removed.
property Items: TObject; default; [rw] | Indexed access to the elements of the list.
end;

Inheritance

TObjectList

List to manage object instances.
|

TList
|

TObject

Description

TObjectList is a TList descendent which has as the default array property TObjects instead of pointers. By default it also manages the objects: when an object is deleted or removed from the list, it is automatically freed. This behaviour can be disabled when the list is created.

In difference with TFPObjectList, TObjectList offers a notification mechanism of list change operations: insert, delete. This slows down bulk operations, so if the notifications are not needed, TObjectList may be more appropriate.

See also

#rtl.classes.TList
TFPObjectList | TFPList descendent which manages objects.
TComponentList | List to manage component instances.
TClassList | List of classes.


TObjectList
 |  | OwnsObjects
 |  | Items
TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List


 | Capacity (TList)
 | Count (TList)
 | Items (TList)
 | Items (TObjectList)
ro | List (TList)
 | OwnsObjects (TObjectList)


TObjectList
pt | Notify
pt | GetItem
pt | SetItem
 | create
 | Add
 | Extract
 | Remove
 | IndexOf
 | FindInstanceOf
 | Insert
 | First
 | Last
TList
 | CopyMove
 | MergeMove
 | DoCopy
 | DoSrcUnique
 | DoAnd
 | DoDestUnique
 | DoOr
 | DoXOr
 | Get
 | Grow
 | Put
 | Notify
 | SetCapacity
 | GetCapacity
 | SetCount
 | GetCount
 | GetList
 | Create
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort


 | Add (TList)
 | Add (TObjectList)
 | AddList (TList)
 | Assign (TList)
 | Clear (TList)
 | CopyMove (TList)
 | Create (TList)
 | create (TObjectList)
 | Delete (TList)
 | Destroy (TList)
 | DoAnd (TList)
 | DoCopy (TList)
 | DoDestUnique (TList)
 | DoOr (TList)
 | DoSrcUnique (TList)
 | DoXOr (TList)
 | Error (TList)
 | Exchange (TList)
 | Expand (TList)
 | Extract (TList)
 | Extract (TObjectList)
 | FindInstanceOf (TObjectList)
 | First (TList)
 | First (TObjectList)
 | Get (TList)
 | GetCapacity (TList)
 | GetCount (TList)
pt | GetItem (TObjectList)
 | GetList (TList)
 | Grow (TList)
 | IndexOf (TList)
 | IndexOf (TObjectList)
 | Insert (TList)
 | Insert (TObjectList)
 | Last (TList)
 | Last (TObjectList)
 | MergeMove (TList)
 | Move (TList)
 | Notify (TList)
pt | Notify (TObjectList)
 | Pack (TList)
 | Put (TList)
 | Remove (TList)
 | Remove (TObjectList)
 | SetCapacity (TList)
 | SetCount (TList)
pt | SetItem (TObjectList)
 | Sort (TList)


TObjectList

TList


TObjectList.Add

Add an object to the list.

Declaration

Source position: contnrs.pp line 82

public function TObjectList.Add(

  AObject: TObject

):Integer;

Arguments

AObject

Object to add to the list.

Function result

Position at which the object was added

Description

Add overrides the TList implementation to accept objects (AObject) instead of pointers.

The function returns the index of the position where the object was added.

Errors

If the list must be expanded, and not enough memory is available, an exception may be raised.

See also

TObjectList.Insert | Insert an object in the list.
#rtl.classes.TList.Delete
TObjectList.Extract | Extract an object from the list.
TObjectList.Remove | Remove (and possibly free) an element from the list.


TObjectList.create

Create a new object list.

Declaration

Source position: line 0

public constructor TObjectList.create;

constructor TObjectList.create(

  freeobjects: Boolean

);

Arguments

freeobjects

Should removed items be freed from memory

Description

Create instantiates a new object list. The FreeObjects parameter determines whether objects that are removed from the list should also be freed from memory. By default this is True. This behaviour can be changed after the list was instantiated.

Errors

None.

See also

TObjectList.Destroy
TObjectList.OwnsObjects | Should the list free elements when they are removed.
TFPObjectList | TFPList descendent which manages objects.


TObjectList.Extract

Extract an object from the list.

Declaration

Source position: contnrs.pp line 83

public function TObjectList.Extract(

  Item: TObject

):TObject;

Arguments

Item

Element to remove from the list.

Function result

The removed element, or Nil

Description

Extract removes the object Item from the list if it is present in the list. Contrary to Remove, Extract does not free the extracted element if OwnsObjects is True

The function returns a reference to the item which was removed from the list, or Nil if no element was removed.

Errors

None.

See also

TObjectList.Remove

Remove (and possibly free) an element from the list.


TObjectList.FindInstanceOf

Search for an instance of a certain class

Declaration

Source position: contnrs.pp line 86

public function TObjectList.FindInstanceOf(

  AClass: TClass;

  AExact: Boolean;

  AStartAt: Integer

):Integer;

Arguments

AClass | Class of which result should be a descendent
AExact | Should the class of the result be exactly the requested class.
AStartAt | Index to start the search

Function result

Instance found or Nil if none was found

Description

FindInstanceOf will look through the instances in the list and will return the first instance which is a descendent of class AClass if AExact is False. If AExact is true, then the instance should be of class AClass.

If no instance of the requested class is found, Nil is returned.

Errors

None.

See also

TObjectList.IndexOf

Search for an object in the list


TObjectList.First

Return the first non-nil object in the list

Declaration

Source position: contnrs.pp line 88

public function TObjectList.First: TObject;

Function result

First non-nil object in the list.

Description

First returns a reference to the first non-Nil element in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TObjectList.Last

Return the last non-nil object in the list.

TObjectList.Pack


TObjectList.GetItem

Declaration

Source position: contnrs.pp line 77

protected function TObjectList.GetItem(

  Index: Integer

):TObject;


TObjectList.IndexOf

Search for an object in the list

Declaration

Source position: contnrs.pp line 85

public function TObjectList.IndexOf(

  AObject: TObject

):Integer;

Arguments

AObject

Object to search for.

Function result

Position (index) at which object was found

Description

IndexOf overrides the TList implementation to accept an object instance instead of a pointer.

The function returns the index of the first match for AObject in the list, or -1 if no match was found.

Errors

None.

See also

TObjectList.FindInstanceOf

Search for an instance of a certain class


TObjectList.Insert

Insert an object in the list.

Declaration

Source position: contnrs.pp line 87

public procedure TObjectList.Insert(

  Index: Integer;

  AObject: TObject

);

Arguments

Index | Position to insert object at.
AObject | Object to insert

Description

Insert inserts AObject in the list at position Index. The index is zero-based. This method overrides the implementation in TList to accept objects instead of pointers.

Errors

If an invalid Index is specified, an exception is raised.

See also

TObjectList.Add | Add an object to the list.
TObjectList.Remove | Remove (and possibly free) an element from the list.


TObjectList.Items

Indexed access to the elements of the list.

Declaration

Source position: contnrs.pp line 91

public property TObjectList.Items: TObject
  read GetItem
  write SetItem;
  default;

Description

Items is the default property of the list. It provides indexed access to the elements in the list. The index Index is zero based, i.e., runs from 0 (zero) to Count-1.

See also

#rtl.classes.TList.Count


TObjectList.Last

Return the last non-nil object in the list.

Declaration

Source position: contnrs.pp line 89

public function TObjectList.Last: TObject;

Function result

Last non-nil object in the list.

Description

Last returns a reference to the last non-Nil element in the list. If no non-Nil element is found, Nil is returned.

Errors

None.

See also

TObjectList.First

Return the first non-nil object in the list

TObjectList.Pack


TObjectList.Notify

Declaration

Source position: contnrs.pp line 76

protected procedure TObjectList.Notify(

  Ptr: Pointer;

  Action: TListNotification

); override;


TObjectList.OwnsObjects

Should the list free elements when they are removed.

Declaration

Source position: contnrs.pp line 90

public property TObjectList.OwnsObjects: Boolean
  read FFreeObjects
  write FFreeObjects;

Description

OwnsObjects determines whether the objects in the list should be freed when they are removed (not extracted) from the list, or when the list is cleared. If the property is True then they are freed. If the property is False the elements are not freed.

The value is usually set in the constructor, and is seldom changed during the lifetime of the list. It defaults to True.

See also

TObjectList.Create | Create a new object list.
TObjectList.Delete
TObjectList.Remove | Remove (and possibly free) an element from the list.
TObjectList.Clear


TObjectList.Remove

Remove (and possibly free) an element from the list.

Declaration

Source position: contnrs.pp line 84

public function TObjectList.Remove(

  AObject: TObject

):Integer;

Arguments

AObject

Object to remove from the list.

Function result

Index of the removed object, or -1 if none was removed.

Description

Remove removes Item from the list, if it is present in the list. It frees Item if OwnsObjects is True, and returns the index of the object that was found in the list, or -1 if the object was not found.

Note that only the first found object is removed from the list.

Errors

None.

See also

TObjectList.Extract

Extract an object from the list.


TObjectList.SetItem

Declaration

Source position: contnrs.pp line 78

protected procedure TObjectList.SetItem(

  Index: Integer;

  AObject: TObject

);


TObjectListCallback

Method callback type for TFPObjectList.ForEachCall

Declaration

Source position: contnrs.pp line 28

type TObjectListCallback = procedure(

  data: TObject;

  arg: pointer

) of object;

Arguments

data | Object from the list
arg | Data passed to ForEachCall

Description

TObjectListCallback is used as the prototype for the TFPObjectList.ForEachCall link call when a method should be called. The Data argument will contain each of the objects in the list in turn, and the Data argument will contain the data passed to the ForEachCall call.

See also

TFPObjectList.ForEachCall

For each object in the list, call a method or procedure, passing it the object.


TObjectListStaticCallback

Plan procedure callback type for TFPObjectList.ForEachCall

Declaration

Source position: contnrs.pp line 29

type TObjectListStaticCallback = procedure(

  data: TObject;

  arg: pointer

);

Arguments

data | Object from the list
arg | Data passed to ForEachCall

Description

TObjectListCallback is used as the prototype for the TFPObjectList.ForEachCall link call when a plain procedure should be called. The Data argument will contain each of the objects in the list in turn, and the Data argument will contain the data passed to the ForEachCall call.

See also

TFPObjectList.ForEachCall

For each object in the list, call a method or procedure, passing it the object.


TObjectQueue

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: contnrs.pp line 172

type TObjectQueue = class(TQueue)
public
function Push(); | Push an object on the queue
function Pop; | Pop the first element off the queue
function Peek; | Look at the first object in the queue.
end;

Inheritance

TObjectQueue
|
TQueue | Pointer queue
|
TOrderedList | Base class for queues and stacks.
|
TObject


TObjectQueue

TQueue

TOrderedList

pt

ro

List


pt

ro

List (TOrderedList)


TObjectQueue
 | Push
 | Pop
 | Peek
TQueue
pt | PushItem
TOrderedList
pt | PushItem
pt | PopItem
pt | PeekItem
 | Create
 | Destroy
 | Count
 | AtLeast
 | Push
 | Pop
 | Peek


 | AtLeast (TOrderedList)
 | Count (TOrderedList)
 | Create (TOrderedList)
 | Destroy (TOrderedList)
 | Peek (TOrderedList)
 | Peek (TObjectQueue)
pt | PeekItem (TOrderedList)
 | Pop (TOrderedList)
 | Pop (TObjectQueue)
pt | PopItem (TOrderedList)
 | Push (TOrderedList)
 | Push (TObjectQueue)
pt | PushItem (TOrderedList)
pt | PushItem (TQueue)


TObjectQueue

TQueue

TOrderedList


TObjectQueue.Peek

Look at the first object in the queue.

Declaration

Source position: contnrs.pp line 176

public function TObjectQueue.Peek: TObject;

Function result

The first element in the queue, or Nil if the queue is empty

Description

Peek returns the first object in the queue, without removing it from the queue. If there are no more objects in the queue, Nil is returned.

Errors

None

See also

TObjectQueue.Push | Push an object on the queue
TObjectQueue.Pop | Pop the first element off the queue


TObjectQueue.Pop

Pop the first element off the queue

Declaration

Source position: contnrs.pp line 175

public function TObjectQueue.Pop: TObject;

Function result

The first element in the queue, or Nil if the queue is empty

Description

Pop removes the first element in the queue, and returns a reference to the instance. If the queue is empty, Nil is returned.

Errors

None.

See also

TObjectQueue.Push | Push an object on the queue
TObjectQueue.Peek | Look at the first object in the queue.


TObjectQueue.Push

Push an object on the queue

Declaration

Source position: contnrs.pp line 174

public function TObjectQueue.Push(

  AObject: TObject

):TObject;

Arguments

AObject

Object to push on the queue

Function result

The element just pushed on the queue

Description

Push pushes another object on the queue. It overrides the Push method as implemented in TQueue so it accepts only objects as arguments.

Errors

If not enough memory is available to expand the queue, an exception may be raised.

See also

TObjectQueue.Pop | Pop the first element off the queue
TObjectQueue.Peek | Look at the first object in the queue.


TObjectStack

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Object instances stack

Declaration

Source position: contnrs.pp line 156

type TObjectStack = class(TStack)
public
function Push(); | Push an object on the stack.
function Pop; | Pop the top object of the stack.
function Peek; | Look at the top object in the stack.
end;

Inheritance

TObjectStack | Object instances stack
|
TStack | Pointer Stack
|
TOrderedList | Base class for queues and stacks.
|
TObject

Description

TObjectStack is a stack implementation which manages pointers only.

TObjectStack introduces no new behaviour, it simply overrides some methods to accept and/or return TObject instances instead of pointers.

See also

TOrderedList | Base class for queues and stacks.
TStack | Pointer Stack
TQueue | Pointer queue
TObjectQueue


TObjectStack

TStack

TOrderedList

pt

ro

List


TObjectStack
 | Push
 | Pop
 | Peek
TStack
pt | PushItem
TOrderedList
pt | PushItem
pt | PopItem
pt | PeekItem
 | Create
 | Destroy
 | Count
 | AtLeast
 | Push
 | Pop
 | Peek


 | AtLeast (TOrderedList)
 | Count (TOrderedList)
 | Create (TOrderedList)
 | Destroy (TOrderedList)
 | Peek (TOrderedList)
 | Peek (TObjectStack)
pt | PeekItem (TOrderedList)
 | Pop (TOrderedList)
 | Pop (TObjectStack)
pt | PopItem (TOrderedList)
 | Push (TOrderedList)
 | Push (TObjectStack)
pt | PushItem (TOrderedList)
pt | PushItem (TStack)


TObjectStack

TStack

TOrderedList


TObjectStack.Peek

Look at the top object in the stack.

Declaration

Source position: contnrs.pp line 160

public function TObjectStack.Peek: TObject;

Function result

The top object on the stack, or Nil if the stack is empty.

Description

Peek returns the top object of the stack, without removing it from the stack. If there are no more objects on the stack, Nil is returned.

Errors

None

See also

TObjectStack.Push | Push an object on the stack.
TObjectStack.Pop | Pop the top object of the stack.


TObjectStack.Pop

Pop the top object of the stack.

Declaration

Source position: contnrs.pp line 159

public function TObjectStack.Pop: TObject;

Function result

The top object on the stack, or Nil if the stack is empty.

Description

Pop pops the top object of the stack, and returns the object instance. If there are no more objects on the stack, Nil is returned.

Errors

None

See also

TObjectStack.Push | Push an object on the stack.
TObjectStack.Peek | Look at the top object in the stack.


TObjectStack.Push

Push an object on the stack.

Declaration

Source position: contnrs.pp line 158

public function TObjectStack.Push(

  AObject: TObject

):TObject;

Arguments

AObject

The object instance to push on the stack.

Function result

The element pushed on the stack.

Description

Push pushes another object on the stack. It overrides the Push method as implemented in TStack so it accepts only objects as arguments.

Errors

If not enough memory is available to expand the stack, an exception may be raised.

See also

TObjectStack.Pop | Pop the top object of the stack.
TObjectStack.Peek | Look at the top object in the stack.


TOrderedList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base class for queues and stacks.

Declaration

Source position: contnrs.pp line 129

type TOrderedList = class(TObject)
protected
procedure PushItem(); virtual; abstract;
function PopItem; virtual;
function PeekItem; virtual;
property List: TList; [r]
public
constructor Create; | Create a new ordered list
destructor Destroy; override; | Free an ordered list
function Count; | Number of elements on the list.
function AtLeast(); | Check whether the list contains a certain number of elements.
function Push(); | Push another element on the list.
function Pop; | Remove an element from the list.
function Peek; | Return the next element to be popped from the list.
end;

Inheritance

TOrderedList

Base class for queues and stacks.
|

TObject

Description

TOrderedList provides the base class for TQueue and TStack. It provides an interface for pushing and popping elements on or off the list, and manages the internal list of pointers.

Note that TOrderedList does not manage objects on the stack, i.e. objects are not freed when the ordered list is destroyed.

See also

TQueue | Pointer queue
TStack | Pointer Stack


TOrderedList

pt

ro

List


TOrderedList
pt | PushItem
pt | PopItem
pt | PeekItem
 | Create
 | Destroy
 | Count
 | AtLeast
 | Push
 | Pop
 | Peek


 | AtLeast (TOrderedList)
 | Count (TOrderedList)
 | Create (TOrderedList)
 | Destroy (TOrderedList)
 | Peek (TOrderedList)
pt | PeekItem (TOrderedList)
 | Pop (TOrderedList)
pt | PopItem (TOrderedList)
 | Push (TOrderedList)
pt | PushItem (TOrderedList)


TOrderedList


TOrderedList.AtLeast

Check whether the list contains a certain number of elements.

Declaration

Source position: contnrs.pp line 141

public function TOrderedList.AtLeast(

  ACount: Integer

):Boolean;

Arguments

ACount

Required number of elements

Function result

True if ACount or more elements in the list.

Description

AtLeast returns True if the number of elements in the list is equal to or bigger than ACount. It returns False otherwise.

Errors

None.

See also

TOrderedList.Count

Number of elements on the list.


TOrderedList.Count

Number of elements on the list.

Declaration

Source position: contnrs.pp line 140

public function TOrderedList.Count: Integer;

Function result

Number of elements on the list.

Description

Count is the number of pointers in the list.

Errors

None.

See also

TOrderedList.AtLeast

Check whether the list contains a certain number of elements.


TOrderedList.Create

Create a new ordered list

Declaration

Source position: contnrs.pp line 138

public constructor TOrderedList.Create;

Description

Create instantiates a new ordered list. It initializes the internal pointer list.

Errors

None.

See also

TOrderedList.Destroy

Free an ordered list


TOrderedList.Destroy

Free an ordered list

Declaration

Source position: contnrs.pp line 139

public destructor TOrderedList.Destroy; override;

Description

Destroy cleans up the internal pointer list, and removes the TOrderedList instance from memory.

Errors

None.

See also

TOrderedList.Create

Create a new ordered list


TOrderedList.List

Declaration

Source position: contnrs.pp line 136

protected property TOrderedList.List: TList
  read FList;


TOrderedList.Peek

Return the next element to be popped from the list.

Declaration

Source position: contnrs.pp line 144

public function TOrderedList.Peek: Pointer;

Function result

Next element to be popped from the list.

Description

Peek returns the element that will be popped from the list at the next call to Pop, without actually popping it from the list.

Errors

None.

See also

TOrderedList.Pop | Remove an element from the list.
TOrderedList.Push | Push another element on the list.


TOrderedList.PeekItem

Declaration

Source position: contnrs.pp line 135

protected function TOrderedList.PeekItem: Pointer; virtual;


TOrderedList.Pop

Remove an element from the list.

Declaration

Source position: contnrs.pp line 143

public function TOrderedList.Pop: Pointer;

Function result

The element removed from the list.

Description

Pop removes an element from the list, and returns the element that was removed from the list. If no element is on the list, Nil is returned.

Errors

None.

See also

TOrderedList.Peek | Return the next element to be popped from the list.
TOrderedList.Push | Push another element on the list.


TOrderedList.PopItem

Declaration

Source position: contnrs.pp line 134

protected function TOrderedList.PopItem: Pointer; virtual;


TOrderedList.Push

Push another element on the list.

Declaration

Source position: contnrs.pp line 142

public function TOrderedList.Push(

  AItem: Pointer

):Pointer;

Arguments

AItem

Item to add to the list.

Function result

The element added to the list.

Description

Push adds AItem to the list, and returns AItem.

Errors

If not enough memory is available to expand the list, an exception may be raised.

See also

TOrderedList.Pop | Remove an element from the list.
TOrderedList.Peek | Return the next element to be popped from the list.


TOrderedList.PushItem

Declaration

Source position: contnrs.pp line 133

protected procedure TOrderedList.PushItem(

  AItem: Pointer

); virtual; abstract;


TQueue

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Pointer queue

Declaration

Source position: contnrs.pp line 165

type TQueue = class(TOrderedList)

protected

  procedure PushItem(); override;

end;

Inheritance

TQueue | Pointer queue
|
TOrderedList | Base class for queues and stacks.
|
TObject

Description

TQueue is a descendent of TOrderedList which implements Push and Pop behaviour as a queue: what is first pushed on the queue, is popped of first (FIFO: First in, first out).

TQueue offers no new methods, it merely implements some abstract methods introduced by TOrderedList

See also

TOrderedList | Base class for queues and stacks.
TObjectQueue
TStack | Pointer Stack


TQueue

TOrderedList

pt

ro

List


TQueue
pt | PushItem
TOrderedList
pt | PushItem
pt | PopItem
pt | PeekItem
 | Create
 | Destroy
 | Count
 | AtLeast
 | Push
 | Pop
 | Peek


 | AtLeast (TOrderedList)
 | Count (TOrderedList)
 | Create (TOrderedList)
 | Destroy (TOrderedList)
 | Peek (TOrderedList)
pt | PeekItem (TOrderedList)
 | Pop (TOrderedList)
pt | PopItem (TOrderedList)
 | Push (TOrderedList)
pt | PushItem (TOrderedList)
pt | PushItem (TQueue)


TQueue

TOrderedList


TQueue.PushItem

Declaration

Source position: contnrs.pp line 167

protected procedure TQueue.PushItem(

  AItem: Pointer

); override;


TStack

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Pointer Stack

Declaration

Source position: contnrs.pp line 149

type TStack = class(TOrderedList)

protected

  procedure PushItem(); override;

end;

Inheritance

TStack | Pointer Stack
|
TOrderedList | Base class for queues and stacks.
|
TObject

Description

TStack is a descendent of TOrderedList which implements Push and Pop behaviour as a stack: what is last pushed on the stack, is popped of first (LIFO: Last in, first out).

TStack offers no new methods, it merely implements some abstract methods introduced by TOrderedList

See also

TOrderedList | Base class for queues and stacks.
TObjectStack | Object instances stack
TQueue | Pointer queue


TStack

TOrderedList

pt

ro

List


TStack
pt | PushItem
TOrderedList
pt | PushItem
pt | PopItem
pt | PeekItem
 | Create
 | Destroy
 | Count
 | AtLeast
 | Push
 | Pop
 | Peek


 | AtLeast (TOrderedList)
 | Count (TOrderedList)
 | Create (TOrderedList)
 | Destroy (TOrderedList)
 | Peek (TOrderedList)
pt | PeekItem (TOrderedList)
 | Pop (TOrderedList)
pt | PopItem (TOrderedList)
 | Push (TOrderedList)
pt | PushItem (TOrderedList)
pt | PushItem (TStack)


TStack

TOrderedList


TStack.PushItem

Declaration

Source position: contnrs.pp line 151

protected procedure TStack.PushItem(

  AItem: Pointer

); override;


TCustomApplication

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ancestor class for TApplication classes.

Declaration

Source position: custapp.pp line 26

type TCustomApplication = class(TComponent)
protected
procedure SetTitle(); virtual;
function GetConsoleApplication; virtual;
procedure DoRun; virtual;
function GetParams(); virtual;
function GetParamCount; virtual;
public
constructor Create(); override; | Create a new instance of the TCustomApplication class
destructor Destroy; override; | Destroys the TCustomApplication instance.
procedure HandleException(); virtual; | Handle an exception.
procedure Initialize; virtual; | Initialize the application
procedure Run; | Runs the application.
procedure ShowException(); virtual; | Show an exception to the user
procedure Terminate; virtual; | Terminate the application.
function FindOptionIndex(); | Return the index of an option.
function GetOptionValue(); | Return the value of a command-line option.
function HasOption(); | Check whether an option was specified.
function CheckOptions(); | Check whether all given options on the command-line are valid.
procedure GetEnvironmentList(); | Return a list of environment variables.
property ExeName: String; [r] | Name of the executable.
property HelpFile: String; [rw] | Location of the application help file.
property Terminated: Boolean; [r] | Was Terminate called or not
property Title: String; [rw] | Application title
property OnException: TExceptionEvent; [rw] | Exception handling event
property ConsoleApplication: Boolean; [r] | Is the application a console application or not
property Location: String; [r] | Application location
property Params: String; [r] | Command-line parameters
property ParamCount: Integer; [r] | Number of command-line parameters
property EnvironmentVariable: String; [r] | Environment variable access
property OptionChar: Char; [rw] | Command-line switch character
property CaseSensitiveOptions: Boolean; [rw] | Are options interpreted case sensitive or not
property StopOnException: Boolean; [rw] | Should the program loop stop on an exception
end;

Inheritance

TCustomApplication

Ancestor class for TApplication classes.
|

TComponent
|

TObject

Description

TCustomApplication is the ancestor class for classes that whish to implement a global application class instance. It introduces several application-wide functionalities.

  • Exception handling in HandleException, ShowException, OnException and StopOnException.
  • Command-line parameter parsing in FindOptionIndex, GetOptionValue, CheckOptions and HasOption
  • Environment variable handling in GetEnvironmentList and EnvironmentVariable.

Descendent classes need to override the DoRun protected method to implement the functionality of the program.


TCustomApplication
 | ro | ExeName
 |  | HelpFile
 | ro | Terminated
 |  | Title
 | ro | ConsoleApplication
 | ro | Location
 | ro | Params
 | ro | ParamCount
 | ro | EnvironmentVariable
 |  | OptionChar
 |  | CaseSensitiveOptions
 |  | StopOnException
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


ro | ComponentCount (TComponent)
 | ComponentIndex (TComponent)
ro | Components (TComponent)
ro | ComponentState (TComponent)
ro | ComponentStyle (TComponent)
ro | ConsoleApplication (TCustomApplication)
 | DesignInfo (TComponent)
ro | EnvironmentVariable (TCustomApplication)
ro | ExeName (TCustomApplication)
 | HelpFile (TCustomApplication)
ro | Location (TCustomApplication)
 | Name (TComponent)
 | OptionChar (TCustomApplication)
ro | Owner (TComponent)
ro | ParamCount (TCustomApplication)
ro | Params (TCustomApplication)
 | StopOnException (TCustomApplication)
 | Tag (TComponent)
ro | Terminated (TCustomApplication)
 | Title (TCustomApplication)
 | VCLComObject (TComponent)


TCustomApplication
pt | SetTitle
pt | GetConsoleApplication
pt | DoRun
pt | GetParams
pt | GetParamCount
 | Create
 | Destroy
 | HandleException
 | Initialize
 | Run
 | ShowException
 | Terminate
 | FindOptionIndex
 | GetOptionValue
 | HasOption
 | CheckOptions
 | GetEnvironmentList
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | CheckOptions (TCustomApplication)
 | Create (TComponent)
 | Create (TCustomApplication)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TCustomApplication)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoRun (TCustomApplication)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FindOptionIndex (TCustomApplication)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
pt | GetConsoleApplication (TCustomApplication)
 | GetEnvironmentList (TCustomApplication)
 | GetNamePath (TComponent)
 | GetOptionValue (TCustomApplication)
 | GetOwner (TComponent)
pt | GetParamCount (TCustomApplication)
pt | GetParams (TCustomApplication)
 | GetParentComponent (TComponent)
 | HandleException (TCustomApplication)
 | HasOption (TCustomApplication)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Initialize (TCustomApplication)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | Run (TCustomApplication)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
pt | SetTitle (TCustomApplication)
 | ShowException (TCustomApplication)
 | Terminate (TCustomApplication)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TCustomApplication

OnException

TComponent


TCustomApplication.CaseSensitiveOptions

Are options interpreted case sensitive or not

Declaration

Source position: custapp.pp line 79

public property TCustomApplication.CaseSensitiveOptions: Boolean
  read FCaseSensitiveOptions
  write FCaseSensitiveOptions;

Description

CaseSensitiveOptions determines whether FindOptionIndex and CheckOptions perform searches in a case sensitive manner or not. By default, the search is case-sensitive. Setting this property to False makes the search case-insensitive.

See also

FindOptionIndex | Return the index of an option.
GetOptionValue | Return the value of a command-line option.
HasOption | Check whether an option was specified.
OptionChar | Command-line switch character
CheckOptions | Check whether all given options on the command-line are valid.


TCustomApplication.CheckOptions

Check whether all given options on the command-line are valid.

Declaration

Source position: line 0

public function TCustomApplication.CheckOptions(

  const ShortOptions: String;

  const Longopts: TStrings;

  Opts: TStrings;

  NonOpts: TStrings

):String;

function TCustomApplication.CheckOptions(

  const ShortOptions: String;

  const Longopts: TStrings

):String;

function TCustomApplication.CheckOptions(

  const ShortOptions: String;

  const LongOpts: array of String

):String;

function TCustomApplication.CheckOptions(

  const ShortOptions: String;

  const LongOpts: String

):String;

Arguments

ShortOptions | List of valid short options.
Longopts | List of valid long options.
Opts | Valid options passed to the program.
NonOpts | Non-option strings passed to the program.

Function result

Empty string or error-message

Arguments

ShortOptions | List of valid short options.
Longopts | List of valid long options.

Function result

Empty string or error-message

Arguments

ShortOptions | List of valid short options.
LongOpts | List of valid long options.

Function result

Empty string or error-message

Arguments

ShortOptions | List of valid short options.
LongOpts | List of valid long options.

Function result

Empty string or error-message

Description

CheckOptions scans the command-line and checks whether the options given are valid options. It also checks whether options that require a valued are indeed specified with a value.

The ShortOptions contains a string with valid short option characters. Each character in the string is a valid option character. If a character is followed by a colon (:), then a value must be specified. If it is followed by 2 colon characters (::) then the value is optional.

LongOpts is a list of strings (which can be specified as an array, a TStrings instance or a string with whitespace-separated values) of valid long options.

When the function returns, if Opts is non-Nil, the Opts stringlist is filled with the passed valid options. If NonOpts is non-nil, it is filled with any non-option strings that were passed on the command-line.

The function returns an empty string if all specified options were valid options, and whether options requiring a value have a value. If an error was found during the check, the return value is a string describing the error.

Options are identified as command-line parameters which start with OptionChar (by default the dash ('-') character).

Errors

if an error was found during the check, the return value is a string describing the error.

See also

FindOptionIndex | Return the index of an option.
GetOptionValue | Return the value of a command-line option.
HasOption | Check whether an option was specified.
CaseSensitiveOptions | Are options interpreted case sensitive or not
OptionChar | Command-line switch character


TCustomApplication.ConsoleApplication

Is the application a console application or not

Declaration

Source position: custapp.pp line 73

public property TCustomApplication.ConsoleApplication: Boolean
  read GetConsoleApplication;

Description

ConsoleApplication returns True if the application is compiled as a console application (the default) or False if not. The result of this property is determined at compile-time by the settings of the compiler: it returns the value of the IsConsole constant.

See also

IsConsole


TCustomApplication.Create

Create a new instance of the TCustomApplication class

Declaration

Source position: custapp.pp line 46

public constructor TCustomApplication.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner component. Usually Nil.

Description

Create creates a new instance of the TCustomApplication class. It sets some defaults for the various properties, and then calls the inherited Create.

See also

TCustomApplication.Destroy

Destroys the TCustomApplication instance.


TCustomApplication.Destroy

Destroys the TCustomApplication instance.

Declaration

Source position: custapp.pp line 47

public destructor TCustomApplication.Destroy; override;

Description

Destroy simply calls the inherited Destroy.

See also

TCustomApplication.Create

Create a new instance of the TCustomApplication class


TCustomApplication.DoRun

Declaration

Source position: custapp.pp line 42

protected procedure TCustomApplication.DoRun; virtual;


TCustomApplication.EnvironmentVariable

Environment variable access

Declaration

Source position: custapp.pp line 77

public property TCustomApplication.EnvironmentVariable: String
  read GetEnvironmentVar;

Description

EnvironmentVariable gives access to the environment variables of the application: It returns the value of the environment variable EnvName, or an empty string if no such value is available.

To use this property, the name of the environment variable must be known. To get a list of available names (and values), GetEnvironmentList can be used.

See also

GetEnvironmentList | Return a list of environment variables.
TCustomApplication.Params | Command-line parameters


TCustomApplication.ExeName

Name of the executable.

Declaration

Source position: custapp.pp line 67

public property TCustomApplication.ExeName: String
  read GetExeName;

Description

ExeName returns the full name of the executable binary (path+filename). This is equivalent to Paramstr(0)

Note that some operating systems do not return the full pathname of the binary.

See also

ParamStr


TCustomApplication.FindOptionIndex

Return the index of an option.

Declaration

Source position: custapp.pp line 55

public function TCustomApplication.FindOptionIndex(

  const S: String;

  var Longopt: Boolean

):Integer;

Arguments

S | Short option to search for.
Longopt | Long option to search for.

Function result

Position on commandline of option.

Description

FindOptionIndex will return the index of the option S or the long option LongOpt. Neither of them should include the switch character. If no such option was specified, -1 is returned. If either the long or short option was specified, then the position on the command-line is returned.

Depending on the value of the CaseSensitiveOptions property, the search is performed case sensitive or case insensitive.

Options are identified as command-line parameters which start with OptionChar (by default the dash ('-') character).

See also

HasOption | Check whether an option was specified.
GetOptionValue | Return the value of a command-line option.
CheckOptions | Check whether all given options on the command-line are valid.
CaseSensitiveOptions | Are options interpreted case sensitive or not
OptionChar | Command-line switch character


TCustomApplication.GetConsoleApplication

Declaration

Source position: custapp.pp line 41

protected function TCustomApplication.GetConsoleApplication: Boolean; virtual;


TCustomApplication.GetEnvironmentList

Return a list of environment variables.

Declaration

Source position: line 0

public procedure TCustomApplication.GetEnvironmentList(

  List: TStrings;

  NamesOnly: Boolean

);

procedure TCustomApplication.GetEnvironmentList(

  List: TStrings

);

Arguments

List | List to return environment strings in.
NamesOnly | If True, only environment variable names will be returned.

Arguments

List

List to return environment strings in.

Description

GetEnvironmentList returns a list of environment variables in List. They are in the form Name=Value, one per item in list. If NamesOnly is True, then only the names are returned.

See also

EnvironmentVariable

Environment variable access


TCustomApplication.GetOptionValue

Return the value of a command-line option.

Declaration

Source position: line 0

public function TCustomApplication.GetOptionValue(

  const S: String

):String;

function TCustomApplication.GetOptionValue(

  const C: Char;

  const S: String

):String;

Arguments

S

Long option string

Function result

Option value, or empty string.

Arguments

C | Short option character
S | Long option string

Function result

Option value, or empty string.

Description

GetOptionValue returns the value of an option. Values are specified in the usual GNU option format, either of

--longopt=Value

or

-c Value

is supported.

The function returns the specified value, or the empty string if none was specified.

Depending on the value of the CaseSensitiveOptions property, the search is performed case sensitive or case insensitive.

Options are identified as command-line parameters which start with OptionChar (by default the dash ('-') character).

See also

FindOptionIndex | Return the index of an option.
HasOption | Check whether an option was specified.
CheckOptions | Check whether all given options on the command-line are valid.
CaseSensitiveOptions | Are options interpreted case sensitive or not
OptionChar | Command-line switch character


TCustomApplication.GetParamCount

Declaration

Source position: custapp.pp line 44

protected function TCustomApplication.GetParamCount: Integer; virtual;


TCustomApplication.GetParams

Declaration

Source position: custapp.pp line 43

protected function TCustomApplication.GetParams(

  Index: Integer

):String; virtual;


TCustomApplication.HandleException

Handle an exception.

Declaration

Source position: custapp.pp line 49

public procedure TCustomApplication.HandleException(

  Sender: TObject

); virtual;

Arguments

Sender

Sender class calling this routine

Description

HandleException is called (or can be called) to handle the exception Sender. If the exception is not of class Exception then the default handling of exceptions in the SysUtils unit is called.

If the exception is of class Exception and the OnException handler is set, the handler is called with the exception object and Sender argument.

If the OnException handler is not set, then the exception is passed to the ShowException routine, which can be overridden by descendent application classes to show the exception in a way that is fit for the particular class of application. (a GUI application might show the exception in a message dialog.

When the exception is handled in the above manner, and the StopOnException property is set to True, the Terminated property is set to True, which will cause the Run loop to stop, and the application will exit.

See also

ShowException | Show an exception to the user
StopOnException | Should the program loop stop on an exception
Terminated | Was Terminate called or not
Run | Runs the application.


TCustomApplication.HasOption

Check whether an option was specified.

Declaration

Source position: line 0

public function TCustomApplication.HasOption(

  const S: String

):Boolean;

function TCustomApplication.HasOption(

  const C: Char;

  const S: String

):Boolean;

Arguments

S

Long option string

Function result

True if the option S or C was specified on the command-line.

Arguments

C | Short option character.
S | Long option string

Function result

True if the option S or C was specified on the command-line.

Description

HasOption returns True if the specified option was given on the command line. Either the short option character C or the long option S may be used. Note that both options (requiring a value) and switches can be specified.

Depending on the value of the CaseSensitiveOptions property, the search is performed case sensitive or case insensitive.

Options are identified as command-line parameters which start with OptionChar (by default the dash ('-') character).

See also

FindOptionIndex | Return the index of an option.
GetOptionValue | Return the value of a command-line option.
CheckOptions | Check whether all given options on the command-line are valid.
CaseSensitiveOptions | Are options interpreted case sensitive or not
OptionChar | Command-line switch character


TCustomApplication.HelpFile

Location of the application help file.

Declaration

Source position: custapp.pp line 68

public property TCustomApplication.HelpFile: String
  read FHelpFile
  write FHelpFile;

Description

HelpFile is the location of the application help file. It is a simple string property which can be set by an IDE such as Lazarus, and is mainly provided for compatibility with Delphi's TApplication implementation.

See also

TCustomApplication.Title

Application title


TCustomApplication.Initialize

Initialize the application

Declaration

Source position: custapp.pp line 50

public procedure TCustomApplication.Initialize; virtual;

Description

Initialize can be overridden by descendent applications to perform any initialization after the class was created. It can be used to react to properties being set at program startup. End-user code should call Initialize prior to calling Run

In TCustomApplication, Initialize sets Terminated to False.

See also

TCustomApplication.Run | Runs the application.
TCustomApplication.Terminated | Was Terminate called or not


TCustomApplication.Location

Application location

Declaration

Source position: custapp.pp line 74

public property TCustomApplication.Location: String
  read GetLocation;

Description

Location returns the directory part of the application binary. This property works on most platforms, although some platforms do not allow to retrieve this information (Mac OS under certain circumstances). See the discussion of Paramstr in the RTL documentation.

See also

Paramstr

Params

Command-line parameters


TCustomApplication.OnException

Exception handling event

Declaration

Source position: custapp.pp line 71

public property TCustomApplication.OnException: TExceptionEvent
  read FOnException
  write FOnException;

Description

OnException can be set to provide custom handling of events, instead of the default action, which is simply to show the event using ShowEvent.

If set, OnException is called by the HandleEvent routine. Do not use the OnException event directly, instead call HandleEvent

See also

ShowEvent


TCustomApplication.OptionChar

Command-line switch character

Declaration

Source position: custapp.pp line 78

public property TCustomApplication.OptionChar: Char
  read FoptionChar
  write FOptionChar;

Description

OptionChar is the character used for command line switches. By default, this is the dash ('-') character, but it can be set to any other non-alphanumerical character (although no check is performed on this).

See also

FindOptionIndex | Return the index of an option.
GetOptionValue | Return the value of a command-line option.
HasOption | Check whether an option was specified.
CaseSensitiveOptions | Are options interpreted case sensitive or not
CheckOptions | Check whether all given options on the command-line are valid.


TCustomApplication.ParamCount

Number of command-line parameters

Declaration

Source position: custapp.pp line 76

public property TCustomApplication.ParamCount: Integer
  read GetParamCount;

Description

ParamCount returns the number of command-line parameters that were passed to the program. The actual parameters can be retrieved with the Params property.

See also

Params

Command-line parameters

Paramstr

ParamCount


TCustomApplication.Params

Command-line parameters

Declaration

Source position: custapp.pp line 75

public property TCustomApplication.Params: String
  read GetParams;

Description

Params gives access to the command-line parameters. They contain the value of the Index-th parameter, where Index runs from 0 to ParamCount. It is equivalent to calling ParamStr.

See also

ParamCount

Number of command-line parameters

Paramstr


TCustomApplication.Run

Runs the application.

Declaration

Source position: custapp.pp line 51

public procedure TCustomApplication.Run;

Description

Run is the start of the user code: when called, it starts a loop and repeatedly calls DoRun until Terminated is set to True. If an exception is raised during the execution of DoRun, it is caught and handled to TCustomApplication.HandleException. If TCustomApplication.StopOnException is set to True (which is not the default), Run will exit, and the application will then terminate. The default is to call DoRun again, which is useful for applications running a message loop such as services and GUI applications.

See also

TCustomApplication.HandleException

Handle an exception.

TCustomApplication.StopException


TCustomApplication.SetTitle

Declaration

Source position: custapp.pp line 40

protected procedure TCustomApplication.SetTitle(

  const AValue: String

); virtual;


TCustomApplication.ShowException

Show an exception to the user

Declaration

Source position: custapp.pp line 52

public procedure TCustomApplication.ShowException(

  E: Exception

); virtual;

Arguments

E

Exception object to show

Description

ShowException should be overridden by descendent classes to show an exception message to the user. The default behaviour is to call the ShowException procedure in the SysUtils unit.

Descendent classes should do something appropriate for their context: GUI applications can show a message box, daemon applications can write the exception message to the system log, web applications can send a 500 error response code.

Errors

None.

See also

ShowException

TCustomApplication.HandleException

Handle an exception.

TCustomApplication.StopException


TCustomApplication.StopOnException

Should the program loop stop on an exception

Declaration

Source position: custapp.pp line 80

public property TCustomApplication.StopOnException: Boolean
  read FStopOnException
  write FStopOnException;

Description

StopOnException controls the behaviour of the Run and HandleException procedures in case of an unhandled exception in the DoRun code. If StopOnException is True then Terminate will be called after the exception was handled.

See also

Run | Runs the application.
HandleException | Handle an exception.
Terminate | Terminate the application.


TCustomApplication.Terminate

Terminate the application.

Declaration

Source position: custapp.pp line 53

public procedure TCustomApplication.Terminate; virtual;

Description

Terminate sets the Terminated property to True. By itself, this does not terminate the application. Instead, descendent classes should in their DoRun method, check the value of the Terminated property and properly shut down the application if it is set to True.

See also

TCustomApplication.Terminated | Was Terminate called or not
TCustomApplication.Run | Runs the application.


TCustomApplication.Terminated

Was Terminate called or not

Declaration

Source position: custapp.pp line 69

public property TCustomApplication.Terminated: Boolean
  read FTerminated;

Description

Terminated indicates whether Terminate was called or not. Descendent classes should check Terminated at regular intervals in their implementation of DoRun, and if it is set to True, should exit gracefully the DoRun method.

See also

Terminate

Terminate the application.


TCustomApplication.Title

Application title

Declaration

Source position: custapp.pp line 70

public property TCustomApplication.Title: String
  read FTitle
  write SetTitle;

Description

Title is a simple string property which can be set to any string describing the application. It does nothing by itself, and is mainly introduced for compatibility with Delphi's TApplication implementation.

See also

HelpFile

Location of the application help file.


EDaemon

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception used in all daemon application code

Declaration

Source position: daemonapp.pp line 382

type EDaemon = class(Exception) end;

Inheritance

EDaemon

Exception used in all daemon application code
|

Exception
|

TObject

Description

EDaemon is the exception class used by all code in the DaemonApp unit.

See also

DaemonError

Raise an EDaemon exception


EDaemon
Exception
 | HelpContext
 | Message


EDaemon
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EDaemon

Exception


TCustomDaemon

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base daemon application class

Declaration

Source position: daemonapp.pp line 41

type TCustomDaemon = class(TDataModule)
protected
function Start; virtual;
function Stop; virtual;
function Pause; virtual;
function Continue; virtual;
function Execute; virtual;
function ShutDown; virtual;
function Install; virtual;
function UnInstall; virtual;
function HandleCustomCode(); virtual;
public
procedure LogMessage(); | Log a message to the system log
procedure ReportStatus; | Report the current status to the operating system
property Definition: TDaemonDef; [r] | The definition used to instantiate this daemon instance
property DaemonThread: TThread; [r] | Thread in which daemon is running
property Controller: TDaemonController; [r] | TDaemonController instance controlling this daemon instance
property Status: TCurrentStatus; [rw] | Current status of the daemon
property Logger: TEventLog; [r] | TEventLog instance used to send messages to the system log
end;

Inheritance

TCustomDaemon

Base daemon application class
|

TDataModule
|

TObject

Description

TCustomDaemon implements all the basic calls that are needed for a daemon to function. Descendents of TCustomDaemon can override these calls to implement the daemon-specific behaviour.

TCustomDaemon is an abstract class, it should never be instantiated. Either a descendent of it must be created and instantiated, or a descendent of TDaemon can be designed to implement the behaviour of the daemon.

See also

TDaemon | Daemon class for visual development
TDaemonDef | Daemon definition
TDaemonController | Internal daemon controller class
TDaemonApplication | Default descendent of CustomDaemonApplication


TCustomDaemon
 | ro | Definition
 | ro | DaemonThread
 | ro | Controller
 |  | Status
 | ro | Logger
TDataModule
 |  | DesignOffset
 |  | DesignSize
 |  | OldCreateOrder


ro | Controller (TCustomDaemon)
ro | DaemonThread (TCustomDaemon)
ro | Definition (TCustomDaemon)
 | DesignOffset (TDataModule)
 | DesignSize (TDataModule)
ro | Logger (TCustomDaemon)
 | OldCreateOrder (TDataModule)
 | Status (TCustomDaemon)


TCustomDaemon
pt | Start
pt | Stop
pt | Pause
pt | Continue
pt | Execute
pt | ShutDown
pt | Install
pt | UnInstall
pt | HandleCustomCode
 | LogMessage
 | ReportStatus
TDataModule
 | ReadT
 | WriteT
 | ReadL
 | WriteL
 | ReadW
 | WriteW
 | ReadH
 | WriteH
 | DoCreate
 | DoDestroy
 | DefineProperties
 | GetChildren
 | HandleCreateException
 | ReadState
 | Create
 | CreateNew
 | Destroy
 | AfterConstruction
 | BeforeDestruction


pt | Continue (TCustomDaemon)
 | Create (TDataModule)
 | CreateNew (TDataModule)
 | DefineProperties (TDataModule)
 | Destroy (TDataModule)
 | DoCreate (TDataModule)
 | DoDestroy (TDataModule)
pt | Execute (TCustomDaemon)
 | GetChildren (TDataModule)
 | HandleCreateException (TDataModule)
pt | HandleCustomCode (TCustomDaemon)
pt | Install (TCustomDaemon)
 | LogMessage (TCustomDaemon)
pt | Pause (TCustomDaemon)
 | ReadH (TDataModule)
 | ReadL (TDataModule)
 | ReadState (TDataModule)
 | ReadT (TDataModule)
 | ReadW (TDataModule)
 | ReportStatus (TCustomDaemon)
pt | ShutDown (TCustomDaemon)
pt | Start (TCustomDaemon)
pt | Stop (TCustomDaemon)
pt | UnInstall (TCustomDaemon)
 | WriteH (TDataModule)
 | WriteL (TDataModule)
 | WriteT (TDataModule)
 | WriteW (TDataModule)


TCustomDaemon
TDataModule
 | OnCreate
 | OnDestroy


TCustomDaemon.Continue

Declaration

Source position: daemonapp.pp line 53

protected function TCustomDaemon.Continue: Boolean; virtual;


TCustomDaemon.Controller

TDaemonController instance controlling this daemon instance

Declaration

Source position: daemonapp.pp line 66

public property TCustomDaemon.Controller: TDaemonController
  read FController;

Description

Controller points to the TDaemonController instance that was created by the application instance to control this daemon.

See also

DaemonThread

Thread in which daemon is running


TCustomDaemon.DaemonThread

Thread in which daemon is running

Declaration

Source position: daemonapp.pp line 65

public property TCustomDaemon.DaemonThread: TThread
  read FThread;

Description

DaemonThread is the thread in which the daemon instance is running. Each daemon instance in the application runs in it's own thread, none of which are the main thread of the application. The application main thread is used to handle control messages coming from the operating system.

See also

Controller

TDaemonController instance controlling this daemon instance


TCustomDaemon.Definition

The definition used to instantiate this daemon instance

Declaration

Source position: daemonapp.pp line 64

public property TCustomDaemon.Definition: TDaemonDef
  read FDaemonDef;

Description

Definition is the TDaemonDef definition that was used to start the daemon instance. It can be used to retrieve additional information about the intended behaviour of the daemon.

See also

TDaemonDef

Daemon definition


TCustomDaemon.Execute

Declaration

Source position: daemonapp.pp line 54

protected function TCustomDaemon.Execute: Boolean; virtual;


TCustomDaemon.HandleCustomCode

Declaration

Source position: daemonapp.pp line 58

protected function TCustomDaemon.HandleCustomCode(

  ACode: DWord

):Boolean; virtual;


TCustomDaemon.Install

Declaration

Source position: daemonapp.pp line 56

protected function TCustomDaemon.Install: Boolean; virtual;


TCustomDaemon.Logger

TEventLog instance used to send messages to the system log

Declaration

Source position: daemonapp.pp line 68

public property TCustomDaemon.Logger: TEventLog
  read GetLogger;

Description

Logger is the TEventLog instance used to send messages to the system log. It is used by the LogMessage call, but is acessible through the Logger property in case more configurable logging is needed than offered by LogMessage.

See also

LogMessage | Log a message to the system log
TEventLog | Event logging class


TCustomDaemon.LogMessage

Log a message to the system log

Declaration

Source position: daemonapp.pp line 60

public procedure TCustomDaemon.LogMessage(

  Msg: String

);

Arguments

Msg

Message to send to the system log

Description

LogMessage can be used to send a message Msg to the system log. A TEventLog instance is used to actually send messages to the system log.

The message is sent with an 'error' flag (using TEventLog.Error).

Errors

None.

See also

ReportStatus

Report the current status to the operating system


TCustomDaemon.Pause

Declaration

Source position: daemonapp.pp line 52

protected function TCustomDaemon.Pause: Boolean; virtual;


TCustomDaemon.ReportStatus

Report the current status to the operating system

Declaration

Source position: daemonapp.pp line 61

public procedure TCustomDaemon.ReportStatus;

Description

ReportStatus can be used to report the current status to the operating system. The start and stop or pause and continue operations can be slow to start up. This call can (and should) be used to report the current status to the operating system during such lengthy operations, or else it may conclude that the daemon has died.

This call is mostly important on windows operating systems, to notify the service manager that the operation is still in progress.

The implementation of ReportStatus simply calls ReportStatus in the controller.

Errors

None.

See also

LogMessage

Log a message to the system log


TCustomDaemon.ShutDown

Declaration

Source position: daemonapp.pp line 55

protected function TCustomDaemon.ShutDown: Boolean; virtual;


TCustomDaemon.Start

Declaration

Source position: daemonapp.pp line 50

protected function TCustomDaemon.Start: Boolean; virtual;


TCustomDaemon.Status

Current status of the daemon

Declaration

Source position: daemonapp.pp line 67

public property TCustomDaemon.Status: TCurrentStatus
  read FStatus
  write SetStatus;

Description

Status indicates the current status of the daemon. It is set by the various operations that the controller operates on the daemon, and should not be set manually.

Status is the value which ReportStatus will send to the operating system.

See also

ReportStatus

Report the current status to the operating system


TCustomDaemon.Stop

Declaration

Source position: daemonapp.pp line 51

protected function TCustomDaemon.Stop: Boolean; virtual;


TCustomDaemon.UnInstall

Declaration

Source position: daemonapp.pp line 57

protected function TCustomDaemon.UnInstall: Boolean; virtual;


TCustomDaemonApplication

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Custom daemon application class

Declaration

Source position: daemonapp.pp line 328

type TCustomDaemonApplication = class(TCustomApplication)
protected
procedure SysStartUnInstallDaemons;
procedure SysEndUnInstallDaemons;
procedure SysStartInstallDaemons;
procedure SysEndInstallDaemons;
procedure SysStartRunDaemons;
procedure SysEndRunDaemons;
procedure CreateDaemonController(); virtual;
procedure CreateServiceMapper(); virtual;
procedure CreateDaemonInstance(); virtual;
procedure RemoveController(); virtual;
procedure SetupLogger;
procedure StopLogger;
procedure DoRun; override;
property OnRun: TNotifyEvent; [rw]
property SysData: TObject; [rw]
public
procedure ShowException(); override; | Show an exception
function CreateDaemon(); | Create daemon instance
procedure StopDaemons(); | Stop all daemons
procedure InstallDaemons; | Install all daemons.
procedure RunDaemons; | Run all daemons.
procedure UnInstallDaemons; | Uninstall all daemons
procedure CreateForm(); virtual; | Create a component
property Logger: TEventLog; [r] | Event logging instance used for logging messages
property GUIMainLoop: TGuiLoopEvent; [rw] | GUI main loop callback
property GuiHandle: THandle; [rw] | Handle of GUI loop main application window handle
property RunMode: TDaemonRunMode; [r] | Application mode
end;

Inheritance

TCustomDaemonApplication | Custom daemon application class
|
TCustomApplication | Ancestor class for TApplication classes.
|
TComponent
|
TObject

Description

TCustomDaemonApplication is a TCustomApplication descendent which is the main application instance for a daemon. It handles the command-line and decides what to do when the application is started, depending on the command-line options given to the application, by calling the various methods.

It creates the necessary TDaemon instances by checking the TCustomDaemonMapperClass instance that contains the daemon maps.

See also

TCustomApplication | Ancestor class for TApplication classes.
TCustomDaemonMapperClass | Class of TCustomDaemonMapper


TCustomDaemonApplication
pt |  | SysData
 | ro | Logger
 |  | GUIMainLoop
 |  | GuiHandle
 | ro | RunMode
TCustomApplication
 | ro | ExeName
 |  | HelpFile
 | ro | Terminated
 |  | Title
 | ro | ConsoleApplication
 | ro | Location
 | ro | Params
 | ro | ParamCount
 | ro | EnvironmentVariable
 |  | OptionChar
 |  | CaseSensitiveOptions
 |  | StopOnException
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 | ro | ConsoleApplication (TCustomApplication)
 |  | DesignInfo (TComponent)
 | ro | EnvironmentVariable (TCustomApplication)
 | ro | ExeName (TCustomApplication)
 |  | GuiHandle (TCustomDaemonApplication)
 |  | GUIMainLoop (TCustomDaemonApplication)
 |  | HelpFile (TCustomApplication)
 | ro | Location (TCustomApplication)
 | ro | Logger (TCustomDaemonApplication)
 |  | Name (TComponent)
 |  | OptionChar (TCustomApplication)
 | ro | Owner (TComponent)
 | ro | ParamCount (TCustomApplication)
 | ro | Params (TCustomApplication)
 | ro | RunMode (TCustomDaemonApplication)
 |  | StopOnException (TCustomApplication)
pt |  | SysData (TCustomDaemonApplication)
 |  | Tag (TComponent)
 | ro | Terminated (TCustomApplication)
 |  | Title (TCustomApplication)
 |  | VCLComObject (TComponent)


TCustomDaemonApplication
pt | SysStartUnInstallDaemons
pt | SysEndUnInstallDaemons
pt | SysStartInstallDaemons
pt | SysEndInstallDaemons
pt | SysStartRunDaemons
pt | SysEndRunDaemons
pt | CreateDaemonController
pt | CreateServiceMapper
pt | CreateDaemonInstance
pt | RemoveController
pt | SetupLogger
pt | StopLogger
pt | DoRun
 | ShowException
 | CreateDaemon
 | StopDaemons
 | InstallDaemons
 | RunDaemons
 | UnInstallDaemons
 | CreateForm
TCustomApplication
pt | SetTitle
pt | GetConsoleApplication
pt | DoRun
pt | GetParams
pt | GetParamCount
 | Create
 | Destroy
 | HandleException
 | Initialize
 | Run
 | ShowException
 | Terminate
 | FindOptionIndex
 | GetOptionValue
 | HasOption
 | CheckOptions
 | GetEnvironmentList
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | CheckOptions (TCustomApplication)
 | Create (TComponent)
 | Create (TCustomApplication)
 | CreateDaemon (TCustomDaemonApplication)
pt | CreateDaemonController (TCustomDaemonApplication)
pt | CreateDaemonInstance (TCustomDaemonApplication)
 | CreateForm (TCustomDaemonApplication)
pt | CreateServiceMapper (TCustomDaemonApplication)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TCustomApplication)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoRun (TCustomApplication)
pt | DoRun (TCustomDaemonApplication)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FindOptionIndex (TCustomApplication)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
pt | GetConsoleApplication (TCustomApplication)
 | GetEnvironmentList (TCustomApplication)
 | GetNamePath (TComponent)
 | GetOptionValue (TCustomApplication)
 | GetOwner (TComponent)
pt | GetParamCount (TCustomApplication)
pt | GetParams (TCustomApplication)
 | GetParentComponent (TComponent)
 | HandleException (TCustomApplication)
 | HasOption (TCustomApplication)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Initialize (TCustomApplication)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | InstallDaemons (TCustomDaemonApplication)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
pt | RemoveController (TCustomDaemonApplication)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | Run (TCustomApplication)
 | RunDaemons (TCustomDaemonApplication)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
pt | SetTitle (TCustomApplication)
pt | SetupLogger (TCustomDaemonApplication)
 | ShowException (TCustomApplication)
 | ShowException (TCustomDaemonApplication)
 | StopDaemons (TCustomDaemonApplication)
pt | StopLogger (TCustomDaemonApplication)
pt | SysEndInstallDaemons (TCustomDaemonApplication)
pt | SysEndRunDaemons (TCustomDaemonApplication)
pt | SysEndUnInstallDaemons (TCustomDaemonApplication)
pt | SysStartInstallDaemons (TCustomDaemonApplication)
pt | SysStartRunDaemons (TCustomDaemonApplication)
pt | SysStartUnInstallDaemons (TCustomDaemonApplication)
 | Terminate (TCustomApplication)
 | UnInstallDaemons (TCustomDaemonApplication)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TCustomDaemonApplication
pt | OnRun
TCustomApplication
 | OnException
TComponent


pt | OnRun (TCustomDaemonApplication)


TCustomDaemonApplication.CreateDaemon

Create daemon instance

Declaration

Source position: daemonapp.pp line 367

public function TCustomDaemonApplication.CreateDaemon(

  DaemonDef: TDaemonDef

):TCustomDaemon;

Arguments

DaemonDef

Daemon definition containing information to create a daemon.

Function result

New TCustomDaemon instance.

Description

CreateDaemon is called whenever a TCustomDaemon instance must be created from a TDaemonDef daemon definition, passed in DaemonDef. It initializes the TCustomDaemon instance, and creates a controller instance of type TDaemonController to control the daemon. Finally, it assigns the created daemon to the TDaemonDef.Instance property.

Errors

In case of an error, an exception may be raised.

See also

TDaemonController | Internal daemon controller class
TCustomDaemon | Base daemon application class
TDaemonDef | Daemon definition
TDaemonDef.Instance | Instance of the daemon class


TCustomDaemonApplication.CreateDaemonController

Declaration

Source position: daemonapp.pp line 356

protected procedure TCustomDaemonApplication.CreateDaemonController(

  var AController: TDaemonController

); virtual;


TCustomDaemonApplication.CreateDaemonInstance

Declaration

Source position: daemonapp.pp line 358

protected procedure TCustomDaemonApplication.CreateDaemonInstance(

  var ADaemon: TCustomDaemon;

  DaemonDef: TDaemonDef

); virtual;


TCustomDaemonApplication.CreateForm

Create a component

Declaration

Source position: daemonapp.pp line 372

public procedure TCustomDaemonApplication.CreateForm(

  InstanceClass: TComponentClass;

  var Reference

); virtual;

Arguments

InstanceClass | Class pointer of component instance to create
Reference | Variable to store the instance pointer in.

Description

CreateForm creates an instance of InstanceClass and fills Reference with the class instance pointer. It's main purpose is to give an IDE a means of assuring that forms or datamodules are created on application startup: the IDE will generate calls for all modules that are auto-created.

Errors

An exception may arise if the instance wants to stream itself from resources, but no resources are found.

See also

TCustomDaemonApplication.CreateDaemon

Create daemon instance


TCustomDaemonApplication.CreateServiceMapper

Declaration

Source position: daemonapp.pp line 357

protected procedure TCustomDaemonApplication.CreateServiceMapper(

  var AMapper: TCustomDaemonMapper

); virtual;


TCustomDaemonApplication.DoRun

Declaration

Source position: daemonapp.pp line 362

protected procedure TCustomDaemonApplication.DoRun; override;


TCustomDaemonApplication.GuiHandle

Handle of GUI loop main application window handle

Declaration

Source position: daemonapp.pp line 375

public property TCustomDaemonApplication.GuiHandle: THandle
  read FGUIHandle
  write FGUIHandle;

Description

GuiHandle is the handle of a GUI window which can be used to run a message handling loop on. It is created when no GUIMainLoop procedure exists, and the application creates and runs a message loop by itself.

See also

GUIMainLoop

GUI main loop callback


TCustomDaemonApplication.GUIMainLoop

GUI main loop callback

Declaration

Source position: daemonapp.pp line 374

public property TCustomDaemonApplication.GUIMainLoop: TGuiLoopEvent
  read FGUIMainLoop
  write FGuiMainLoop;

Description

GUIMainLoop contains a reference to a method that can be called to process a main GUI loop. The procedure should return only when the main GUI has finished and the application should exit. It is called when the daemons are running.

See also

TCustomDaemonApplication.GuiHandle

Handle of GUI loop main application window handle


TCustomDaemonApplication.InstallDaemons

Install all daemons.

Declaration

Source position: daemonapp.pp line 369

public procedure TCustomDaemonApplication.InstallDaemons;

Description

InstallDaemons installs all known daemons, i.e. registers them with the service manager on Windows. This method is called if the application is run with the -i or --install or /install command-line option.

See also

TCustomDaemonApplication.UnInstallDaemons | Uninstall all daemons
TCustomDaemonApplication.RunDaemons | Run all daemons.
TCustomDaemonApplication.StopDaemons | Stop all daemons


TCustomDaemonApplication.Logger

Event logging instance used for logging messages

Declaration

Source position: daemonapp.pp line 373

public property TCustomDaemonApplication.Logger: TEventLog
  read FLogger;

Description

Logger contains a reference to the TEventLog instance that can be used to send messages to the system log.

See also

TCustomDaemon.LogMessage

Log a message to the system log


TCustomDaemonApplication.OnRun

Declaration

Source position: daemonapp.pp line 363

protected property TCustomDaemonApplication.OnRun: TNotifyEvent
  read FOnRun
  write FOnRun;


TCustomDaemonApplication.RemoveController

Declaration

Source position: daemonapp.pp line 359

protected procedure TCustomDaemonApplication.RemoveController(

  AController: TDaemonController

); virtual;


TCustomDaemonApplication.RunDaemons

Run all daemons.

Declaration

Source position: daemonapp.pp line 370

public procedure TCustomDaemonApplication.RunDaemons;

Description

RunDaemons runs (starts) all known daemons. This method is called if the application is run with the -r or --run methods.

See also

TCustomDaemonApplication.UnInstallDaemons | Uninstall all daemons
TCustomDaemonApplication.InstallDaemons | Install all daemons.
TCustomDaemonApplication.StopDaemons | Stop all daemons


TCustomDaemonApplication.RunMode

Application mode

Declaration

Source position: daemonapp.pp line 376

public property TCustomDaemonApplication.RunMode: TDaemonRunMode
  read FRunMode;

Description

RunMode indicates in which mode the application is running currently. It is set automatically by examining the command-line, and when set, one of InstallDaemons, RunDaemons or UnInstallDaemons is called.

See also

InstallDaemons | Install all daemons.
RunDaemons | Run all daemons.
UnInstallDaemons | Uninstall all daemons


TCustomDaemonApplication.SetupLogger

Declaration

Source position: daemonapp.pp line 360

protected procedure TCustomDaemonApplication.SetupLogger;


TCustomDaemonApplication.ShowException

Show an exception

Declaration

Source position: daemonapp.pp line 366

public procedure TCustomDaemonApplication.ShowException(

  E: Exception

); override;

Arguments

E

Exception to show.

Description

ShowException is overridden by TCustomDaemonApplication, it sends the exception message to the system log.


TCustomDaemonApplication.StopDaemons

Stop all daemons

Declaration

Source position: daemonapp.pp line 368

public procedure TCustomDaemonApplication.StopDaemons(

  Force: Boolean

);

Arguments

Force

If True, send the SHUTDOWN control code

Description

StopDaemons sends the STOP control code to all daemons, or the SHUTDOWN control code in case Force is True.

See also

TDaemonController.Controller | Controller
TCustomDaemonApplication.UnInstallDaemons | Uninstall all daemons
TCustomDaemonApplication.RunDaemons | Run all daemons.


TCustomDaemonApplication.StopLogger

Declaration

Source position: daemonapp.pp line 361

protected procedure TCustomDaemonApplication.StopLogger;


TCustomDaemonApplication.SysData

Declaration

Source position: daemonapp.pp line 364

protected property TCustomDaemonApplication.SysData: TObject
  read FSysData
  write FSysData;


TCustomDaemonApplication.SysEndInstallDaemons

Declaration

Source position: daemonapp.pp line 351

protected procedure TCustomDaemonApplication.SysEndInstallDaemons;


TCustomDaemonApplication.SysEndRunDaemons

Declaration

Source position: daemonapp.pp line 353

protected procedure TCustomDaemonApplication.SysEndRunDaemons;


TCustomDaemonApplication.SysEndUnInstallDaemons

Declaration

Source position: daemonapp.pp line 349

protected procedure TCustomDaemonApplication.SysEndUnInstallDaemons;


TCustomDaemonApplication.SysStartInstallDaemons

Declaration

Source position: daemonapp.pp line 350

protected procedure TCustomDaemonApplication.SysStartInstallDaemons;


TCustomDaemonApplication.SysStartRunDaemons

Declaration

Source position: daemonapp.pp line 352

protected procedure TCustomDaemonApplication.SysStartRunDaemons;


TCustomDaemonApplication.SysStartUnInstallDaemons

Declaration

Source position: daemonapp.pp line 348

protected procedure TCustomDaemonApplication.SysStartUnInstallDaemons;


TCustomDaemonApplication.UnInstallDaemons

Uninstall all daemons

Declaration

Source position: daemonapp.pp line 371

public procedure TCustomDaemonApplication.UnInstallDaemons;

Description

UnInstallDaemons uninstalls all known daemons, i.e. deregisters them with the service manager on Windows. This method is called if the application is run with the -u or --uninstall or /uninstall command-line option.

See also

TCustomDaemonApplication.RunDaemons | Run all daemons.
TCustomDaemonApplication.InstallDaemons | Install all daemons.
TCustomDaemonApplication.StopDaemons | Stop all daemons


TCustomDaemonApplicationClass

Class pointer for TCustomDaemonApplication

Declaration

Source position: daemonapp.pp line 378

type TCustomDaemonApplicationClass = class of TCustomDaemonApplication;

See also

TCustomDaemonApplication

Custom daemon application class


TCustomDaemonMapper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Daemon mapper

Declaration

Source position: daemonapp.pp line 268

type TCustomDaemonMapper = class(TComponent)
protected
procedure CreateDefs; virtual;
procedure DoOnCreate; virtual;
procedure DoOnDestroy; virtual;
procedure DoOnInstall; virtual;
procedure DoOnUnInstall; virtual;
procedure DoOnRun; virtual;
public
constructor Create(); override; | Create a new instance of TCustomDaemonMapper
destructor Destroy; override; | Clean up and destroy a TCustomDaemonMapper instance.
published
property DaemonDefs: TDaemonDefs; [rw] | Collection of daemons
property OnCreate: TNotifyEvent; [rw] | Event called when the daemon mapper is created
property OnDestroy: TNotifyEvent; [rw] | Event called when the daemon mapper is freed.
property OnRun: TNotifyEvent; [rw] | Event called when the daemons are executed.
property OnInstall: TNotifyEvent; [rw] | Event called when the daemons are installed
property OnUnInstall: TNotifyEvent; [rw] | Event called when the daemons are uninstalled
end;

Inheritance

TCustomDaemonMapper

Daemon mapper
|

TComponent
|

TObject

Description

The TCustomDaemonMapper class is responsible for mapping a daemon definition to an actual TDaemon instance. It maintains a TDaemonDefs collection with daemon definitions, which can be used to map the definition of a daemon to a TDaemon descendent class.

An IDE such as Lazarus can design a TCustomDaemonMapper instance visually, to help establish the relationship between various TDaemonDef definitions and the actual TDaemon instances that will be used to run the daemons.

The TCustomDaemonMapper class has no support for streaming. The TDaemonMapper class has support for streaming (and hence visual designing).

See also

TDaemon | Daemon class for visual development
TDaemonDef | Daemon definition
TDaemonDefs | Collection of daemon definitions.
TDaemonMapper | Daemon mapper for designing in IDE


TCustomDaemonMapper
pl |  | DaemonDefs
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
pl |  | DaemonDefs (TCustomDaemonMapper)
 |  | DesignInfo (TComponent)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TCustomDaemonMapper
pt | CreateDefs
pt | DoOnCreate
pt | DoOnDestroy
pt | DoOnInstall
pt | DoOnUnInstall
pt | DoOnRun
 | Create
 | Destroy
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | Create (TComponent)
 | Create (TCustomDaemonMapper)
pt | CreateDefs (TCustomDaemonMapper)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TCustomDaemonMapper)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoOnCreate (TCustomDaemonMapper)
pt | DoOnDestroy (TCustomDaemonMapper)
pt | DoOnInstall (TCustomDaemonMapper)
pt | DoOnRun (TCustomDaemonMapper)
pt | DoOnUnInstall (TCustomDaemonMapper)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TCustomDaemonMapper
pl | OnCreate
pl | OnDestroy
pl | OnRun
pl | OnInstall
pl | OnUnInstall
TComponent


pl | OnCreate (TCustomDaemonMapper)
pl | OnDestroy (TCustomDaemonMapper)
pl | OnInstall (TCustomDaemonMapper)
pl | OnRun (TCustomDaemonMapper)
pl | OnUnInstall (TCustomDaemonMapper)


TCustomDaemonMapper.Create

Create a new instance of TCustomDaemonMapper

Declaration

Source position: daemonapp.pp line 285

public constructor TCustomDaemonMapper.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Instance owner

Description

Create creates a new instance of a TCustomDaemonMapper. It creates the TDaemonDefs collection and then calls the inherited constructor. It should never be necessary to create a daemon mapper manually, the application will create a global TCustomDaemonMapper instance.

See also

TDaemonDefs | Collection of daemon definitions.
TCustomDaemonApplication | Custom daemon application class
TCustomDaemonMapper.Destroy | Clean up and destroy a TCustomDaemonMapper instance.


TCustomDaemonMapper.CreateDefs

Declaration

Source position: daemonapp.pp line 278

protected procedure TCustomDaemonMapper.CreateDefs; virtual;


TCustomDaemonMapper.DaemonDefs

Collection of daemons

Declaration

Source position: daemonapp.pp line 288

published property TCustomDaemonMapper.DaemonDefs: TDaemonDefs
  read FDaemonDefs
  write SetDaemonDefs;

Description

DaemonDefs is the application's global collection of daemon definitions. This collection will be used to decide at runtime which TDaemon class must be created to run or install a daemon.

See also

TCustomDaemonApplication

Custom daemon application class


TCustomDaemonMapper.Destroy

Clean up and destroy a TCustomDaemonMapper instance.

Declaration

Source position: daemonapp.pp line 286

public destructor TCustomDaemonMapper.Destroy; override;

Description

Destroy frees the DaemonDefs collection and calls the inherited destructor.

See also

TDaemonDefs | Collection of daemon definitions.
TCustomDaemonMapper.Create | Create a new instance of TCustomDaemonMapper


TCustomDaemonMapper.DoOnCreate

Declaration

Source position: daemonapp.pp line 279

protected procedure TCustomDaemonMapper.DoOnCreate; virtual;


TCustomDaemonMapper.DoOnDestroy

Declaration

Source position: daemonapp.pp line 280

protected procedure TCustomDaemonMapper.DoOnDestroy; virtual;


TCustomDaemonMapper.DoOnInstall

Declaration

Source position: daemonapp.pp line 281

protected procedure TCustomDaemonMapper.DoOnInstall; virtual;


TCustomDaemonMapper.DoOnRun

Declaration

Source position: daemonapp.pp line 283

protected procedure TCustomDaemonMapper.DoOnRun; virtual;


TCustomDaemonMapper.DoOnUnInstall

Declaration

Source position: daemonapp.pp line 282

protected procedure TCustomDaemonMapper.DoOnUnInstall; virtual;


TCustomDaemonMapper.OnCreate

Event called when the daemon mapper is created

Declaration

Source position: daemonapp.pp line 289

published property TCustomDaemonMapper.OnCreate: TNotifyEvent
  read FOnCreate
  write FOnCreate;

Description

OnCreate is an event that is called when the TCustomDaemonMapper instance is created. It can for instance be used to dynamically create daemon definitions at runtime.

See also

OnDestroy | Event called when the daemon mapper is freed.
OnUnInstall | Event called when the daemons are uninstalled
OnCreate | Event called when the daemon mapper is created
OnDestroy | Event called when the daemon mapper is freed.


TCustomDaemonMapper.OnDestroy

Event called when the daemon mapper is freed.

Declaration

Source position: daemonapp.pp line 290

published property TCustomDaemonMapper.OnDestroy: TNotifyEvent
  read FOnDestroy
  write FOnDestroy;

Description

OnDestroy is called when the global daemon mapper instance is destroyed. it can be used to release up any resources that were allocated when the instance was created, in the OnCreate event.

See also

OnCreate | Event called when the daemon mapper is created
OnInstall | Event called when the daemons are installed
OnUnInstall | Event called when the daemons are uninstalled
OnCreate | Event called when the daemon mapper is created


TCustomDaemonMapper.OnInstall

Event called when the daemons are installed

Declaration

Source position: daemonapp.pp line 292

published property TCustomDaemonMapper.OnInstall: TNotifyEvent
  read FOnInstall
  write FOnInstall;

Description

OnInstall is the event called when the daemon application is executed to install the daemons (with command-line parameter '-i' or '/install'). it is called exactly once.

See also

OnRun | Event called when the daemons are executed.
OnUnInstall | Event called when the daemons are uninstalled
OnCreate | Event called when the daemon mapper is created
OnDestroy | Event called when the daemon mapper is freed.


TCustomDaemonMapper.OnRun

Event called when the daemons are executed.

Declaration

Source position: daemonapp.pp line 291

published property TCustomDaemonMapper.OnRun: TNotifyEvent
  read FOnRun
  write FOnRun;

Description

OnRun is the event called when the daemon application is executed to run the daemons (with command-line parameter '-r'). it is called exactly once.

See also

OnInstall | Event called when the daemons are installed
OnUnInstall | Event called when the daemons are uninstalled
OnCreate | Event called when the daemon mapper is created
OnDestroy | Event called when the daemon mapper is freed.


TCustomDaemonMapper.OnUnInstall

Event called when the daemons are uninstalled

Declaration

Source position: daemonapp.pp line 293

published property TCustomDaemonMapper.OnUnInstall: TNotifyEvent
  read FOnUnInStall
  write FOnUninStall;

Description

OnUnInstall is the event called when the daemon application is executed to uninstall the daemons (with command-line parameter '-u' or '/uninstall'). it is called exactly once.

See also

OnRun | Event called when the daemons are executed.
OnInstall | Event called when the daemons are installed
OnCreate | Event called when the daemon mapper is created
OnDestroy | Event called when the daemon mapper is freed.


TCustomDaemonMapperClass

Class of TCustomDaemonMapper

Declaration

Source position: daemonapp.pp line 303

type TCustomDaemonMapperClass = class of TCustomDaemonMapper;

Description

TCustomDaemonMapperClass is the class of TCustomDaemonMapper. It is used in the RegisterDaemonMapper call.

See also

RegisterDaemonMapper

Register a daemon mapper class


TDaemon

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Daemon class for visual development

Declaration

Source position: daemonapp.pp line 76

type TDaemon = class(TCustomDaemon)
protected
function Start; override;
function Stop; override;
function Pause; override;
function Continue; override;
function Execute; override;
function ShutDown; override;
function Install; override;
function UnInstall; override;
function HandleCustomCode(); override;
public
property Definition;
property Status;
published
property OnStart: TDaemonOKEvent; [rw] | Daemon start event
property OnStop: TDaemonOKEvent; [rw] | Daemon stop event
property OnPause: TDaemonOKEvent; [rw] | Daemon pause event
property OnContinue: TDaemonOKEvent; [rw] | Daemon continue
property OnShutDown: TDaemonEvent; [rw] | Daemon shutdown
property OnExecute: TDaemonEvent; [rw] | Daemon execute event
property BeforeInstall: TDaemonEvent; [rw] | Called before the daemon will be installed
property AfterInstall: TDaemonEvent; [rw] | Called after the daemon was installed
property BeforeUnInstall: TDaemonEvent; [rw] | Called before the daemon is uninstalled
property AfterUnInstall: TDaemonEvent; [rw] | Called after the daemon is uninstalled
property OnControlCode: TCustomControlCodeEvent; [rw] | Called when a control code is received for the daemon
end;

Inheritance

TDaemon | Daemon class for visual development
|
TCustomDaemon | Base daemon application class
|
TDataModule
|
TObject

Description

TDaemon is a TCustomDaemon descendent which is meant for development in a visual environment: it contains event handlers for all major operations. Whenever a TCustomDaemon method is executed, it's execution is shunted to the event handler, which can be filled with code in the IDE.

All the events of the daemon are executed in the thread in which the daemon's controller is running (as given by DaemonThread), which is not the main program thread.

See also

TCustomDaemon | Base daemon application class
TDaemonController | Internal daemon controller class


TDaemon
 | ro | Definition
 | ro | Status
pl |  | BeforeInstall
pl |  | AfterInstall
pl |  | BeforeUnInstall
pl |  | AfterUnInstall
TCustomDaemon
 | ro | Definition
 | ro | DaemonThread
 | ro | Controller
 |  | Status
 | ro | Logger
TDataModule
 |  | DesignOffset
 |  | DesignSize
 |  | OldCreateOrder


pl |  | AfterInstall (TDaemon)
pl |  | AfterUnInstall (TDaemon)
pl |  | BeforeInstall (TDaemon)
pl |  | BeforeUnInstall (TDaemon)
 | ro | Controller (TCustomDaemon)
 | ro | DaemonThread (TCustomDaemon)
 | ro | Definition (TCustomDaemon)
 | ro | Definition (TDaemon)
 |  | DesignOffset (TDataModule)
 |  | DesignSize (TDataModule)
 | ro | Logger (TCustomDaemon)
 |  | OldCreateOrder (TDataModule)
 |  | Status (TCustomDaemon)
 | ro | Status (TDaemon)


TDaemon
pt | Start
pt | Stop
pt | Pause
pt | Continue
pt | Execute
pt | ShutDown
pt | Install
pt | UnInstall
pt | HandleCustomCode
TCustomDaemon
pt | Start
pt | Stop
pt | Pause
pt | Continue
pt | Execute
pt | ShutDown
pt | Install
pt | UnInstall
pt | HandleCustomCode
 | LogMessage
 | ReportStatus
TDataModule
 | ReadT
 | WriteT
 | ReadL
 | WriteL
 | ReadW
 | WriteW
 | ReadH
 | WriteH
 | DoCreate
 | DoDestroy
 | DefineProperties
 | GetChildren
 | HandleCreateException
 | ReadState
 | Create
 | CreateNew
 | Destroy
 | AfterConstruction
 | BeforeDestruction


pt | Continue (TCustomDaemon)
pt | Continue (TDaemon)
 | Create (TDataModule)
 | CreateNew (TDataModule)
 | DefineProperties (TDataModule)
 | Destroy (TDataModule)
 | DoCreate (TDataModule)
 | DoDestroy (TDataModule)
pt | Execute (TCustomDaemon)
pt | Execute (TDaemon)
 | GetChildren (TDataModule)
 | HandleCreateException (TDataModule)
pt | HandleCustomCode (TCustomDaemon)
pt | HandleCustomCode (TDaemon)
pt | Install (TCustomDaemon)
pt | Install (TDaemon)
 | LogMessage (TCustomDaemon)
pt | Pause (TCustomDaemon)
pt | Pause (TDaemon)
 | ReadH (TDataModule)
 | ReadL (TDataModule)
 | ReadState (TDataModule)
 | ReadT (TDataModule)
 | ReadW (TDataModule)
 | ReportStatus (TCustomDaemon)
pt | ShutDown (TCustomDaemon)
pt | ShutDown (TDaemon)
pt | Start (TCustomDaemon)
pt | Start (TDaemon)
pt | Stop (TCustomDaemon)
pt | Stop (TDaemon)
pt | UnInstall (TCustomDaemon)
pt | UnInstall (TDaemon)
 | WriteH (TDataModule)
 | WriteL (TDataModule)
 | WriteT (TDataModule)
 | WriteW (TDataModule)


TDaemon
pl | OnStart
pl | OnStop
pl | OnPause
pl | OnContinue
pl | OnShutDown
pl | OnExecute
pl | OnControlCode
TCustomDaemon
TDataModule
 | OnCreate
 | OnDestroy


pl | OnContinue (TDaemon)
pl | OnControlCode (TDaemon)
 | OnCreate (TDataModule)
 | OnDestroy (TDataModule)
pl | OnExecute (TDaemon)
pl | OnPause (TDaemon)
pl | OnShutDown (TDaemon)
pl | OnStart (TDaemon)
pl | OnStop (TDaemon)


TDaemon.AfterInstall

Called after the daemon was installed

Declaration

Source position: daemonapp.pp line 110

published property TDaemon.AfterInstall: TDaemonEvent
  read FAfterInstall
  write FAfterInstall;

Description

AfterInstall is called after the daemon was succesfully installed.

See also

BeforeInstall | Called before the daemon will be installed
BeforeUnInstall | Called before the daemon is uninstalled
AfterUnInstall | Called after the daemon is uninstalled


TDaemon.AfterUnInstall

Called after the daemon is uninstalled

Declaration

Source position: daemonapp.pp line 112

published property TDaemon.AfterUnInstall: TDaemonEvent
  read FAfterUnInstall
  write FAfterUnInstall;

Description

AfterUnInstall is called after the daemon is succesfully uninstalled.

See also

BeforeInstall | Called before the daemon will be installed
AfterInstall | Called after the daemon was installed
BeforeUnInstall | Called before the daemon is uninstalled


TDaemon.BeforeInstall

Called before the daemon will be installed

Declaration

Source position: daemonapp.pp line 109

published property TDaemon.BeforeInstall: TDaemonEvent
  read FBeforeInstall
  write FBeforeInstall;

Description

BeforeInstall is called before the daemon is installed. It can be done to specify extra dependencies, or change the daemon description etc.

See also

AfterInstall | Called after the daemon was installed
BeforeUnInstall | Called before the daemon is uninstalled
AfterUnInstall | Called after the daemon is uninstalled


TDaemon.BeforeUnInstall

Called before the daemon is uninstalled

Declaration

Source position: daemonapp.pp line 111

published property TDaemon.BeforeUnInstall: TDaemonEvent
  read FBeforeUnInstall
  write FBeforeUnInstall;

Description

BeforeUnInstall is called before the daemon is uninstalled.

See also

BeforeInstall | Called before the daemon will be installed
AfterInstall | Called after the daemon was installed
AfterUnInstall | Called after the daemon is uninstalled


TDaemon.Continue

Declaration

Source position: daemonapp.pp line 93

protected function TDaemon.Continue: Boolean; override;


TDaemon.Execute

Declaration

Source position: daemonapp.pp line 94

protected function TDaemon.Execute: Boolean; override;


TDaemon.HandleCustomCode

Declaration

Source position: daemonapp.pp line 98

protected function TDaemon.HandleCustomCode(

  ACode: DWord

):Boolean; override;


TDaemon.Install

Declaration

Source position: daemonapp.pp line 96

protected function TDaemon.Install: Boolean; override;


TDaemon.OnContinue

Daemon continue

Declaration

Source position: daemonapp.pp line 106

published property TDaemon.OnContinue: TDaemonOKEvent
  read FOnContinue
  write FOnContinue;

Description

OnPause is the event called when the daemon must be stopped. This event handler should return as quickly as possible. If it must perform lengthy operations, it is best to report the status to the operating system at regular intervals using the ReportStatus method.

If a thread was started in the OnExecute event and it was suspended in a OnPause event, this is the place where the thread's executed should be resumed.

See also

TDaemon.OnStart | Daemon start event
TDaemon.OnPause | Daemon pause event
ReportStatus | Report the current status to the operating system


TDaemon.OnControlCode

Called when a control code is received for the daemon

Declaration

Source position: daemonapp.pp line 113

published property TDaemon.OnControlCode: TCustomControlCodeEvent
  read FOnCustomControl
  write FOnCustomControl;

Description

OnControlCode is called when the daemon receives a control code. If the daemon has not handled the control code, it should set the Handled parameter to False. By default it is set to True.

See also

Architecture

Daemon application architecture


TDaemon.OnExecute

Daemon execute event

Declaration

Source position: daemonapp.pp line 108

published property TDaemon.OnExecute: TDaemonEvent
  read FOnExecute
  write FOnExecute;

Description

OnExecute is executed once after the daemon was started. If assigned, it should perform whatever operation the daemon is designed.

If the daemon's action is event based, then no OnExecute handler is needed, and the events will control the daemon's execution: the daemon thread will then go in a loop, passing control messages to the daemon.

If an OnExecute event handler is present, the checking for control messages must be done by the implementation of the OnExecute handler.

See also

TDaemon.OnStart | Daemon start event
TDaemon.OnStop | Daemon stop event


TDaemon.OnPause

Daemon pause event

Declaration

Source position: daemonapp.pp line 105

published property TDaemon.OnPause: TDaemonOKEvent
  read FOnPause
  write FOnPause;

Description

OnPause is the event called when the daemon must be stopped. This event handler should return as quickly as possible. If it must perform lengthy operations, it is best to report the status to the operating system at regular intervals using the ReportStatus method.

If a thread was started in the OnExecute event, this is the place where the thread's execution should be suspended.

See also

TDaemon.OnStop | Daemon stop event
TDaemon.OnContinue | Daemon continue
ReportStatus | Report the current status to the operating system


TDaemon.OnShutDown

Daemon shutdown

Declaration

Source position: daemonapp.pp line 107

published property TDaemon.OnShutDown: TDaemonEvent
  read FOnShutDown
  write FOnShutDown;

Description

OnShutDown is the event called when the daemon must be shut down. When the system is being shut down and the daemon does not respond to stop signals, then a shutdown message is sent to the daemon. This event can be used to respond to such a message. The daemon process will simply be stopped after this event.

If a thread was started in the OnExecute, this is the place where the thread's executed should be stopped or the thread freed from memory.

See also

TDaemon.OnStart | Daemon start event
TDaemon.OnPause | Daemon pause event
ReportStatus | Report the current status to the operating system


TDaemon.OnStart

Daemon start event

Declaration

Source position: daemonapp.pp line 103

published property TDaemon.OnStart: TDaemonOKEvent
  read FOnStart
  write FOnStart;

Description

OnStart is the event called when the daemon must be started. This event handler should return as quickly as possible. If it must perform lengthy operations, it is best to report the status to the operating system at regular intervals using the ReportStatus method.

If the start of the daemon should do some continuous action, then this action should be performed in a new thread: this thread should then be created and started in the OnExecute event handler, so the event handler can return at once.

See also

TDaemon.OnStop | Daemon stop event
TDaemon.OnExecute | Daemon execute event
TDaemon.OnContinue | Daemon continue
ReportStatus | Report the current status to the operating system


TDaemon.OnStop

Daemon stop event

Declaration

Source position: daemonapp.pp line 104

published property TDaemon.OnStop: TDaemonOKEvent
  read FOnStop
  write FOnStop;

Description

OnStart is the event called when the daemon must be stopped. This event handler should return as quickly as possible. If it must perform lengthy operations, it is best to report the status to the operating system at regular intervals using the ReportStatus method.

If a thread was started in the OnExecute event, this is the place where the thread should be stopped.

See also

TDaemon.OnStart | Daemon start event
TDaemon.OnPause | Daemon pause event
ReportStatus | Report the current status to the operating system


TDaemon.Pause

Declaration

Source position: daemonapp.pp line 92

protected function TDaemon.Pause: Boolean; override;


TDaemon.ShutDown

Declaration

Source position: daemonapp.pp line 95

protected function TDaemon.ShutDown: Boolean; override;


TDaemon.Start

Declaration

Source position: daemonapp.pp line 90

protected function TDaemon.Start: Boolean; override;


TDaemon.Stop

Declaration

Source position: daemonapp.pp line 91

protected function TDaemon.Stop: Boolean; override;


TDaemon.UnInstall

Declaration

Source position: daemonapp.pp line 97

protected function TDaemon.UnInstall: Boolean; override;


TDaemonApplication

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Default descendent of CustomDaemonApplication

Declaration

Source position: daemonapp.pp line 380

type TDaemonApplication = class(TCustomDaemonApplication) end;

Inheritance

TDaemonApplication | Default descendent of CustomDaemonApplication
|
TCustomDaemonApplication | Custom daemon application class
|
TCustomApplication | Ancestor class for TApplication classes.
|
TComponent
|
TObject

Description

TDaemonApplication is the default TCustomDaemonApplication descendent that is used to run the daemon application. It is possible to register an alternative TCustomDaemonApplication class (using RegisterDaemonApplicationClass) to run the application in a different manner.

See also

TCustomDaemonApplication | Custom daemon application class
RegisterDaemonApplicationClass | Register alternative TCustomDaemonApplication class.


TDaemonApplication
TCustomDaemonApplication
pt |  | SysData
 | ro | Logger
 |  | GUIMainLoop
 |  | GuiHandle
 | ro | RunMode
TCustomApplication
 | ro | ExeName
 |  | HelpFile
 | ro | Terminated
 |  | Title
 | ro | ConsoleApplication
 | ro | Location
 | ro | Params
 | ro | ParamCount
 | ro | EnvironmentVariable
 |  | OptionChar
 |  | CaseSensitiveOptions
 |  | StopOnException
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


TDaemonApplication
TCustomDaemonApplication
pt | SysStartUnInstallDaemons
pt | SysEndUnInstallDaemons
pt | SysStartInstallDaemons
pt | SysEndInstallDaemons
pt | SysStartRunDaemons
pt | SysEndRunDaemons
pt | CreateDaemonController
pt | CreateServiceMapper
pt | CreateDaemonInstance
pt | RemoveController
pt | SetupLogger
pt | StopLogger
pt | DoRun
 | ShowException
 | CreateDaemon
 | StopDaemons
 | InstallDaemons
 | RunDaemons
 | UnInstallDaemons
 | CreateForm
TCustomApplication
pt | SetTitle
pt | GetConsoleApplication
pt | DoRun
pt | GetParams
pt | GetParamCount
 | Create
 | Destroy
 | HandleException
 | Initialize
 | Run
 | ShowException
 | Terminate
 | FindOptionIndex
 | GetOptionValue
 | HasOption
 | CheckOptions
 | GetEnvironmentList
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


TDaemonApplication
TCustomDaemonApplication
pt | OnRun
TCustomApplication
 | OnException
TComponent


TDaemonController

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Internal daemon controller class

Declaration

Source position: daemonapp.pp line 118

type TDaemonController = class(TComponent)
public
constructor Create(); override; | Create a new instance of the TDaemonController class
destructor Destroy; override; | Free a TDaemonController instance.
procedure StartService; virtual; | Start the service
procedure Main(); virtual; | Daemon main entry point
procedure Controller(); virtual; | Controller
function ReportStatus; virtual; | Report the status to the operating system.
property Daemon: TCustomDaemon; [r] | Daemon instance this controller controls.
property Params: TStrings; [r] | Parameters passed to the daemon
property LastStatus: TCurrentStatus; [r] | Last reported status
property CheckPoint: DWord; | Send checkpoint signal to the operating system
end;

Inheritance

TDaemonController

Internal daemon controller class
|

TComponent
|

TObject

Description

TDaemonController is a class that is used by the TDaemonApplication class to control the daemon during runtime. The TDaemonApplication class instantiates an instance of TDaemonController for each daemon in the application and communicates with the daemon through the TDaemonController instance. It should rarely be necessary to access or use this class.

See also

TCustomDaemon | Base daemon application class
TDaemonApplication | Default descendent of CustomDaemonApplication


TDaemonController
 | ro | Daemon
 | ro | Params
 | ro | LastStatus
 | ro | CheckPoint
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


ro | CheckPoint (TDaemonController)
ro | ComponentCount (TComponent)
 | ComponentIndex (TComponent)
ro | Components (TComponent)
ro | ComponentState (TComponent)
ro | ComponentStyle (TComponent)
ro | Daemon (TDaemonController)
 | DesignInfo (TComponent)
ro | LastStatus (TDaemonController)
 | Name (TComponent)
ro | Owner (TComponent)
ro | Params (TDaemonController)
 | Tag (TComponent)
 | VCLComObject (TComponent)


TDaemonController
 | Create
 | Destroy
 | StartService
 | Main
 | Controller
 | ReportStatus
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


BeforeDestruction (TComponent)

ChangeName (TComponent)

Controller (TDaemonController)

Create (TComponent)

Create (TDaemonController)

DefineProperties (TComponent)

Destroy (TComponent)

Destroy (TDaemonController)

DestroyComponents (TComponent)

Destroying (TComponent)

ExecuteAction (TComponent)

FindComponent (TComponent)

FreeNotification (TComponent)

FreeOnRelease (TComponent)

GetChildOwner (TComponent)

GetChildParent (TComponent)

GetChildren (TComponent)

GetComponent (TComponent)

GetComponentCount (TComponent)

GetComponentIndex (TComponent)

GetNamePath (TComponent)

GetOwner (TComponent)

GetParentComponent (TComponent)

HasParent (TComponent)

iicrGetComponent (TComponent)

Insert (TComponent)

InsertComponent (TComponent)

IsImplementorOf (TComponent)

Loaded (TComponent)

Loading (TComponent)

Main (TDaemonController)

Notification (TComponent)

PaletteCreated (TComponent)

QueryInterface (TComponent)

ReadLeft (TComponent)

ReadState (TComponent)

ReadTop (TComponent)

ReferenceInterface (TComponent)

Remove (TComponent)

RemoveComponent (TComponent)

RemoveFreeNotification (TComponent)

RemoveNotification (TComponent)

ReportStatus (TDaemonController)

SafeCallException (TComponent)

SetAncestor (TComponent)

SetChildOrder (TComponent)

SetComponentIndex (TComponent)

SetDesigning (TComponent)

SetDesignInstance (TComponent)

SetInline (TComponent)

SetName (TComponent)

SetParentComponent (TComponent)

SetReference (TComponent)

SetSubComponent (TComponent)

StartService (TDaemonController)

UpdateAction (TComponent)

Updated (TComponent)

UpdateRegistry (TComponent)

Updating (TComponent)

ValidateContainer (TComponent)

ValidateInsert (TComponent)

ValidateRename (TComponent)

WriteLeft (TComponent)

WriteState (TComponent)

WriteTop (TComponent)

_AddRef (TComponent)

_Release (TComponent)


TDaemonController

TComponent


TDaemonController.CheckPoint

Send checkpoint signal to the operating system

Declaration

Source position: daemonapp.pp line 135

public property TDaemonController.CheckPoint: DWord;

Description

CheckPoint can be used to send a checkpoint signal during lengthy operations, to signal that a lengthy operation is in progress. This should be used mainly on windows, to signal the service manager that the service is alive.

See also

ReportStatus

Report the status to the operating system.


TDaemonController.Controller

Controller

Declaration

Source position: daemonapp.pp line 130

public procedure TDaemonController.Controller(

  ControlCode: DWord;

  EventType: DWord;

  EventData: Pointer

); virtual;

Arguments

ControlCode | Control code sent by the system
EventType | Event type sent by the system
EventData | Additional event data sent by the system

Description

Controller is responsible for sending the control code to the daemon thread so it can be processed.

This routine is currently only used on windows, as there is no service manager on linux. Later on this may be changed to respond to signals on linux as well.

See also

TDaemon.OnControlCode

Called when a control code is received for the daemon


TDaemonController.Create

Create a new instance of the TDaemonController class

Declaration

Source position: daemonapp.pp line 126

public constructor TDaemonController.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner of the controller.

Description

Create creates a new instance of the TDaemonController class. It should never be necessary to create a new instance manually, because the controllers are created by the global TDaemonApplication instance, and AOwner will be set to the global TDaemonApplication instance.

See also

TDaemonApplication | Default descendent of CustomDaemonApplication
Destroy | Free a TDaemonController instance.


TDaemonController.Daemon

Daemon instance this controller controls.

Declaration

Source position: daemonapp.pp line 132

public property TDaemonController.Daemon: TCustomDaemon
  read FDaemon;

Description

Daemon is the daemon instance that is controller by this instance of the TDaemonController class.


TDaemonController.Destroy

Free a TDaemonController instance.

Declaration

Source position: daemonapp.pp line 127

public destructor TDaemonController.Destroy; override;

Description

Destroy deallocates some resources allocated when the instance was created.

See also

Create

Create a new instance of the TDaemonController class


TDaemonController.LastStatus

Last reported status

Declaration

Source position: daemonapp.pp line 134

public property TDaemonController.LastStatus: TCurrentStatus
  read FLastStatus;

Description

LastStatus is the last status reported to the operating system.

See also

ReportStatus

Report the status to the operating system.


TDaemonController.Main

Daemon main entry point

Declaration

Source position: daemonapp.pp line 129

public procedure TDaemonController.Main(

  Argc: DWord;

  Args: PPChar

); virtual;

Arguments

Argc | Command-line arguments passed by the OS. The first is normally the service name
Args | Arguments for the service.

Description

Main is the service's main entry point, called when the system wants to start the service. The global application will call this function whenever required, with the appropriate arguments.

The standard implementation starts the daemon thread, and waits for it to stop. All other daemon action - such as responding to control code events - is handled by the thread.

Errors

If the daemon thread cannot be created, an exception is raised.

See also

TDaemonThread

Thread to run daemons in


TDaemonController.Params

Parameters passed to the daemon

Declaration

Source position: daemonapp.pp line 133

public property TDaemonController.Params: TStrings
  read FParams;

Description

Params contains the parameters passed to the daemon application by the operating system, comparable to the application's command-line parameters. The property is set by the Main method.


TDaemonController.ReportStatus

Report the status to the operating system.

Declaration

Source position: daemonapp.pp line 131

public function TDaemonController.ReportStatus: Boolean; virtual;

Function result

True if the status was reported succesfully

Description

ReportStatus reports the status of the daemon to the operating system. On windows, this sends the current service status to the service manager. On other operating systems, this sends a message to the system log.

Errors

If an error occurs, an error message is sent to the system log.

See also

TDaemon.ReportStatus

TDaemonController.LastStatus

Last reported status


TDaemonController.StartService

Start the service

Declaration

Source position: daemonapp.pp line 128

public procedure TDaemonController.StartService; virtual;

Description

StartService starts the service controlled by this instance.

Errors

None.

See also

TDaemonController.Main

Daemon main entry point


TDaemonDef

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Daemon definition

Declaration

Source position: daemonapp.pp line 212

type TDaemonDef = class(TCollectionItem)
protected
function GetDisplayName; override;
public
constructor Create(); override; | Create a new TDaemonDef instance
destructor Destroy; override; | Free a TDaemonDef from memory
property DaemonClass: TCustomDaemonClass; [r] | TDaemon class to use for this daemon
property Instance: TCustomDaemon; [rw] | Instance of the daemon class
published
property DaemonClassName: String; [rw] | Name of the TDaemon class to use for this daemon
property Name: String; [rw] | Name of the daemon (service)
property Description: String; [rw] | Description of the daemon
property DisplayName: String; [rw] | Displayed name of the daemon (service)
property RunArguments: String; [rw] | Additional command-line arguments when running daemon.
property Options: TDaemonOptions; [rw] | Service options
property Enabled: Boolean; [rw] | Is the daemon enabled or not
property WinBindings: TWinBindings; [rw] | Windows-specific bindings (windows only)
property OnCreateInstance: TNotifyEvent; [rw] | Event called when a daemon in instantiated
property LogStatusReport: Boolean; [rw] | Log the status report to the system log
end;

Inheritance

TDaemonDef

Daemon definition
|

TCollectionItem
|

TObject

Description

TDaemonDef contains the definition of a daemon in the application: The name of the daemon, which TCustomDaemon descendent should be started to run the daemon, a description, and various other options should be set in this class. The global TDaemonApplication instance maintains a collection of TDaemonDef instances and will use these definitions to install or start the various daemons.

See also

TDaemonApplication | Default descendent of CustomDaemonApplication
TDaemon | Daemon class for visual development


TDaemonDef
 | ro | DaemonClass
 |  | Instance
pl |  | DaemonClassName
pl |  | Name
pl |  | Description
pl |  | DisplayName
pl |  | RunArguments
pl |  | Options
pl |  | Enabled
pl |  | WinBindings
pl |  | LogStatusReport
TCollectionItem
 | ro | UpdateCount
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName


 | ro | DaemonClass (TDaemonDef)
pl |  | DaemonClassName (TDaemonDef)
pl |  | Description (TDaemonDef)
 |  | DisplayName (TCollectionItem)
pl |  | DisplayName (TDaemonDef)
pl |  | Enabled (TDaemonDef)
 | ro | ID (TCollectionItem)
 |  | Index (TCollectionItem)
 |  | Instance (TDaemonDef)
pl |  | LogStatusReport (TDaemonDef)
pl |  | Name (TDaemonDef)
pl |  | Options (TDaemonDef)
pl |  | RunArguments (TDaemonDef)
 | ro | UpdateCount (TCollectionItem)
pl |  | WinBindings (TDaemonDef)


TDaemonDef
pt | GetDisplayName
 | Create
 | Destroy
TCollectionItem
 | GetIndex
 | SetCollection
 | Changed
 | GetOwner
 | GetDisplayName
 | SetIndex
 | SetDisplayName
 | Create
 | Destroy
 | GetNamePath


 | Changed (TCollectionItem)
 | Create (TCollectionItem)
 | Create (TDaemonDef)
 | Destroy (TCollectionItem)
 | Destroy (TDaemonDef)
 | GetDisplayName (TCollectionItem)
pt | GetDisplayName (TDaemonDef)
 | GetIndex (TCollectionItem)
 | GetNamePath (TCollectionItem)
 | GetOwner (TCollectionItem)
 | SetCollection (TCollectionItem)
 | SetDisplayName (TCollectionItem)
 | SetIndex (TCollectionItem)


TDaemonDef

pl

OnCreateInstance

TCollectionItem


pl

OnCreateInstance (TDaemonDef)


TDaemonDef.Create

Create a new TDaemonDef instance

Declaration

Source position: daemonapp.pp line 232

public constructor TDaemonDef.Create(

  ACollection: TCollection

); override;

Arguments

ACollection

Collection the item belongs in.

Description

Create initializes a new TDaemonDef instance. It should not be necessary to instantiate a definition manually, it is handled by the collection.

See also

TDaemonDefs

Collection of daemon definitions.


TDaemonDef.DaemonClass

TDaemon class to use for this daemon

Declaration

Source position: daemonapp.pp line 234

public property TDaemonDef.DaemonClass: TCustomDaemonClass
  read FDaemonClass;

Description

DaemonClass is the TDaemon class that is used when this service is requested. It is looked up in the application's global daemon mapper by it's name in DaemonClassName.

See also

DaemonClassName | Name of the TDaemon class to use for this daemon
TDaemonMapper | Daemon mapper for designing in IDE


TDaemonDef.DaemonClassName

Name of the TDaemon class to use for this daemon

Declaration

Source position: daemonapp.pp line 237

published property TDaemonDef.DaemonClassName: String
  read FDaemonClassName
  write FDaemonClassName;

Description

DaemonClassName is the name of the TDaemon class that will be used whenever the service is needed. The name is used to look up the class pointer registered in the daemon mapper, when TCustomDaemonApplication.CreateDaemonInstance creates an instance of the daemon.

See also

TDaemonDef.Instance | Instance of the daemon class
TDaemonDef.DaemonClass | TDaemon class to use for this daemon
RegisterDaemonClass | Register daemon


TDaemonDef.Description

Description of the daemon

Declaration

Source position: daemonapp.pp line 239

published property TDaemonDef.Description: String
  read FDescription
  write FDescription;

Description

Description is the description shown in the Windows service manager when managing this service. It is supplied to the windows service manager when the daemon is installed.


TDaemonDef.Destroy

Free a TDaemonDef from memory

Declaration

Source position: daemonapp.pp line 233

public destructor TDaemonDef.Destroy; override;

Description

Destroy removes the TDaemonDef from memory.


TDaemonDef.DisplayName

Displayed name of the daemon (service)

Declaration

Source position: daemonapp.pp line 240

published property TDaemonDef.DisplayName: String
  read FDisplayName
  write FDisplayName;

Description

DisplayName is the displayed name of the daemon as it is known to the operating system.

See also

TDaemonDef.Name

Name of the daemon (service)


TDaemonDef.Enabled

Is the daemon enabled or not

Declaration

Source position: daemonapp.pp line 243

published property TDaemonDef.Enabled: Boolean
  read FEnabled
  write FEnabled
  default true;

Description

Enabled specifies whether a daemon should be installed, run or uninstalled. Disabled daemons are not installed, run or uninstalled.


TDaemonDef.GetDisplayName

Declaration

Source position: daemonapp.pp line 230

protected function TDaemonDef.GetDisplayName: String; override;


TDaemonDef.Instance

Instance of the daemon class

Declaration

Source position: daemonapp.pp line 235

public property TDaemonDef.Instance: TCustomDaemon
  read FInstance
  write FInstance;

Description

Instance points to the TDaemon instance that is used when the service is in operation at runtime.

See also

TDaemonDef.DaemonClass

TDaemon class to use for this daemon


TDaemonDef.LogStatusReport

Log the status report to the system log

Declaration

Source position: daemonapp.pp line 246

published property TDaemonDef.LogStatusReport: Boolean
  read FLogStatusReport
  write FLogStatusReport;

Description

LogStatusReport can be set to True to send the status reports also to the system log. This can be used to track the progress of the daemon.

See also

TDaemon.ReportStatus


TDaemonDef.Name

Name of the daemon (service)

Declaration

Source position: daemonapp.pp line 238

published property TDaemonDef.Name: String
  read FName
  write SetName;

Description

Name is the internal name of the daemon as it is known to the operating system.

See also

TDaemonDef.DisplayName

Displayed name of the daemon (service)


TDaemonDef.OnCreateInstance

Event called when a daemon in instantiated

Declaration

Source position: daemonapp.pp line 245

published property TDaemonDef.OnCreateInstance: TNotifyEvent
  read FOnCreateInstance
  write FOnCreateInstance;

Description

OnCreateInstance is called whenever an instance of the daemon is created. This can be used for instance when a single TDaemon class is used to run several services, to correctly initialize the TDaemon.


TDaemonDef.Options

Service options

Declaration

Source position: daemonapp.pp line 242

published property TDaemonDef.Options: TDaemonOptions
  read FOptions
  write FOptions;

Description

Options tells the operating system which operations can be performed on the daemon while it is running.

This option is only used during the installation of the daemon.


TDaemonDef.RunArguments

Additional command-line arguments when running daemon.

Declaration

Source position: daemonapp.pp line 241

published property TDaemonDef.RunArguments: String
  read FRunArgs
  write FRunArgs;

Description

RunArguments specifies any additional command-line arguments that should be specified when running the daemon: these arguments will be passed to the service manager when registering the service on windows.


TDaemonDef.WinBindings

Windows-specific bindings (windows only)

Declaration

Source position: daemonapp.pp line 244

published property TDaemonDef.WinBindings: TWinBindings
  read FWinBindings
  write SetWinBindings;

Description

WinBindings is used to group together the windows-specific properties of the daemon. This property is totally ignored on other platforms.

See also

TWinBindings

Windows Daemon bindings (windows only)


TDaemonDefs

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of daemon definitions.

Declaration

Source position: daemonapp.pp line 251

type TDaemonDefs = class(TCollection)
protected
procedure BindClasses;
function GetOwner; override;
public
constructor Create(); | Create a new instance of a TDaemonDefs collection.
function IndexOfDaemonDef(); | Return index of daemon definition
function FindDaemonDef(); | Find and return instance of daemon definition with given name.
function DaemonDefByName(); | Find and return instance of daemon definition with given name.
property Daemons: TDaemonDef; default; [rw] | Indexed access to TDaemonDef instances
end;

Inheritance

TDaemonDefs

Collection of daemon definitions.
|

TCollection
|

TObject

Description

TDaemonDefs is the class of the global list of daemon definitions. It contains an item for each daemon in the application.

Normally it is not necessary to create an instance of TDaemonDefs manually. The global TCustomDaemonMapper instance will create a collection and maintain it.

See also

TCustomDaemonMapper | Daemon mapper
TDaemonDef | Daemon definition


TDaemonDefs
 |  | Daemons
TCollection
 |  | PropName
 | ro | UpdateCount
 | ro | Count
 | ro | ItemClass
 |  | Items


ro | Count (TCollection)
 | Daemons (TDaemonDefs)
ro | ItemClass (TCollection)
 | Items (TCollection)
 | PropName (TCollection)
ro | UpdateCount (TCollection)


TDaemonDefs
pt | BindClasses
pt | GetOwner
 | Create
 | IndexOfDaemonDef
 | FindDaemonDef
 | DaemonDefByName
TCollection
 | GetCount
 | GetPropName
 | InsertItem
 | RemoveItem
 | GetAttrCount
 | GetAttr
 | GetItemAttr
 | Changed
 | GetItem
 | SetItem
 | SetItemName
 | SetPropName
 | Update
 | Notify
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetNamePath
 | Insert
 | FindItemID
 | Sort


pt | BindClasses (TDaemonDefs)
 | Changed (TCollection)
 | Clear (TCollection)
 | Create (TCollection)
 | Create (TDaemonDefs)
 | DaemonDefByName (TDaemonDefs)
 | Delete (TCollection)
 | Destroy (TCollection)
 | EndUpdate (TCollection)
 | FindDaemonDef (TDaemonDefs)
 | FindItemID (TCollection)
 | GetAttr (TCollection)
 | GetAttrCount (TCollection)
 | GetCount (TCollection)
 | GetItem (TCollection)
 | GetItemAttr (TCollection)
 | GetNamePath (TCollection)
pt | GetOwner (TDaemonDefs)
 | GetPropName (TCollection)
 | IndexOfDaemonDef (TDaemonDefs)
 | Insert (TCollection)
 | InsertItem (TCollection)
 | Notify (TCollection)
 | Owner (TCollection)
 | RemoveItem (TCollection)
 | SetItem (TCollection)
 | SetItemName (TCollection)
 | SetPropName (TCollection)
 | Sort (TCollection)
 | Update (TCollection)


TDaemonDefs

TCollection


TDaemonDefs.BindClasses

Declaration

Source position: daemonapp.pp line 257

protected procedure TDaemonDefs.BindClasses;


TDaemonDefs.Create

Create a new instance of a TDaemonDefs collection.

Declaration

Source position: daemonapp.pp line 260

public constructor TDaemonDefs.Create(

  AOwner: TPersistent;

  AClass: TCollectionItemClass

);

Arguments

AOwner | Collection owner
AClass | Item class.

Description

Create creates a new instance of the TDaemonDefs collection. It keeps the AOwner parameter for future reference and calls the inherited constructor.

Normally it is not necessary to create an instance of TDaemonDefs manually. The global TCustomDaemonMapper instance will create a collection and maintain it.

See also

TDaemonDef

Daemon definition


TDaemonDefs.DaemonDefByName

Find and return instance of daemon definition with given name.

Declaration

Source position: daemonapp.pp line 263

public function TDaemonDefs.DaemonDefByName(

  const DaemonName: String

):TDaemonDef;

Arguments

DaemonName

Daemon name to search for.

Function result

Matching TDaemonDef instance

Description

FindDaemonDef searches the list of daemon definitions and returns the TDaemonDef instance whose name matches DaemonName. If no definition is found, an EDaemon exception is raised.

The FindDaemonDef call does not raise an error, but returns Nil instead.

Errors

If no definition is found, an EDaemon exception is raised.

See also

TDaemonDefs.IndexOfDaemonDef | Return index of daemon definition
TDaemonDefs.FindDaemonDef | Find and return instance of daemon definition with given name.


TDaemonDefs.Daemons

Indexed access to TDaemonDef instances

Declaration

Source position: daemonapp.pp line 264

public property TDaemonDefs.Daemons: TDaemonDef
  read GetDaemonDef
  write SetDaemonDef;
  default;

Description

Daemons is the default property of TDaemonDefs, it gives access to the TDaemonDef instances in the collection.

See also

TDaemonDef

Daemon definition


TDaemonDefs.FindDaemonDef

Find and return instance of daemon definition with given name.

Declaration

Source position: daemonapp.pp line 262

public function TDaemonDefs.FindDaemonDef(

  const DaemonName: String

):TDaemonDef;

Arguments

DaemonName

Daemon name to search for.

Function result

Matching TDaemonDef instance or Nil if none was found.

Description

FindDaemonDef searches the list of daemon definitions and returns the TDaemonDef instance whose name matches DaemonName. If no definition is found, Nil is returned.

See also

TDaemonDefs.IndexOfDaemonDef | Return index of daemon definition
TDaemonDefs.DaemonDefByName | Find and return instance of daemon definition with given name.


TDaemonDefs.GetOwner

Declaration

Source position: daemonapp.pp line 258

protected function TDaemonDefs.GetOwner: TPersistent; override;


TDaemonDefs.IndexOfDaemonDef

Return index of daemon definition

Declaration

Source position: daemonapp.pp line 261

public function TDaemonDefs.IndexOfDaemonDef(

  const DaemonName: String

):Integer;

Arguments

DaemonName

Daemon Name to search for.

Function result

Index of found definition, or -1

Description

IndexOfDaemonDef searches the collection for a TDaemonDef instance with a name equal to DaemonName, and returns it's index. It returns -1 if no definition was found with this name. The search is case insensitive.

See also

TDaemonDefs.FindDaemonDef | Find and return instance of daemon definition with given name.
TDaemonDefs.DaemonDefByName | Find and return instance of daemon definition with given name.


TDaemonMapper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Daemon mapper for designing in IDE

Declaration

Source position: daemonapp.pp line 298

type TDaemonMapper = class(TCustomDaemonMapper)
constructor Create(); override; | Create a new TDaemonMapper instance and initializes it from streamed resources.
constructor CreateNew(); | Create a new TDaemonMapper instance without initialization
end;

Inheritance

TDaemonMapper | Daemon mapper for designing in IDE
|
TCustomDaemonMapper | Daemon mapper
|
TComponent
|
TObject

Description

TDaemonMapper is a direct descendent of TCustomDaemonMapper, but introduces no new functionality. It's sole purpose is to make it possible for an IDE to stream the TDaemonMapper instance.

For this purpose, it overrides the Create constructor and tries to find a resource with the same name as the class name, and tries to stream the instance from this resource.

If the instance should not be streamed, the CreateNew constructor can be used instead.

See also

CreateNew | Create a new TDaemonMapper instance without initialization
Create | Create a new TDaemonMapper instance and initializes it from streamed resources.


TDaemonMapper
TCustomDaemonMapper
pl |  | DaemonDefs
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


TDaemonMapper
 | Create
 | CreateNew
TCustomDaemonMapper
pt | CreateDefs
pt | DoOnCreate
pt | DoOnDestroy
pt | DoOnInstall
pt | DoOnUnInstall
pt | DoOnRun
 | Create
 | Destroy
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | Create (TComponent)
 | Create (TCustomDaemonMapper)
 | Create (TDaemonMapper)
pt | CreateDefs (TCustomDaemonMapper)
 | CreateNew (TDaemonMapper)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TCustomDaemonMapper)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoOnCreate (TCustomDaemonMapper)
pt | DoOnDestroy (TCustomDaemonMapper)
pt | DoOnInstall (TCustomDaemonMapper)
pt | DoOnRun (TCustomDaemonMapper)
pt | DoOnUnInstall (TCustomDaemonMapper)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TDaemonMapper
TCustomDaemonMapper
pl | OnCreate
pl | OnDestroy
pl | OnRun
pl | OnInstall
pl | OnUnInstall
TComponent


TDaemonMapper.Create

Create a new TDaemonMapper instance and initializes it from streamed resources.

Declaration

Source position: daemonapp.pp line 299

constructor TDaemonMapper.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Instance owner

Description

Create initializes a new instance of TDaemonMapper and attempts to read the component from resources compiled in the application.

If the instance should not be streamed, the CreateNew constructor can be used instead.

Errors

If no streaming system is found, or no resource exists for the class, an exception is raised.

See also

CreateNew

Create a new TDaemonMapper instance without initialization


TDaemonMapper.CreateNew

Create a new TDaemonMapper instance without initialization

Declaration

Source position: daemonapp.pp line 300

constructor TDaemonMapper.CreateNew(

  AOwner: TComponent;

  Dummy: Integer = 0

);

Arguments

AOwner | Owner of the instance
Dummy | Ignored.

Description

CreateNew itializes a new instance of TDaemonMapper. In difference with the Create constructor, it does not attempt to read the component from a stream.

See also

Create

Create a new TDaemonMapper instance and initializes it from streamed resources.


TDaemonThread

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Thread to run daemons in

Declaration

Source position: daemonapp.pp line 307

type TDaemonThread = class(TThread)
protected
procedure StartServiceExecute; virtual;
procedure HandleControlCode(); virtual;
public
constructor Create(); | Create a new thread
procedure Execute; override; | Run the daemon
procedure CheckControlMessage(); | Check if a control message has arrived
function StopDaemon; virtual; | Stops the daemon
function PauseDaemon; virtual; | Pause the daemon
function ContinueDaemon; virtual; | Continue the daemon
function ShutDownDaemon; virtual; | Shut down daemon
function InterrogateDaemon; virtual; | Report the daemon status
property Daemon: TCustomDaemon; [r] | Daemon instance
end;

Inheritance

TDaemonThread

Thread to run daemons in
|

TThread
|

TObject

Description

TDaemonThread is the thread in which the daemons in the application are run. Each daemon is run in it's own thread.

It should not be necessary to create these threads manually, the TDaemonController class will take care of this.

See also

TDaemonController | Internal daemon controller class
TDaemon | Daemon class for visual development


TDaemonThread
 | ro | Daemon
TThread
 |  | ReturnValue
 | ro | Terminated
 |  | FreeOnTerminate
 | ro | Handle
 |  | Priority
 |  | Suspended
 | ro | ThreadID
 | ro | FatalException


ro | Daemon (TDaemonThread)
ro | FatalException (TThread)
 | FreeOnTerminate (TThread)
ro | Handle (TThread)
 | Priority (TThread)
 | ReturnValue (TThread)
 | Suspended (TThread)
ro | Terminated (TThread)
ro | ThreadID (TThread)


TDaemonThread
pt | StartServiceExecute
pt | HandleControlCode
 | Create
 | Execute
 | CheckControlMessage
 | StopDaemon
 | PauseDaemon
 | ContinueDaemon
 | ShutDownDaemon
 | InterrogateDaemon
TThread
 | CallOnTerminate
 | GetPriority
 | SetPriority
 | SetSuspended
 | GetSuspended
 | DoTerminate
 | Execute
 | Synchronize
 | Create
 | Destroy
 | AfterConstruction
 | Resume
 | Suspend
 | Terminate
 | WaitFor


 | CallOnTerminate (TThread)
 | CheckControlMessage (TDaemonThread)
 | ContinueDaemon (TDaemonThread)
 | Create (TThread)
 | Create (TDaemonThread)
 | Destroy (TThread)
 | DoTerminate (TThread)
 | Execute (TThread)
 | Execute (TDaemonThread)
 | GetPriority (TThread)
 | GetSuspended (TThread)
pt | HandleControlCode (TDaemonThread)
 | InterrogateDaemon (TDaemonThread)
 | PauseDaemon (TDaemonThread)
 | Resume (TThread)
 | SetPriority (TThread)
 | SetSuspended (TThread)
 | ShutDownDaemon (TDaemonThread)
pt | StartServiceExecute (TDaemonThread)
 | StopDaemon (TDaemonThread)
 | Suspend (TThread)
 | Synchronize (TThread)
 | Terminate (TThread)
 | WaitFor (TThread)


TDaemonThread

TThread

OnTerminate


TDaemonThread.CheckControlMessage

Check if a control message has arrived

Declaration

Source position: daemonapp.pp line 316

public procedure TDaemonThread.CheckControlMessage(

  WaitForMessage: Boolean

);

Arguments

WaitForMessage

If true, routine waits for message to arrive before returning.

Description

CheckControlMessage checks if a control message has arrived for the daemon and executes the appropriate daemon message. If the parameter WaitForMessage is True, then the routine waits for the message to arrive. If it is False and no message is present, it returns at once.


TDaemonThread.ContinueDaemon

Continue the daemon

Declaration

Source position: daemonapp.pp line 319

public function TDaemonThread.ContinueDaemon: Boolean; virtual;

Function result

True if the daemon was succesfully restarted

Description

ContinueDaemon attempts to stop the daemon using its TDaemon.Continue method. It returns True if the attempt was succesful.

See also

TDaemon.Continue
TDaemonThread.StopDaemon | Stops the daemon
TDaemonThread.PauseDaemon | Pause the daemon
TDaemonThread.ShutDownDaemon | Shut down daemon


TDaemonThread.Create

Create a new thread

Declaration

Source position: daemonapp.pp line 314

public constructor TDaemonThread.Create(

  ADaemon: TCustomDaemon

);

Arguments

ADaemon

Daemon instance which is running in this thread

Description

Create creates a new thread instance. It initializes the Daemon property with the passed ADaemon. The thread is created suspended.

See also

TDaemonThread.Daemon

Daemon instance


TDaemonThread.Daemon

Daemon instance

Declaration

Source position: daemonapp.pp line 322

public property TDaemonThread.Daemon: TCustomDaemon
  read FDaemon;

Description

Daemon is the daemon instance which is running in this thread.

See also

TDaemon

Daemon class for visual development


TDaemonThread.Execute

Run the daemon

Declaration

Source position: daemonapp.pp line 315

public procedure TDaemonThread.Execute; override;

Description

Execute starts executing the daemon and waits till the daemon stops. It also listens for control codes for the daemon.

See also

TDaemon.Execute


TDaemonThread.HandleControlCode

Declaration

Source position: daemonapp.pp line 312

protected procedure TDaemonThread.HandleControlCode(

  ACode: DWord

); virtual;


TDaemonThread.InterrogateDaemon

Report the daemon status

Declaration

Source position: daemonapp.pp line 321

public function TDaemonThread.InterrogateDaemon: Boolean; virtual;

Function result

Always True.

Description

InterrogateDaemon simply calls TDaemon.ReportStatus for the daemon that is running in this thread. It always returns True.

See also

TDaemon.ReportStatus


TDaemonThread.PauseDaemon

Pause the daemon

Declaration

Source position: daemonapp.pp line 318

public function TDaemonThread.PauseDaemon: Boolean; virtual;

Function result

True if the daemon was succesfully paused

Description

PauseDaemon attempts to stop the daemon using its TDaemon.Pause method, and suspends the thread. It returns True if the attempt was succesful.

See also

TDaemon.Pause
TDaemonThread.StopDaemon | Stops the daemon
TDaemonThread.ContinueDaemon | Continue the daemon
TDaemonThread.ShutDownDaemon | Shut down daemon


TDaemonThread.ShutDownDaemon

Shut down daemon

Declaration

Source position: daemonapp.pp line 320

public function TDaemonThread.ShutDownDaemon: Boolean; virtual;

Function result

The result of TDaemon.Shutdown

Description

ShutDownDaemon shuts down the daemon. This happens normally only when the system is shut down and the daemon didn't respond to the stop request. The return result is the result of the TDaemon.Shutdown function. The thread is terminated by this method.

See also

TDaemon.Shutdown
TDaemonThread.StopDaemon | Stops the daemon
TDaemonThread.PauseDaemon | Pause the daemon
TDaemonThread.ContinueDaemon | Continue the daemon


TDaemonThread.StartServiceExecute

Declaration

Source position: daemonapp.pp line 311

protected procedure TDaemonThread.StartServiceExecute; virtual;


TDaemonThread.StopDaemon

Stops the daemon

Declaration

Source position: daemonapp.pp line 317

public function TDaemonThread.StopDaemon: Boolean; virtual;

Function result

True if the daemon was stopped succesfully.

Description

StopDaemon attempts to stop the daemon using its TDaemon.Stop method, and terminates the thread.

See also

TDaemon.Stop
TDaemonThread.PauseDaemon | Pause the daemon
TDaemonThread.ShutDownDaemon | Shut down daemon


TDependencies

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Dependencies collection for a daemon

Declaration

Source position: daemonapp.pp line 163

type TDependencies = class(TCollection)
protected
function GetOwner; override;
public
constructor Create(); | Create a new instance of a TDependencies collection.
property Items: TDependency; default; [rw] | Default property override
end;

Inheritance

TDependencies

Dependencies collection for a daemon
|

TCollection
|

TObject

Description

TDependencies is just a descendent of TCollection which contains a series of dependencies on other services. It overrides the default property of TCollection to return TDependency instances.

See also

TDependency

Container to define depenencies on other services.


TDependencies
 |  | Items
TCollection
 |  | PropName
 | ro | UpdateCount
 | ro | Count
 | ro | ItemClass
 |  | Items


ro | Count (TCollection)
ro | ItemClass (TCollection)
 | Items (TCollection)
 | Items (TDependencies)
 | PropName (TCollection)
ro | UpdateCount (TCollection)


TDependencies
pt | GetOwner
 | Create
TCollection
 | GetCount
 | GetPropName
 | InsertItem
 | RemoveItem
 | GetAttrCount
 | GetAttr
 | GetItemAttr
 | Changed
 | GetItem
 | SetItem
 | SetItemName
 | SetPropName
 | Update
 | Notify
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetNamePath
 | Insert
 | FindItemID
 | Sort


 | Add (TCollection)
 | Assign (TCollection)
 | BeginUpdate (TCollection)
 | Changed (TCollection)
 | Clear (TCollection)
 | Create (TCollection)
 | Create (TDependencies)
 | Delete (TCollection)
 | Destroy (TCollection)
 | EndUpdate (TCollection)
 | FindItemID (TCollection)
 | GetAttr (TCollection)
 | GetAttrCount (TCollection)
 | GetCount (TCollection)
 | GetItem (TCollection)
 | GetItemAttr (TCollection)
 | GetNamePath (TCollection)
pt | GetOwner (TDependencies)
 | GetPropName (TCollection)
 | Insert (TCollection)
 | InsertItem (TCollection)
 | Notify (TCollection)
 | Owner (TCollection)
 | RemoveItem (TCollection)
 | SetItem (TCollection)
 | SetItemName (TCollection)
 | SetPropName (TCollection)
 | Sort (TCollection)
 | Update (TCollection)


TDependencies

TCollection


TDependencies.Create

Create a new instance of a TDependencies collection.

Declaration

Source position: daemonapp.pp line 171

public constructor TDependencies.Create(

  AOwner: TPersistent

);

Arguments

AOwner

Owner of the collection - normally a TDaemonDef instance.

Description

Create Create a new instance of a TDependencies collection.


TDependencies.GetOwner

Declaration

Source position: daemonapp.pp line 169

protected function TDependencies.GetOwner: TPersistent; override;


TDependencies.Items

Default property override

Declaration

Source position: daemonapp.pp line 172

public property TDependencies.Items: TDependency
  read GetItem
  write SetItem;
  default;

Description

Items overrides the default property of TCollection so the items are of type TDependency.

See also

TDependency

Container to define depenencies on other services.


TDependency

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Container to define depenencies on other services.

Declaration

Source position: daemonapp.pp line 148

type TDependency = class(TCollectionItem)
protected
function GetDisplayName; override;
public
procedure Assign(); override; | Assign TDependency instance to another
published
property Name: String; [rw] | Name of the service
property IsGroup: Boolean; [rw] | Name refers to a service group
end;

Inheritance

TDependency

Container to define depenencies on other services.
|

TCollectionItem
|

TObject

Description

TDependency is a collection item used to specify dependencies on other daemons (services) in windows. It is used only on windows and when installing the daemon: changing the dependencies of a running daemon has no effect.

See also

TDependencies | Dependencies collection for a daemon
TDaemonDef | Daemon definition


TDependency
pl |  | Name
pl |  | IsGroup
TCollectionItem
 | ro | UpdateCount
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName


 | ro | ID (TCollectionItem)
 |  | Index (TCollectionItem)
pl |  | IsGroup (TDependency)
pl |  | Name (TDependency)
 | ro | UpdateCount (TCollectionItem)


TDependency
pt | GetDisplayName
 | Assign
TCollectionItem
 | GetIndex
 | SetCollection
 | Changed
 | GetOwner
 | GetDisplayName
 | SetIndex
 | SetDisplayName
 | Create
 | Destroy
 | GetNamePath


 | Assign (TDependency)
 | Changed (TCollectionItem)
 | Create (TCollectionItem)
 | Destroy (TCollectionItem)
 | GetDisplayName (TCollectionItem)
pt | GetDisplayName (TDependency)
 | GetIndex (TCollectionItem)
 | GetNamePath (TCollectionItem)
 | GetOwner (TCollectionItem)
 | SetCollection (TCollectionItem)
 | SetDisplayName (TCollectionItem)
 | SetIndex (TCollectionItem)


TDependency

TCollectionItem


TDependency.GetDisplayName

Declaration

Source position: daemonapp.pp line 153

protected function TDependency.GetDisplayName: String; override;


TDependency.IsGroup

Name refers to a service group

Declaration

Source position: daemonapp.pp line 158

published property TDependency.IsGroup: Boolean
  read FIsGroup
  write FIsGroup;

Description

IsGroup can be set to True to indicate that Name refers to the name of a service group.

See also

TDependency.Name

Name of the service


TDependency.Name

Name of the service

Declaration

Source position: daemonapp.pp line 157

published property TDependency.Name: String
  read FName
  write FName;

Description

Name is the name of a service or service group that the current daemon depends on.

See also

TDependency.IsGroup

Name refers to a service group


TWinBindings

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Windows Daemon bindings (windows only)

Declaration

Source position: daemonapp.pp line 178

type TWinBindings = class(TPersistent)
public
constructor Create; | Create a new TWinBindings instance
destructor Destroy; override; | Remove a TWinBindings instance from memory
procedure Assign(); override; | Copies all properties
property ErrCode: DWord; [rw] | Service specific error code
property Win32ErrCode: DWord; [rw] | General windows error code
published
property Dependencies: TDependencies; [rw] | Service dependencies
property GroupName: String; [rw] | Service group name
property Password: String; [rw] | Password for service startup
property UserName: String; [rw] | Username to run service as
property StartType: TStartType; [rw] | Service startup type.
property WaitHint: Integer; [rw] | Timeout wait hint
property IDTag: DWord; [rw] | Location in the service group
property ServiceType: TServiceType; [rw] | Type of service
property ErrorSeverity: TErrorSeverity; [rw] | Error severity in case of startup failure
end;

Inheritance

TWinBindings

Windows Daemon bindings (windows only)
|

TPersistent
|

TObject

Description

TWinBindings contains windows-specific properties for the daemon definition (in TDaemonDef.WinBindings). If the daemon should not run on Windows, then the properties can be ignored.

See also

TDaemonDef | Daemon definition
TDaemonDef.WinBindings | Windows-specific bindings (windows only)


TWinBindings
 | ErrCode
 | Win32ErrCode
pl | Dependencies
pl | GroupName
pl | Password
pl | UserName
pl | StartType
pl | WaitHint
pl | IDTag
pl | ServiceType
pl | ErrorSeverity
TPersistent


pl | Dependencies (TWinBindings)
 | ErrCode (TWinBindings)
pl | ErrorSeverity (TWinBindings)
pl | GroupName (TWinBindings)
pl | IDTag (TWinBindings)
pl | Password (TWinBindings)
pl | ServiceType (TWinBindings)
pl | StartType (TWinBindings)
pl | UserName (TWinBindings)
pl | WaitHint (TWinBindings)
 | Win32ErrCode (TWinBindings)


TWinBindings
 | Create
 | Destroy
 | Assign
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


AssignError (TPersistent)

AssignTo (TPersistent)

Create (TWinBindings)

DefineProperties (TPersistent)

Destroy (TPersistent)

Destroy (TWinBindings)

GetNamePath (TPersistent)

GetOwner (TPersistent)


TWinBindings

TPersistent


TWinBindings.Assign

Copies all properties

Declaration

Source position: daemonapp.pp line 195

public procedure TWinBindings.Assign(

  Source: TPersistent

); override;

Arguments

Source

TWinBindings instance to copy properties from

Description

Assign is overridden by TWinBindings so all properties are copied from Source to the TWinBindings instance.


TWinBindings.Create

Create a new TWinBindings instance

Declaration

Source position: daemonapp.pp line 193

public constructor TWinBindings.Create;

Description

Create initializes various properties such as the dependencies.

See also

TDaemonDef | Daemon definition
TDaemonDef.WinBindings | Windows-specific bindings (windows only)
TWinBindings.Dependencies | Service dependencies


TWinBindings.Dependencies

Service dependencies

Declaration

Source position: daemonapp.pp line 199

published property TWinBindings.Dependencies: TDependencies
  read FDependencies
  write SetDependencies;

Description

Dependencies contains the list of other services (or service groups) that this service depends on. Windows will first attempt to start these services prior to starting this service. If they cannot be started, then the service will not be started either.

This property is only used during installation of the service.


TWinBindings.Destroy

Remove a TWinBindings instance from memory

Declaration

Source position: daemonapp.pp line 194

public destructor TWinBindings.Destroy; override;

Description

Destroy cleans up the TWinBindings instance.

See also

TWinBindings.Dependencies | Service dependencies
TWinBindings.Create | Create a new TWinBindings instance


TWinBindings.ErrCode

Service specific error code

Declaration

Source position: daemonapp.pp line 196

public property TWinBindings.ErrCode: DWord
  read FErrCode
  write FErrCode;

Description

ErrCode contains a service specific error code that is reported with TDaemon.ReportStatus to the windows service manager. If it is zero, then the contents of Win32ErrCode are reported. If it is nonzero, then the windows-errorcode is set to ERROR_SERVICE_SPECIFIC_ERROR.

See also

TWinBindings.Win32ErrCode

General windows error code


TWinBindings.ErrorSeverity

Error severity in case of startup failure

Declaration

Source position: daemonapp.pp line 207

published property TWinBindings.ErrorSeverity: TErrorSeverity
  read FErrorSeverity
  write FErrorSeverity;

Description

ErrorSeverity can be used at installation time to tell the windows service manager how to behave when the service fails to start during system startup.

This property is only used during installation of the service.


TWinBindings.GroupName

Service group name

Declaration

Source position: daemonapp.pp line 200

published property TWinBindings.GroupName: String
  read FLoadGroup
  write FLoadGroup;

Description

GroupName specifies the name of a service group that the service belongs to. If it is empty, then the service does not belong to any group.

This property is only used during installation of the service.

See also

TDependency.IsGroup

Name refers to a service group


TWinBindings.IDTag

Location in the service group

Declaration

Source position: daemonapp.pp line 205

published property TWinBindings.IDTag: DWord
  read FTagID
  write FTagID;

Description

IDTag contains the location of the service in the service group after installation of the service. It should not be set, it is reported by the service manager.

This property is only used during installation of the service.


TWinBindings.Password

Password for service startup

Declaration

Source position: daemonapp.pp line 201

published property TWinBindings.Password: String
  read FPassWord
  write FPassword;

Description

Password contains the service password: if the service is started with credentials other than one of the system users, then the password for the user must be entered here.

This property is only used during installation of the service.

See also

UserName

Username to run service as


TWinBindings.ServiceType

Type of service

Declaration

Source position: daemonapp.pp line 206

published property TWinBindings.ServiceType: TServiceType
  read FServiceType
  write FServiceType;

Description

ServiceType specifies what kind of service is being installed.

This property is only used during installation of the service.


TWinBindings.StartType

Service startup type.

Declaration

Source position: daemonapp.pp line 203

published property TWinBindings.StartType: TStartType
  read FStartType
  write FStartType;

Description

StartType specifies when the service should be started during system startup.

This property is only used during installation of the service.


TWinBindings.UserName

Username to run service as

Declaration

Source position: daemonapp.pp line 202

published property TWinBindings.UserName: String
  read FUserName
  write FUserName;

Description

Username specifies the name of a user whose credentials should be used to run the service. If it is left empty, the service is run as the system user. The password can be set in the Password property.

This property is only used during installation of the service.

See also

Password

Password for service startup


TWinBindings.WaitHint

Timeout wait hint

Declaration

Source position: daemonapp.pp line 204

published property TWinBindings.WaitHint: Integer
  read FWaitHint
  write FWaitHint;

Description

WaitHint specifies the estimated time for a start/stop/pause or continue operation (in milliseconds). Reportstatus should be called prior to this time to report the next status.

See also

TDaemon.ReportStatus


TWinBindings.Win32ErrCode

General windows error code

Declaration

Source position: daemonapp.pp line 197

public property TWinBindings.Win32ErrCode: DWord
  read FWin32ErrorCode
  write FWin32ErrorCode;

Description

Win32ErrCode is a general windows service error code that can be reported with TDaemon.ReportStatus to the windows service manager. It is sent if ErrCode is zero.

See also

ErrCode

Service specific error code


ELogError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised on errors in the TEventLog component

Declaration

Source position: eventlog.pp line 101

type ELogError = class(Exception) end;

Inheritance

ELogError

Exception raised on errors in the TEventLog component
|

Exception
|

TObject

Description

ELogError is the exception used in the TEventLog component to indicate errors.

See also

TEventLog

Event logging class


ELogError
Exception
 | HelpContext
 | Message


ELogError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


ELogError

Exception


TEventLog

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Event logging class

Declaration

Source position: eventlog.pp line 31

type TEventLog = class(TComponent)
protected
procedure CheckInactive;
procedure EnsureActive;
function MapTypeToEvent();
function MapTypeToCategory();
function MapTypeToEventID();
public
destructor Destroy; override; | Clean up TEventLog instance
function EventTypeToString(); | Create a string representation of an event type
function RegisterMessageFile(); virtual; | Register message file
procedure Log(); | Log a message to the system log.
procedure Warning(); | Log a warning message.
procedure Error(); | Log an error message to
procedure Debug(); | Log a debug message
procedure Info(); | Log an informational message
published
property Identification: String; [rw] | Identification string for messages
property LogType: TLogType; [rw] | Log type
property Active: Boolean; [rw] | Activate the log mechanism
property RaiseExceptionOnError: Boolean; [rw] | Determines whether logging errors are reported or ignored
property DefaultEventType: TEventType; [rw] | Default event type for the Log call.
property FileName: String; [rw] | File name for log file
property TimeStampFormat: String; [rw] | Format for the timestamp string
property CustomLogType: Word; [rw] | Custom log type ID
property EventIDOffset: DWord; [rw] | Offset for event ID messages identifiers
property OnGetCustomCategory: TLogCategoryEvent; [rw] | Event to retrieve custom message category
property OnGetCustomEventID: TLogCodeEvent; [rw] | Event to retrieve custom event ID
property OnGetCustomEvent: TLogCodeEvent; [rw] | Event to retrieve custom event Code
end;

Inheritance

TEventLog

Event logging class
|

TComponent
|

TObject

Description

TEventLog is a component which can be used to send messages to the system log. In case no system log exists (such as on Windows 95/98 or DOS), the messages are written to a file. Messages can be logged using the general Log call, or the specialized Warning, Error, Info or Debug calls, which have the event type predefined.

See also

Log | Log a message to the system log.
Warning | Log a warning message.
Error | Log an error message to
Info | Log an informational message
Debug | Log a debug message


TEventLog
pl |  | Identification
pl |  | LogType
pl |  | Active
pl |  | RaiseExceptionOnError
pl |  | DefaultEventType
pl |  | FileName
pl |  | TimeStampFormat
pl |  | CustomLogType
pl |  | EventIDOffset
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


pl |  | Active (TEventLog)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
pl |  | CustomLogType (TEventLog)
pl |  | DefaultEventType (TEventLog)
 |  | DesignInfo (TComponent)
pl |  | EventIDOffset (TEventLog)
pl |  | FileName (TEventLog)
pl |  | Identification (TEventLog)
pl |  | LogType (TEventLog)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
pl |  | RaiseExceptionOnError (TEventLog)
 |  | Tag (TComponent)
pl |  | TimeStampFormat (TEventLog)
 |  | VCLComObject (TComponent)


TEventLog
pt | CheckInactive
pt | EnsureActive
pt | MapTypeToEvent
pt | MapTypeToCategory
pt | MapTypeToEventID
 | Destroy
 | EventTypeToString
 | RegisterMessageFile
 | Log
 | Warning
 | Error
 | Debug
 | Info
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


pt | CheckInactive (TEventLog)
 | Create (TComponent)
 | Debug (TEventLog)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TEventLog)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | EnsureActive (TEventLog)
 | Error (TEventLog)
 | EventTypeToString (TEventLog)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Info (TEventLog)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Log (TEventLog)
pt | MapTypeToCategory (TEventLog)
pt | MapTypeToEvent (TEventLog)
pt | MapTypeToEventID (TEventLog)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | RegisterMessageFile (TEventLog)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | Warning (TEventLog)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TEventLog
pl | OnGetCustomCategory
pl | OnGetCustomEventID
pl | OnGetCustomEvent
TComponent


pl | OnGetCustomCategory (TEventLog)
pl | OnGetCustomEvent (TEventLog)
pl | OnGetCustomEventID (TEventLog)


TEventLog.Active

Activate the log mechanism

Declaration

Source position: eventlog.pp line 89

published property TEventLog.Active: Boolean
  read FActive
  write SetActive;

Description

Active determines whether the log mechanism is active: if set to True, the component connects to the system log mechanism, or opens the log file if needed. Any attempt to log a message while the log is not active will try to set this property to True. Disconnecting from the system log or closing the log file is done by setting the Active property to False.

If the connection to the system logger fails, or the log file cannot be opened, then setting this property may result in an exception.

See also

Log

Log a message to the system log.


TEventLog.CheckInactive

Declaration

Source position: eventlog.pp line 65

protected procedure TEventLog.CheckInactive;


TEventLog.CustomLogType

Custom log type ID

Declaration

Source position: eventlog.pp line 94

published property TEventLog.CustomLogType: Word
  read FCustomLogType
  write FCustomLogType;

Description

CustomLogType is used in the EventTypeToString to format the custom log event type string.

See also

EventTypeToString

Create a string representation of an event type


TEventLog.Debug

Log a debug message

Declaration

Source position: line 0

public procedure TEventLog.Debug(

  Msg: String

); overload;

procedure TEventLog.Debug(

  Fmt: String;

  Args: array of Const

); overload;

Arguments

Msg

Complete debug message

Arguments

Fmt | Formatting string for Args
Args | Arguments to format message with

Description

Debug is a utility function which logs a message with the etDebug type. The message is either the parameter Msg as is, or is formatted from the Fmt and Args parameters.

See also

Log | Log a message to the system log.
Info | Log an informational message
Warning | Log a warning message.
Error | Log an error message to


TEventLog.DefaultEventType

Default event type for the Log call.

Declaration

Source position: eventlog.pp line 91

published property TEventLog.DefaultEventType: TEventType
  read FDEfaultEventType
  write FDefaultEventType;

Description

DefaultEventType is the event type used by the Log call if it's EventType parameter is omitted.

See also

Log

Log a message to the system log.


TEventLog.Destroy

Clean up TEventLog instance

Declaration

Source position: eventlog.pp line 71

public destructor TEventLog.Destroy; override;

Description

Destroy cleans up the TEventLog instance. It cleans any log structures that might have been set up to perform logging, by setting the Active property to False.

See also

Active

Activate the log mechanism


TEventLog.EnsureActive

Declaration

Source position: eventlog.pp line 66

protected procedure TEventLog.EnsureActive;


TEventLog.Error

Log an error message to

Declaration

Source position: line 0

public procedure TEventLog.Error(

  Msg: String

); overload;

procedure TEventLog.Error(

  Fmt: String;

  Args: array of Const

); overload;

Arguments

Msg

Complete error message

Arguments

Fmt | Formatting string for Args
Args | Arguments to format message with

Description

Error is a utility function which logs a message with the etError type. The message is either the parameter Msg as is, or is formatted from the Fmt and Args parameters.

See also

Log | Log a message to the system log.
Info | Log an informational message
Warning | Log a warning message.
Debug | Log a debug message


TEventLog.EventIDOffset

Offset for event ID messages identifiers

Declaration

Source position: eventlog.pp line 95

published property TEventLog.EventIDOffset: DWord
  read FEventIDOffset
  write FEventIDOffset;

Description

EventIDOffset is the offset for the message formatting strings in the windows resource file. This property is ignored on other platforms.

The message strings in the file registered with the RegisterMessageFile call are windows resource strings. They each have a unique ID, which must be communicated to windows. In the resource file distributed by Free Pascal, the resource strings are numbered from 1000 to 1004. The actual number communicated to windows is formed by adding the ordinal value of the message's eventtype to EventIDOffset (which is by default 1000), which means that by default, the string numbers are:

1000
Custom event types
1001
Information event type
1002
Warning event type
1003
Error event type
1004
Debug event type

See also

RegisterMessageFile

Register message file


TEventLog.EventTypeToString

Create a string representation of an event type

Declaration

Source position: eventlog.pp line 72

public function TEventLog.EventTypeToString(

  E: TEventType

):String;

Arguments

E

Event type to convert to string

Function result

String representation of E

Description

EventTypeToString converts the event type E to a suitable string representation for logging purposes. It's mainly used when writing messages to file, as the system log usually has it's own mechanisms for displaying the various event types.

See also

TEventType

Type of event


TEventLog.FileName

File name for log file

Declaration

Source position: eventlog.pp line 92

published property TEventLog.FileName: String
  read FFileName
  write SetFileName;

Description

FileName is the name of the log file used to log messages if no system logger is available or the LogType is ltFile. If none is specified, then the name of the application binary is used, with the extension replaced by .log. The file is then located in the /tmp directory on unix-like systems, or in the application directory for Dos/Windows like systems.

See also

LogType


TEventLog.Identification

Identification string for messages

Declaration

Source position: eventlog.pp line 87

published property TEventLog.Identification: String
  read FIdentification
  write SetIdentification;

Description

Identification is used as a string identifying the source of the messages in the system log. If it is empty, the filename part of the application binary is used.

See also

Active | Activate the log mechanism
TimeStampFormat | Format for the timestamp string


TEventLog.Info

Log an informational message

Declaration

Source position: line 0

public procedure TEventLog.Info(

  Msg: String

); overload;

procedure TEventLog.Info(

  Fmt: String;

  Args: array of Const

); overload;

Arguments

Msg

Complete information message

Arguments

Fmt | Formatting string for Args
Args | Arguments to format message with

Description

Info is a utility function which logs a message with the etInfo type. The message is either the parameter Msg as is, or is formatted from the Fmt and Args parameters.

See also

Log | Log a message to the system log.
Warning | Log a warning message.
Error | Log an error message to
Debug | Log a debug message


TEventLog.Log

Log a message to the system log.

Declaration

Source position: line 0

public procedure TEventLog.Log(

  EventType: TEventType;

  Msg: String

); overload;

procedure TEventLog.Log(

  EventType: TEventType;

  Fmt: String;

  Args: array of Const

); overload;

procedure TEventLog.Log(

  Msg: String

); overload;

procedure TEventLog.Log(

  Fmt: String;

  Args: array of Const

); overload;

Arguments

EventType | Event type to use.
Msg | Complete log message

Arguments

EventType | Event type to use.
Fmt | Format string for Args
Args | Arguments to be formatted with Fmt

Arguments

Msg

Complete log message

Arguments

Fmt | Format string for Args
Args | Arguments to be formatted with Fmt

Description

Log sends a log message to the system log. The message is either the parameter Msg as is, or is formatted from the Fmt and Args parameters. If EventType is specified, then it is used as the message event type. If EventType is omitted, then the event type is determined from DefaultEventType.

If EventType is etCustom, then the OnGetCustomEvent, OnGetCustomEventID and OnGetCustomCategory.

The other logging calls: Info, Warning, Error and Debug use the Log call to do the actual work.

See also

Info | Log an informational message
Warning | Log a warning message.
Error | Log an error message to
Debug | Log a debug message
OnGetCustomEvent | Event to retrieve custom event Code
OnGetCustomEventID | Event to retrieve custom event ID
OnGetCustomCategory | Event to retrieve custom message category


TEventLog.LogType

Log type

Declaration

Source position: eventlog.pp line 88

published property TEventLog.LogType: TLogType
  read Flogtype
  write SetlogType;

Description

LogType is the type of the log: if it is ltSystem, then the system log is used, if it is available. If it is ltFile or there is no system log available, then the log messages are written to a file. The name for the log file is taken from the FileName property.

See also

FileName

File name for log file


TEventLog.MapTypeToCategory

Declaration

Source position: eventlog.pp line 68

protected function TEventLog.MapTypeToCategory(

  EventType: TEventType

):Word;


TEventLog.MapTypeToEvent

Declaration

Source position: eventlog.pp line 67

protected function TEventLog.MapTypeToEvent(

  EventType: TEventType

):DWord;


TEventLog.MapTypeToEventID

Declaration

Source position: eventlog.pp line 69

protected function TEventLog.MapTypeToEventID(

  EventType: TEventType

):DWord;


TEventLog.OnGetCustomCategory

Event to retrieve custom message category

Declaration

Source position: eventlog.pp line 96

published property TEventLog.OnGetCustomCategory: TLogCategoryEvent
  read FOnGetCustomCategory
  write FOnGetCustomCategory;

Description

OnGetCustomCategory is called on the windows platform to determine the category of a custom event type. It should return an ID which will be used by windows to look up the string which describes the message category in the file containing the resource strings.

See also

OnGetCustomEventID | Event to retrieve custom event ID
OnGetCustomEvent | Event to retrieve custom event Code


TEventLog.OnGetCustomEvent

Event to retrieve custom event Code

Declaration

Source position: eventlog.pp line 98

published property TEventLog.OnGetCustomEvent: TLogCodeEvent
  read FOnGetCustomEvent
  write FOnGetCustomEvent;

Description

OnGetCustomEvent is called on the windows platform to determine the event code of a custom event type. It should return an ID.

See also

OnGetCustomCategory | Event to retrieve custom message category
OnGetCustomEventID | Event to retrieve custom event ID


TEventLog.OnGetCustomEventID

Event to retrieve custom event ID

Declaration

Source position: eventlog.pp line 97

published property TEventLog.OnGetCustomEventID: TLogCodeEvent
  read FOnGetCustomEventID
  write FOnGetCustomEventID;

Description

OnGetCustomEventID is called on the windows platform to determine the category of a custom event type. It should return an ID which will be used by windows to look up the string which formats the message, in the file containing the resource strings.

See also

OnGetCustomCategory | Event to retrieve custom message category
OnGetCustomEvent | Event to retrieve custom event Code


TEventLog.RaiseExceptionOnError

Determines whether logging errors are reported or ignored

Declaration

Source position: eventlog.pp line 90

published property TEventLog.RaiseExceptionOnError: Boolean
  read FRaiseExceptionOnError
  write FRaiseExceptionOnError;

Description

RaiseExceptionOnError determines whether an error during a logging operation will be signaled with an exception or not. If set to False, errors will be silently ignored, thus not disturbing normal operation of the program.


TEventLog.RegisterMessageFile

Register message file

Declaration

Source position: eventlog.pp line 73

public function TEventLog.RegisterMessageFile(

  AFileName: String

):Boolean; virtual;

Arguments

AFileName

Filename with messages as resource strings.

Function result

True if the call was succesful, False if not.

Description

RegisterMessageFile is used on Windows to register the file AFileName containing the formatting strings for the system messages. This should be a file containing resource strings. If AFileName is empty, the filename of the application binary is substituted.

When a message is logged to the windows system log, Windows looks for a formatting string in the file registered with this call.

There are 2 kinds of formatting strings:

Category strings these should be numbered from 1 to 4

1
Should contain the description of the etInfo event type.
2
Should contain the description of the etWarning event type.
4
Should contain the description of the etError event type.
4
Should contain the description of the etDebug event type.

None of these strings should have a string substitution placeholder.

The second type of strings are the message definitions. Their number starts at EventIDOffset (default is 1000) and each string should have 1 placeholder.

Free Pascal comes with a fclel.res resource file which contains default values for the 8 strings, in english. It can be linked in the application binary with the statement

{$R fclel.res}

This file is generated from the fclel.mc and fclel.rc files that are distributed with the Free Pascal sources.

If the strings are not registered, windows will still display the event messages, but they will not be formatted nicely.

Note that while any messages logged with the event logger are displayed in the event viewern Windows locks the file registered here. This usually means that the binary is locked.

On non-windows operating systems, this call is ignored.

Errors

If AFileName is invalid, false is returned.


TEventLog.TimeStampFormat

Format for the timestamp string

Declaration

Source position: eventlog.pp line 93

published property TEventLog.TimeStampFormat: String
  read FTimeStampFormat
  write FTimeStampFormat;

Description

TimeStampFormat is the formatting string used to create a timestamp string when writing log messages to file. It should have a format suitable for the FormatDateTime call. If it is left empty, then yyyy-mm-dd hh:nn:ss.zzz is used.

See also

TEventLog.Identification

Identification string for messages


TEventLog.Warning

Log a warning message.

Declaration

Source position: line 0

public procedure TEventLog.Warning(

  Msg: String

); overload;

procedure TEventLog.Warning(

  Fmt: String;

  Args: array of Const

); overload;

Arguments

Msg

Complete warning message

Arguments

Fmt | Formatting string for Args
Args | Arguments to format message with

Description

Warning is a utility function which logs a message with the etWarning type. The message is either the parameter Msg as is, or is formatted from the Fmt and Args parameters.

See also

Log | Log a message to the system log.
Info | Log an informational message
Error | Log an error message to
Debug | Log a debug message


ECGIException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised by TEZcgi

Declaration

Source position: ezcgi.pp line 26

type ECGIException = class(Exception) end;

Inheritance

ECGIException

Exception raised by TEZcgi
|

Exception
|

TObject

See also

TEZcgi

Easy CGI class


ECGIException
Exception
 | HelpContext
 | Message


ECGIException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


ECGIException

Exception


TEZcgi

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Easy CGI class

Declaration

Source position: ezcgi.pp line 28

type TEZcgi = class(TObject)
protected
procedure OutputError();
public
constructor Create; | Creates a new instance of the TEZCGI component
destructor Destroy; override; | Removes the TEZCGI component from memory
procedure Run; | Run the CGI application.
procedure WriteContent(); | Writes the content type to standard output
procedure PutLine(); | Send a line of output to the web-client
function GetValue(); | Return the value of a request variable.
procedure DoPost; virtual; | Method to handle POST requests
procedure DoGet; virtual; | Method to handle GET requests
property Values: String; [r] | Variables passed to the CGI script
property Names: String; [r] | Indexed array with available variable names.
property Variables: String; [r] | Indexed array with variables as name=value pairs.
property VariableCount: Integer; [r] | Number of available variables.
property Name: String; [rw] | Name of the server administrator
property Email: String; [rw] | Email of the server administrator
end;

Inheritance

TEZcgi

Easy CGI class
|

TObject

Description

TEZcgi implements all functionality to analyze the CGI environment and query the variables present in it. It's main use is the exposed variables.

Programs wishing to use this class should make a descendent class of this class and override the DoPost or DoGet methods. To run the program, an instance of this class must be created, and it's Run method should be invoked. This will analyze the environment and call the DoPost or DoGet method, depending on what HTTP method was used to invoke the program.


TEZcgi
 | ro | Values
 | ro | Names
 | ro | Variables
 | ro | VariableCount
 |  | Name
 |  | Email


ro | Names (TEZcgi)
ro | Values (TEZcgi)
ro | VariableCount (TEZcgi)
ro | Variables (TEZcgi)


TEZcgi
pt | OutputError
 | Create
 | Destroy
 | Run
 | WriteContent
 | PutLine
 | GetValue
 | DoPost
 | DoGet


 | Create (TEZcgi)
 | Destroy (TEZcgi)
 | DoGet (TEZcgi)
 | DoPost (TEZcgi)
 | GetValue (TEZcgi)
pt | OutputError (TEZcgi)
 | PutLine (TEZcgi)
 | Run (TEZcgi)
 | WriteContent (TEZcgi)


TEZcgi


TEZcgi.Create

Creates a new instance of the TEZCGI component

Declaration

Source position: ezcgi.pp line 61

public constructor TEZcgi.Create;

Description

Create initializes the CGI program's environment: it reads the environment variables passed to the CGI program and stores them in the Variable property.

See also

Variables

Names

Values


TEZcgi.Destroy

Removes the TEZCGI component from memory

Declaration

Source position: ezcgi.pp line 62

public destructor TEZcgi.Destroy; override;

Description

Destroy removes all variables from memory and then calls the inherited destroy, removing the TEZCGI instance from memory.

Destroy should never be called directly. Instead Free should be used, or FreeAndNil

See also

Create

Creates a new instance of the TEZCGI component


TEZcgi.DoGet

Method to handle GET requests

Declaration

Source position: ezcgi.pp line 69

public procedure TEZcgi.DoGet; virtual;

Description

DoGet is called by the Run method the GET method was used to invoke the CGI application. It should be overridden in descendents of TEZcgi to actually handle the request.

See also

Run | Run the CGI application.
DoPost | Method to handle POST requests


TEZcgi.DoPost

Method to handle POST requests

Declaration

Source position: ezcgi.pp line 68

public procedure TEZcgi.DoPost; virtual;

Description

DoPost is called by the Run method the POST method was used to invoke the CGI application. It should be overridden in descendents of TEZcgi to actually handle the request.

See also

Run | Run the CGI application.
DoGet | Method to handle GET requests


TEZcgi.Email

Email of the server administrator

Declaration

Source position: ezcgi.pp line 77

public property TEZcgi.Email: String
  read FEmail
  write FEmail;

Description

Email is used when displaying an error message to the user. This should set prior to calling the TEZcgi.Run method.

See also

TEZcgi.Run | Run the CGI application.
TEZcgi.Name | Name of the server administrator


TEZcgi.GetValue

Return the value of a request variable.

Declaration

Source position: ezcgi.pp line 66

public function TEZcgi.GetValue(

  Index: String;

  defaultValue: String

):String;

Arguments

Index | Name of variable.
defaultValue | Value to return in case variable is empty.

Function result

Value of variable.

Description

GetValue returns the value of the variable named Index, and returns DefaultValue if it is empty or does not exist.

See also

Values

Variables passed to the CGI script


TEZcgi.Name

Name of the server administrator

Declaration

Source position: ezcgi.pp line 76

public property TEZcgi.Name: String
  read FName
  write FName;

Description

Name is used when displaying an error message to the user. This should set prior to calling the TEZcgi.Run method.

See also

TEZcgi.Run | Run the CGI application.
TEZcgi.Email | Email of the server administrator


TEZcgi.Names

Indexed array with available variable names.

Declaration

Source position: ezcgi.pp line 72

public property TEZcgi.Names: String
  read GetName;

Description

Names provides indexed access to the available variable names. The Index may run from 0 to VariableCount. Any other value will result in an exception being raised.

See also

TEZcgi.Variables | Indexed array with variables as name=value pairs.
TEZcgi.Values | Variables passed to the CGI script
TEZcgi.GetValue | Return the value of a request variable.
TEZcgi.VariableCount | Number of available variables.


TEZcgi.OutputError

Declaration

Source position: ezcgi.pp line 58

protected procedure TEZcgi.OutputError(

  errorMessage: String

);


TEZcgi.PutLine

Send a line of output to the web-client

Declaration

Source position: ezcgi.pp line 65

public procedure TEZcgi.PutLine(

  sOut: String

);

Arguments

sOut

Text to be sent to the client.

Description

PutLine writes a line of text (sOut) to the web client (currently, to standard output). It should be called only after WriteContent was called with a content type of text. The sent text is not processed in any way, i.e. no HTML entities or so are inserted instead of special HTML characters. This should be done by the user.

Errors

No check is performed whether the content type is right.

See also

WriteContent

Writes the content type to standard output


TEZcgi.Run

Run the CGI application.

Declaration

Source position: ezcgi.pp line 63

public procedure TEZcgi.Run;

Description

Run analyses the variables passed to the application, processes the request variables (it stores them in the Variables property) and calls the DoPost or DoGet methods, depending on the method passed to the web server.

After creating the instance of TEZCGI, the Run method is the only method that should be called when using this component.

See also

Variables
DoPost | Method to handle POST requests
DoGet | Method to handle GET requests


TEZcgi.Values

Variables passed to the CGI script

Declaration

Source position: ezcgi.pp line 71

public property TEZcgi.Values: String
  read GetVal;

Description

Values is a name-based array of variables that were passed to the script by the web server or the HTTP request. The Index variable is the name of the variable whose value should be retrieved. The following standard values are available:

AUTH_TYPE
Authorization type
CONTENT_LENGTH
Content length
CONTENT_TYPE
Content type
GATEWAY_INTERFACE
Used gateway interface
PATH_INFO
Requested URL
PATH_TRANSLATED
Transformed URL
QUERY_STRING
Client query string
REMOTE_ADDR
Address of remote client
REMOTE_HOST
DNS name of remote client
REMOTE_IDENT
Remote identity.
REMOTE_USER
Remote user
REQUEST_METHOD
Request methods (POST or GET)
SCRIPT_NAME
Script name
SERVER_NAME
Server host name
SERVER_PORT
Server port
SERVER_PROTOCOL
Server protocol
SERVER_SOFTWARE
Web server software
HTTP_ACCEPT
Accepted responses
HTTP_ACCEPT_CHARSET
Accepted character sets
HTTP_ACCEPT_ENCODING
Accepted encodings
HTTP_IF_MODIFIED_SINCE
Proxy information
HTTP_REFERER
Referring page
HTTP_USER_AGENT
Client software name

Other than the standard list, any variables that were passed by the web-client request, are also available. Note that the variables are case insensitive.

See also

TEZCGI.Variables | Indexed array with variables as name=value pairs.
TEZCGI.Names | Indexed array with available variable names.
TEZCGI.GetValue | Return the value of a request variable.
TEZcgi.VariableCount | Number of available variables.


TEZcgi.VariableCount

Number of available variables.

Declaration

Source position: ezcgi.pp line 74

public property TEZcgi.VariableCount: Integer
  read GetVarCount;

Description

TEZcgi.VariableCount returns the number of available CGI variables. This includes both the standard CGI environment variables and the request variables. The actual names and values can be retrieved with the Names and Variables properties.

See also

Names | Indexed array with available variable names.
Variables | Indexed array with variables as name=value pairs.
TEZcgi.Values | Variables passed to the CGI script
TEZcgi.GetValue | Return the value of a request variable.


TEZcgi.Variables

Indexed array with variables as name=value pairs.

Declaration

Source position: ezcgi.pp line 73

public property TEZcgi.Variables: String
  read GetVariable;

Description

Variables provides indexed access to the available variable names and values. The variables are returned as Name=Value pairs. The Index may run from 0 to VariableCount. Any other value will result in an exception being raised.

See also

TEZcgi.Names | Indexed array with available variable names.
TEZcgi.Values | Variables passed to the CGI script
TEZcgi.GetValue | Return the value of a request variable.
TEZcgi.VariableCount | Number of available variables.


TEZcgi.WriteContent

Writes the content type to standard output

Declaration

Source position: ezcgi.pp line 64

public procedure TEZcgi.WriteContent(

  ctype: String

);

Arguments

ctype

Content type

Description

WriteContent writes the content type cType to standard output, followed by an empty line. After this method was called, no more HTTP headers may be written to standard output. Any HTTP headers should be written before WriteContent is called. It should be called from the DoPost or DoGet methods.

See also

DoPost | Method to handle POST requests
DoGet | Method to handle GET requests
PutLine | Send a line of output to the web-client


TFPBaseInterpolation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPBaseInterpolation - the default interpolation to be applied if no other is specified

Declaration

Source position: fpcanvas.pp line 172

type TFPBaseInterpolation = class(TFPCustomInterpolation)
protected
procedure Execute(); override; | Execute the interpolation
function Filter(); virtual; | Filter factor to be used in interpolating
function MaxSupport; virtual; | MaxSupport factor for interpolation
end;

Inheritance

TFPBaseInterpolation | TFPBaseInterpolation - the default interpolation to be applied if no other is specified
|
TFPCustomInterpolation | TFPCustomInterpolation - FreePascal base class for interpolations while drawing in unspecified regions between specified points
|
TObject


TFPBaseInterpolation
TFPCustomInterpolation
 | ro | Canvas
 | ro | Image


ro | Canvas (TFPCustomInterpolation)
ro | Image (TFPCustomInterpolation)


TFPBaseInterpolation
pt | Execute
pt | Filter
pt | MaxSupport
TFPCustomInterpolation
pt | Initialize
pt | Execute


pt | Execute (TFPCustomInterpolation)
pt | Execute (TFPBaseInterpolation)
pt | Filter (TFPBaseInterpolation)
pt | Initialize (TFPCustomInterpolation)
pt | MaxSupport (TFPBaseInterpolation)


TFPBaseInterpolation

TFPCustomInterpolation


TFPBaseInterpolation.Filter

Filter factor to be used in interpolating

Declaration

Source position: fpcanvas.pp line 178

protected function TFPBaseInterpolation.Filter(

  x: double

):double; virtual;


TFPBaseInterpolation.MaxSupport

MaxSupport factor for interpolation

Declaration

Source position: fpcanvas.pp line 179

protected function TFPBaseInterpolation.MaxSupport: double; virtual;


TFPBrushException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPBrushException - exception handler for FreePascal base Brush class

Declaration

Source position: fpcanvas.pp line 29

type TFPBrushException = class(TFPCanvasException) end;

Inheritance

TFPBrushException | TFPBrushException - exception handler for FreePascal base Brush class
|
TFPCanvasException | TFPCanvasException - exception handler for FreePascal base Canvas class
|
Exception
|
TObject


TFPBrushException
TFPCanvasException
Exception
 | HelpContext
 | Message


TFPBrushException
TFPCanvasException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


TFPBrushException

TFPCanvasException

Exception


TFPCanvasException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCanvasException - exception handler for FreePascal base Canvas class

Declaration

Source position: fpcanvas.pp line 27

type TFPCanvasException = class(Exception) end;

Inheritance

TFPCanvasException

TFPCanvasException - exception handler for FreePascal base Canvas class
|

Exception
|

TObject


TFPCanvasException
Exception
 | HelpContext
 | Message


TFPCanvasException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


TFPCanvasException

Exception


TFPCanvasHelper

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases

Declaration

Source position: fpcanvas.pp line 36

type TFPCanvasHelper = class(TPersistent)
protected
function GetAllocated; virtual; | GetAllocated returns True if the canvas is allocated (assigned)
procedure SetFlags(); virtual; | SetFlags - stores specified boolean values in index-nominated flags
function GetFlags(); virtual; | GetFlags - returns the boolean value of the specified flag
procedure CheckAllocated(); | CheckAllocated - check whether the canvas is allocated, and if ValueNeeded if True, raises an exception if not allocated
procedure SetFixedCanvas(); | SetFixedCanvas - specifies whether the canvas is to be fixed
procedure DoAllocateResources; virtual; | DoAllocateResources - procedure for allocating resources
procedure DoDeAllocateResources; virtual; | DoDeAllocateResources - procedure for deallocationg resources
procedure DoCopyProps(); virtual; | DoCopyProps - copies properties from another Canvas Helper
procedure SetFPColor(); virtual; | SetFPColor - specify the colour using the FreePascal list
procedure Changing; dynamic; | Changing - software emulation of a call to the OnChanging event
procedure Changed; dynamic; | Changed - software emulation of a call to the OnChange event
procedure Lock; | Lock the canvas so it can't be changed
procedure UnLock; | UnLock a previously locked canvas
public
constructor Create; virtual; | Create - constructor for TFPCanvasHelper: calls inherited Create then sets properties Canvas to nil, FixedCanvas and Allocated to False
destructor Destroy; override; | Destroy - destructor for TFPCanvasHelper: de-allocates resources then calls inherited Destroy
procedure AllocateResources(); | AllocateResources - prepare helper for use
procedure DeallocateResources; | DeallocateResources - free all resources used by this helper
property Allocated: Boolean; [r] | If True, then helper has been Allocated
property FixedCanvas: Boolean; [r] | FixedCanvas - properties cannot be changed when allocated
property Canvas: TFPCustomCanvas; [r] | Canvas for which the helper is allocated
property FPColor: TFPColor; [rw] | FPColor - colour of the helper
property OnChanging: TNotifyEvent; [rw] | OnChanging - event handler while change is occurring
property OnChange: TNotifyEvent; [rw] | OnChange - event handler when a change has occurred
property DelayAllocate: Boolean; [rw] | DelayAllocate - if True, then allocation is to be delayed
end;

Inheritance

TFPCanvasHelper

TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|

TPersistent
|

TObject


TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


ro | Allocated (TFPCanvasHelper)
ro | Canvas (TFPCanvasHelper)
 | DelayAllocate (TFPCanvasHelper)
ro | FixedCanvas (TFPCanvasHelper)
 | FPColor (TFPCanvasHelper)


TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | UnLock (TFPCanvasHelper)


TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCanvasHelper.Allocated

If True, then helper has been Allocated

Declaration

Source position: fpcanvas.pp line 70

public property TFPCanvasHelper.Allocated: Boolean
  read GetAllocated;


TFPCanvasHelper.AllocateResources

AllocateResources - prepare helper for use

Declaration

Source position: fpcanvas.pp line 66

public procedure TFPCanvasHelper.AllocateResources(

  ACanvas: TFPCustomCanvas;

  CanDelay: Boolean = true

);


TFPCanvasHelper.Canvas

Canvas for which the helper is allocated

Declaration

Source position: fpcanvas.pp line 74

public property TFPCanvasHelper.Canvas: TFPCustomCanvas
  read FCanvas;


TFPCanvasHelper.Changed

Changed - software emulation of a call to the OnChange event

Declaration

Source position: fpcanvas.pp line 59

protected procedure TFPCanvasHelper.Changed; dynamic;


TFPCanvasHelper.Changing

Changing - software emulation of a call to the OnChanging event

Declaration

Source position: fpcanvas.pp line 58

protected procedure TFPCanvasHelper.Changing; dynamic;


TFPCanvasHelper.CheckAllocated

CheckAllocated - check whether the canvas is allocated, and if ValueNeeded if True, raises an exception if not allocated

Declaration

Source position: fpcanvas.pp line 52

protected procedure TFPCanvasHelper.CheckAllocated(

  ValueNeeded: Boolean

);


TFPCanvasHelper.Create

Create - constructor for TFPCanvasHelper: calls inherited Create then sets properties Canvas to nil, FixedCanvas and Allocated to False

Declaration

Source position: fpcanvas.pp line 63

public constructor TFPCanvasHelper.Create; virtual;

See also

TObject.Create


TFPCanvasHelper.DeallocateResources

DeallocateResources - free all resources used by this helper

Declaration

Source position: fpcanvas.pp line 69

public procedure TFPCanvasHelper.DeallocateResources;


TFPCanvasHelper.DelayAllocate

DelayAllocate - if True, then allocation is to be delayed

Declaration

Source position: fpcanvas.pp line 79

public property TFPCanvasHelper.DelayAllocate: Boolean
  read FDelayAllocate
  write FDelayAllocate;


TFPCanvasHelper.Destroy

Destroy - destructor for TFPCanvasHelper: de-allocates resources then calls inherited Destroy

Declaration

Source position: fpcanvas.pp line 64

public destructor TFPCanvasHelper.Destroy; override;

See also

TPersistent.Destroy


TFPCanvasHelper.DoAllocateResources

DoAllocateResources - procedure for allocating resources

Declaration

Source position: fpcanvas.pp line 54

protected procedure TFPCanvasHelper.DoAllocateResources; virtual;


TFPCanvasHelper.DoCopyProps

DoCopyProps - copies properties from another Canvas Helper

Declaration

Source position: fpcanvas.pp line 56

protected procedure TFPCanvasHelper.DoCopyProps(

  From: TFPCanvasHelper

); virtual;


TFPCanvasHelper.DoDeAllocateResources

DoDeAllocateResources - procedure for deallocationg resources

Declaration

Source position: fpcanvas.pp line 55

protected procedure TFPCanvasHelper.DoDeAllocateResources; virtual;


TFPCanvasHelper.FixedCanvas

FixedCanvas - properties cannot be changed when allocated

Declaration

Source position: fpcanvas.pp line 72

public property TFPCanvasHelper.FixedCanvas: Boolean
  read FFixedCanvas;


TFPCanvasHelper.FPColor

FPColor - colour of the helper

Declaration

Source position: fpcanvas.pp line 76

public property TFPCanvasHelper.FPColor: TFPColor
  read FFPColor
  write SetFPColor;


TFPCanvasHelper.GetAllocated

GetAllocated returns True if the canvas is allocated (assigned)

Declaration

Source position: fpcanvas.pp line 49

protected function TFPCanvasHelper.GetAllocated: Boolean; virtual;


TFPCanvasHelper.GetFlags

GetFlags - returns the boolean value of the specified flag

Declaration

Source position: fpcanvas.pp line 51

protected function TFPCanvasHelper.GetFlags(

  index: Integer

):Boolean; virtual;


TFPCanvasHelper.Lock

Lock the canvas so it can't be changed

Declaration

Source position: fpcanvas.pp line 60

protected procedure TFPCanvasHelper.Lock;


TFPCanvasHelper.OnChange

OnChange - event handler when a change has occurred

Declaration

Source position: fpcanvas.pp line 78

public property TFPCanvasHelper.OnChange: TNotifyEvent
  read FOnChange
  write FOnChange;


TFPCanvasHelper.OnChanging

OnChanging - event handler while change is occurring

Declaration

Source position: fpcanvas.pp line 77

public property TFPCanvasHelper.OnChanging: TNotifyEvent
  read FOnChanging
  write FOnChanging;


TFPCanvasHelper.SetFixedCanvas

SetFixedCanvas - specifies whether the canvas is to be fixed

Declaration

Source position: fpcanvas.pp line 53

protected procedure TFPCanvasHelper.SetFixedCanvas(

  AValue: Boolean

);


TFPCanvasHelper.SetFlags

SetFlags - stores specified boolean values in index-nominated flags

Declaration

Source position: fpcanvas.pp line 50

protected procedure TFPCanvasHelper.SetFlags(

  index: Integer;

  AValue: Boolean

); virtual;


TFPCanvasHelper.SetFPColor

SetFPColor - specify the colour using the FreePascal list

Declaration

Source position: fpcanvas.pp line 57

protected procedure TFPCanvasHelper.SetFPColor(

  const AValue: TFPColor

); virtual;


TFPCanvasHelper.UnLock

UnLock a previously locked canvas

Declaration

Source position: fpcanvas.pp line 61

protected procedure TFPCanvasHelper.UnLock;


TFPCustomBrush

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomBrush - FreePascal base class for Brushes

Declaration

Source position: fpcanvas.pp line 139

type TFPCustomBrush = class(TFPCanvasHelper)
protected
procedure SetStyle(); virtual; | SetStyle - specifies the style for the Brush
procedure SetImage(); virtual; | SetImage - specifies the Image for use with the Brush (eg if BrushStyle is bsImage)
procedure DoCopyProps(); override; | DoCopyProps - copies properties from another Canvas Helper
public
function CopyBrush; | CopyBrush - returns a copy of the brush with all properties the same, but not allocated
property Style: TFPBrushStyle; [rw] | The Style for the current Brush
property Image: TFPCustomImage; [rw] | The Image to be used in the Brush (if Style is bsImage)
property Pattern: TBrushPattern; [rw] | The Pattern to use for the Brush (if Style is bsPattern)
end;

Inheritance

TFPCustomBrush | TFPCustomBrush - FreePascal base class for Brushes
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomBrush
 |  | Style
 |  | Image
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


ro | Allocated (TFPCanvasHelper)
ro | Canvas (TFPCanvasHelper)
 | DelayAllocate (TFPCanvasHelper)
ro | FixedCanvas (TFPCanvasHelper)
 | FPColor (TFPCanvasHelper)
 | Image (TFPCustomBrush)
 | Pattern (TFPCustomBrush)
 | Style (TFPCustomBrush)


TFPCustomBrush
pt | SetStyle
pt | SetImage
pt | DoCopyProps
 | CopyBrush
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyBrush (TFPCustomBrush)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomBrush)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetImage (TFPCustomBrush)
pt | SetStyle (TFPCustomBrush)
pt | UnLock (TFPCanvasHelper)


TFPCustomBrush
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomBrush.CopyBrush

CopyBrush - returns a copy of the brush with all properties the same, but not allocated

Declaration

Source position: fpcanvas.pp line 149

public function TFPCustomBrush.CopyBrush: TFPCustomBrush;


TFPCustomBrush.Image

The Image to be used in the Brush (if Style is bsImage)

Declaration

Source position: fpcanvas.pp line 151

public property TFPCustomBrush.Image: TFPCustomImage
  read FImage
  write SetImage;


TFPCustomBrush.Pattern

The Pattern to use for the Brush (if Style is bsPattern)

Declaration

Source position: fpcanvas.pp line 152

public property TFPCustomBrush.Pattern: TBrushPattern
  read FPattern
  write FPattern;


TFPCustomBrush.SetImage

SetImage - specifies the Image for use with the Brush (eg if BrushStyle is bsImage)

Declaration

Source position: fpcanvas.pp line 146

protected procedure TFPCustomBrush.SetImage(

  AValue: TFPCustomImage

); virtual;


TFPCustomBrush.SetStyle

SetStyle - specifies the style for the Brush

Declaration

Source position: fpcanvas.pp line 145

protected procedure TFPCustomBrush.SetStyle(

  AValue: TFPBrushStyle

); virtual;


TFPCustomBrush.Style

The Style for the current Brush

Declaration

Source position: fpcanvas.pp line 150

public property TFPCustomBrush.Style: TFPBrushStyle
  read FStyle
  write SetStyle;


TFPCustomBrushClass

TFPCustomBrushClass - class of TFPCustomBrush

Declaration

Source position: fpcanvas.pp line 154

type TFPCustomBrushClass = class of TFPCustomBrush;


TFPCustomCanvas

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomCanvas - FreePascal base class for Canvas

Declaration

Source position: fpcanvas.pp line 192

type TFPCustomCanvas = class(TPersistent)
protected
function DoCreateDefaultFont; virtual; abstract; | DoCreateDefaultFont - returns a newly created default Font
function DoCreateDefaultPen; virtual; abstract; | DoCreateDefaultPen - returns a newly created default Pen
function DoCreateDefaultBrush; virtual; abstract; | DoCreateDefaultBrush - returns a newly created default Brush
procedure SetFont(); virtual; | SetFont - specifies the Font to use
procedure SetBrush(); virtual; | SetBrush - specifies the Brush to use
procedure SetPen(); virtual; | SetPen - specifies the Pen to use
function DoAllowFont(); virtual; | DoAllowFont - returns True if specified Font is valid
function DoAllowPen(); virtual; | DoAllowPen - returns True if specified Pen is valid
function DoAllowBrush(); virtual; | DoAllowBrush - returns True if specified Brush is valid
procedure SetColor(); virtual; abstract; | SetColor - specifies colour at the given location
function GetColor(); virtual; abstract; | GetColor - finds the colour at the given location
procedure SetHeight(); virtual; abstract; | SetHeight -sspecifies Canvas height
function GetHeight; virtual; abstract; | GetHeight - returns the height of the Canvas
procedure SetWidth(); virtual; abstract; | SetWidth - specifies the width of the Canvas
function GetWidth; virtual; abstract; | GetWidth - returns the Width
function GetClipRect; virtual; | GetClipRect - returns the coordinates of the rectangle used for clipping
procedure SetClipRect(); virtual; | SetClipRect - specifies the rectangle to use for clipping
function GetClipping; virtual;
procedure SetClipping(); virtual;
procedure SetPenPos(); virtual; | SetPenPos - specifies the position of the Pen
procedure DoLockCanvas; virtual; | DoLockCanvas - method for locking the Canvas, making it impossible to change
procedure DoUnlockCanvas; virtual; | DoUnlockCanvas - method for unlocking a previously locked Canvas
procedure DoTextOut(); virtual; abstract; | DoTextOut - method for writing given text out at specified location
procedure DoGetTextSize(); virtual; abstract; | DoGetTextSize - method for finding the size (stored as w: width, h: height) of the given text
function DoGetTextHeight(); virtual; abstract; | DoGetTextHeight - returns the height of the given text
function DoGetTextWidth(); virtual; abstract; | DoGetTextWidth - returns the width of the given text
procedure DoRectangle(); virtual; abstract; | DoRectangle - method for drawing a rectangle in the given position
procedure DoRectangleFill(); virtual; abstract; | DoRectangleFill - method for filling a rectagle in the given location
procedure DoRectangleAndFill(); virtual; | DoRectangleAndFill - method for drawing a rectangle and filling it at the given location
procedure DoEllipseFill(); virtual; abstract; | DoEllipseFill - method for filing an ellipse at the given location
procedure DoEllipse(); virtual; abstract; | DoEllipse - method for drawing an ellipse at the given location
procedure DoEllipseAndFill(); virtual; | DoEllipseAndFill - method for drawing an ellipse and filling it at the given location
procedure DoPolygonFill(); virtual; abstract; | DoPolygonFill - method for filling a polygon at the given location (using supplied array of points)
procedure DoPolygon(); virtual; abstract; | DoPolygon - method for drawing a polygon using the given array of points
procedure DoPolygonAndFill(); virtual; | DoPolygonAndFill - method for drawing a polygon and filling it using the given array of points
procedure DoPolyline(); virtual; abstract; | DoPolyline - method for drawing a PolyLine uing the given array of points
procedure DoFloodFill(); virtual; abstract; | DoFloodFill - method for Flood-Filling an area strarting at the given location
procedure DoMoveTo(); virtual; | DoMoveTo - method to move the drawing cursor to the specified point
procedure DoLineTo(); virtual; | DoLineTo - method for drawing a line between the current cursor position and the specified point
procedure DoLine(); virtual; abstract; | DoLine - method for drawing a line between two specified points
procedure DoCopyRect(); virtual; abstract; | DoCopyRect - method to copy the source rectangle SourceRect to the specified position on another Canvas
procedure DoDraw(); virtual; abstract; | DoDraw - method to draw the nominated Image at the specified location
procedure CheckHelper(); virtual; | CheckHelper - method to ensure that a valid Helper has been called
procedure AddHelper(); | AddHelper - method to add a helper to the list
public
constructor create; | create - constructor for TFPCustomCanvas. Performs inherited Create, creates helpers, sets up default sizes and pen, brush and font
destructor destroy; override; | Destroy - destructor for TFPCustomCanvas: frees helpers and default pen, brush and font, then performs inherited Destroy
procedure LockCanvas; | LockCanvas, ensuring no changes can be made
procedure UnlockCanvas; | UnlockCanvas - frees a previously locked Canvas
function Locked; | Returns True if Canvas is Locked
function CreateFont; | CreateFont - returns a Font that has been created
function CreatePen; | CreatePen - returns a Pen that has been created
function CreateBrush; | CreateBrush - returns a Brush that has been created
procedure TextOut(); | Writes the Text string at the position X, Y on the canvas and leaves the pen at the end of the text
procedure GetTextSize(); | GetTextSize - finds the size (stored as w: width, h: height) of the specified text
function GetTextHeight(); | GetTextHeight - returns height of the specified text
function GetTextWidth(); | GetTextWidth - returns width of the specified text
procedure Ellipse(); | Ellipse - method to draw an ellipse to fit the given rectangle
procedure EllipseC(); | EllipseC - method to draw an ellipse given starting coordinates and radii for x- and y- directions
procedure Polygon(); | Method to draw a Polygon, ie a closed figure with the last point joined to the first
procedure Polyline(); | Method to draw a Polyline, ie a figure connecting the points in sequence, but not necessarily producing a closed figure
procedure Rectangle(); | Method to draw a Rectangle within the specified bounds, or given the limiting coordinates
procedure FloodFill(); | Method to FloodFill an area with colour, starting at the given point
procedure Clear; | Method to Clear the Canvas
procedure MoveTo(); | Moves cursor to new position X1, Y1 without drawing anything
procedure LineTo(); | LineTo - draw a line between the current Pen position and the specified point
procedure Line(); | Draw a Line between the first and second points
procedure CopyRect(); | CopyRect - copies a rectangle from SourceRect to the specified position on a nominated Canvas
procedure Draw(); | Draw the nominated Image at the specified location
procedure StretchDraw(); | StretchDraw - steretch out the image being drawn to fit the supplied location and size
procedure Erase; virtual; | Erase - clear away the drawing
property LockCount: Integer; [r]
property Font: TFPCustomFont; [rw] | The Font to be used for text in this Canvas
property Pen: TFPCustomPen; [rw] | The Pen to be used for writing in this Canvas
property Brush: TFPCustomBrush; [rw] | The Brush for the current Canvas
property Interpolation: TFPCustomInterpolation; [rw] | The Interpolation algorithm to be used for connecting the indeterminate areas between specified points in an Image
property Colors: TFPColor; [rw] | The Colors to be used for this Canvas
property ClipRect: TRect; [rw] | ClipRect - the rectangle to be used for clipping
property Clipping: Boolean; [rw] | If True, then Clippingis being applied to images on this Canvas
property PenPos: TPoint; [rw] | PenPos - the current position of the Pen
property Height: Integer; [rw] | The Height of the Canvas
property Width: Integer; [rw] | The Width of the Canvas
property ManageResources: Boolean; [rw] | ManageResources - if True, then resource management is being used
end;

Inheritance

TFPCustomCanvas

TFPCustomCanvas - FreePascal base class for Canvas
|

TPersistent
|

TObject

Description

TFPCustomCanvas - FreePascal base class for Canvas

Many of the methods are virtual and/or abstract; there is often no supplied code for the method, but the entries act as place-holders for programmers of descendant components to provide overriding methods


TFPCustomCanvas
 | ro | LockCount
 |  | Font
 |  | Pen
 |  | Brush
 |  | Interpolation
 |  | Colors
 |  | ClipRect
 |  | Clipping
 |  | PenPos
 |  | Height
 |  | Width
 |  | ManageResources
TPersistent


 | Brush (TFPCustomCanvas)
 | Clipping (TFPCustomCanvas)
 | ClipRect (TFPCustomCanvas)
 | Colors (TFPCustomCanvas)
 | Font (TFPCustomCanvas)
 | Height (TFPCustomCanvas)
 | Interpolation (TFPCustomCanvas)
ro | LockCount (TFPCustomCanvas)
 | ManageResources (TFPCustomCanvas)
 | Pen (TFPCustomCanvas)
 | PenPos (TFPCustomCanvas)
 | Width (TFPCustomCanvas)


TFPCustomCanvas
pt | DoCreateDefaultFont
pt | DoCreateDefaultPen
pt | DoCreateDefaultBrush
pt | SetFont
pt | SetBrush
pt | SetPen
pt | DoAllowFont
pt | DoAllowPen
pt | DoAllowBrush
pt | SetColor
pt | GetColor
pt | SetHeight
pt | GetHeight
pt | SetWidth
pt | GetWidth
pt | GetClipRect
pt | SetClipRect
pt | GetClipping
pt | SetClipping
pt | SetPenPos
pt | DoLockCanvas
pt | DoUnlockCanvas
pt | DoTextOut
pt | DoGetTextSize
pt | DoGetTextHeight
pt | DoGetTextWidth
pt | DoRectangle
pt | DoRectangleFill
pt | DoRectangleAndFill
pt | DoEllipseFill
pt | DoEllipse
pt | DoEllipseAndFill
pt | DoPolygonFill
pt | DoPolygon
pt | DoPolygonAndFill
pt | DoPolyline
pt | DoFloodFill
pt | DoMoveTo
pt | DoLineTo
pt | DoLine
pt | DoCopyRect
pt | DoDraw
pt | CheckHelper
pt | AddHelper
 | create
 | destroy
 | LockCanvas
 | UnlockCanvas
 | Locked
 | CreateFont
 | CreatePen
 | CreateBrush
 | TextOut
 | GetTextSize
 | GetTextHeight
 | GetTextWidth
 | Ellipse
 | EllipseC
 | Polygon
 | Polyline
 | Rectangle
 | FloodFill
 | Clear
 | MoveTo
 | LineTo
 | Line
 | CopyRect
 | Draw
 | StretchDraw
 | Erase
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


pt | AddHelper (TFPCustomCanvas)
 | Assign (TPersistent)
 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | CheckHelper (TFPCustomCanvas)
 | Clear (TFPCustomCanvas)
 | CopyRect (TFPCustomCanvas)
 | create (TFPCustomCanvas)
 | CreateBrush (TFPCustomCanvas)
 | CreateFont (TFPCustomCanvas)
 | CreatePen (TFPCustomCanvas)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | destroy (TFPCustomCanvas)
pt | DoAllowBrush (TFPCustomCanvas)
pt | DoAllowFont (TFPCustomCanvas)
pt | DoAllowPen (TFPCustomCanvas)
pt | DoCopyRect (TFPCustomCanvas)
pt | DoCreateDefaultBrush (TFPCustomCanvas)
pt | DoCreateDefaultFont (TFPCustomCanvas)
pt | DoCreateDefaultPen (TFPCustomCanvas)
pt | DoDraw (TFPCustomCanvas)
pt | DoEllipse (TFPCustomCanvas)
pt | DoEllipseAndFill (TFPCustomCanvas)
pt | DoEllipseFill (TFPCustomCanvas)
pt | DoFloodFill (TFPCustomCanvas)
pt | DoGetTextHeight (TFPCustomCanvas)
pt | DoGetTextSize (TFPCustomCanvas)
pt | DoGetTextWidth (TFPCustomCanvas)
pt | DoLine (TFPCustomCanvas)
pt | DoLineTo (TFPCustomCanvas)
pt | DoLockCanvas (TFPCustomCanvas)
pt | DoMoveTo (TFPCustomCanvas)
pt | DoPolygon (TFPCustomCanvas)
pt | DoPolygonAndFill (TFPCustomCanvas)
pt | DoPolygonFill (TFPCustomCanvas)
pt | DoPolyline (TFPCustomCanvas)
pt | DoRectangle (TFPCustomCanvas)
pt | DoRectangleAndFill (TFPCustomCanvas)
pt | DoRectangleFill (TFPCustomCanvas)
pt | DoTextOut (TFPCustomCanvas)
pt | DoUnlockCanvas (TFPCustomCanvas)
 | Draw (TFPCustomCanvas)
 | Ellipse (TFPCustomCanvas)
 | EllipseC (TFPCustomCanvas)
 | Erase (TFPCustomCanvas)
 | FloodFill (TFPCustomCanvas)
pt | GetClipping (TFPCustomCanvas)
pt | GetClipRect (TFPCustomCanvas)
pt | GetColor (TFPCustomCanvas)
pt | GetHeight (TFPCustomCanvas)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
 | GetTextHeight (TFPCustomCanvas)
 | GetTextSize (TFPCustomCanvas)
 | GetTextWidth (TFPCustomCanvas)
pt | GetWidth (TFPCustomCanvas)
 | Line (TFPCustomCanvas)
 | LineTo (TFPCustomCanvas)
 | LockCanvas (TFPCustomCanvas)
 | Locked (TFPCustomCanvas)
 | MoveTo (TFPCustomCanvas)
 | Polygon (TFPCustomCanvas)
 | Polyline (TFPCustomCanvas)
 | Rectangle (TFPCustomCanvas)
pt | SetBrush (TFPCustomCanvas)
pt | SetClipping (TFPCustomCanvas)
pt | SetClipRect (TFPCustomCanvas)
pt | SetColor (TFPCustomCanvas)
pt | SetFont (TFPCustomCanvas)
pt | SetHeight (TFPCustomCanvas)
pt | SetPen (TFPCustomCanvas)
pt | SetPenPos (TFPCustomCanvas)
pt | SetWidth (TFPCustomCanvas)
 | StretchDraw (TFPCustomCanvas)
 | TextOut (TFPCustomCanvas)
 | UnlockCanvas (TFPCustomCanvas)


TFPCustomCanvas

TPersistent


TFPCustomCanvas.AddHelper

AddHelper - method to add a helper to the list

Declaration

Source position: fpcanvas.pp line 262

protected procedure TFPCustomCanvas.AddHelper(

  AHelper: TFPCanvasHelper

);


TFPCustomCanvas.Brush

The Brush for the current Canvas

Declaration

Source position: fpcanvas.pp line 305

public property TFPCustomCanvas.Brush: TFPCustomBrush
  read GetBrush
  write SetBrush;


TFPCustomCanvas.CheckHelper

CheckHelper - method to ensure that a valid Helper has been called

Declaration

Source position: fpcanvas.pp line 261

protected procedure TFPCustomCanvas.CheckHelper(

  AHelper: TFPCanvasHelper

); virtual;


TFPCustomCanvas.Clear

Method to Clear the Canvas

Declaration

Source position: fpcanvas.pp line 287

public procedure TFPCustomCanvas.Clear;


TFPCustomCanvas.Clipping

If True, then Clippingis being applied to images on this Canvas

Declaration

Source position: fpcanvas.pp line 309

public property TFPCustomCanvas.Clipping: Boolean
  read GetClipping
  write SetClipping;


TFPCustomCanvas.ClipRect

ClipRect - the rectangle to be used for clipping

Declaration

Source position: fpcanvas.pp line 308

public property TFPCustomCanvas.ClipRect: TRect
  read GetClipRect
  write SetClipRect;


TFPCustomCanvas.Colors

The Colors to be used for this Canvas

Declaration

Source position: fpcanvas.pp line 307

public property TFPCustomCanvas.Colors: TFPColor
  read GetColor
  write SetColor;


TFPCustomCanvas.CopyRect

CopyRect - copies a rectangle from SourceRect to the specified position on a nominated Canvas

Declaration

Source position: fpcanvas.pp line 297

public procedure TFPCustomCanvas.CopyRect(

  x: Integer;

  y: Integer;

  canvas: TFPCustomCanvas;

  SourceRect: TRect

);


TFPCustomCanvas.create

create - constructor for TFPCustomCanvas. Performs inherited Create, creates helpers, sets up default sizes and pen, brush and font

Declaration

Source position: fpcanvas.pp line 264

public constructor TFPCustomCanvas.create;

Description

create - constructor for TFPCustomCanvas. Performs inherited Create, creates helpers, sets up default sizes and pen, brush and font

Overrides ancestor constructor, and may be overridden by descendants

See also

TObject.Create


TFPCustomCanvas.CreateBrush

CreateBrush - returns a Brush that has been created

Declaration

Source position: fpcanvas.pp line 271

public function TFPCustomCanvas.CreateBrush: TFPCustomBrush;


TFPCustomCanvas.CreateFont

CreateFont - returns a Font that has been created

Declaration

Source position: fpcanvas.pp line 269

public function TFPCustomCanvas.CreateFont: TFPCustomFont;


TFPCustomCanvas.CreatePen

CreatePen - returns a Pen that has been created

Declaration

Source position: fpcanvas.pp line 270

public function TFPCustomCanvas.CreatePen: TFPCustomPen;


TFPCustomCanvas.destroy

Destroy - destructor for TFPCustomCanvas: frees helpers and default pen, brush and font, then performs inherited Destroy

Declaration

Source position: fpcanvas.pp line 265

public destructor TFPCustomCanvas.destroy; override;

Description

Destroy - destructor for TFPCustomCanvas: frees helpers and default pen, brush and font, then performs inherited Destroy

Overrides ancestor destructor; may be overridden by descendants

See also

TPersistent.Destroy


TFPCustomCanvas.DoAllowBrush

DoAllowBrush - returns True if specified Brush is valid

Declaration

Source position: fpcanvas.pp line 227

protected function TFPCustomCanvas.DoAllowBrush(

  ABrush: TFPCustomBrush

):Boolean; virtual;


TFPCustomCanvas.DoAllowFont

DoAllowFont - returns True if specified Font is valid

Declaration

Source position: fpcanvas.pp line 225

protected function TFPCustomCanvas.DoAllowFont(

  AFont: TFPCustomFont

):Boolean; virtual;


TFPCustomCanvas.DoAllowPen

DoAllowPen - returns True if specified Pen is valid

Declaration

Source position: fpcanvas.pp line 226

protected function TFPCustomCanvas.DoAllowPen(

  APen: TFPCustomPen

):Boolean; virtual;


TFPCustomCanvas.DoCopyRect

DoCopyRect - method to copy the source rectangle SourceRect to the specified position on another Canvas

Declaration

Source position: fpcanvas.pp line 259

protected procedure TFPCustomCanvas.DoCopyRect(

  x: Integer;

  y: Integer;

  canvas: TFPCustomCanvas;

  const SourceRect: TRect

); virtual; abstract;


TFPCustomCanvas.DoCreateDefaultBrush

DoCreateDefaultBrush - returns a newly created default Brush

Declaration

Source position: fpcanvas.pp line 221

protected function TFPCustomCanvas.DoCreateDefaultBrush: TFPCustomBrush; virtual; abstract;


TFPCustomCanvas.DoCreateDefaultFont

DoCreateDefaultFont - returns a newly created default Font

Declaration

Source position: fpcanvas.pp line 219

protected function TFPCustomCanvas.DoCreateDefaultFont: TFPCustomFont; virtual; abstract;


TFPCustomCanvas.DoCreateDefaultPen

DoCreateDefaultPen - returns a newly created default Pen

Declaration

Source position: fpcanvas.pp line 220

protected function TFPCustomCanvas.DoCreateDefaultPen: TFPCustomPen; virtual; abstract;


TFPCustomCanvas.DoDraw

DoDraw - method to draw the nominated Image at the specified location

Declaration

Source position: fpcanvas.pp line 260

protected procedure TFPCustomCanvas.DoDraw(

  x: Integer;

  y: Integer;

  const image: TFPCustomImage

); virtual; abstract;


TFPCustomCanvas.DoEllipse

DoEllipse - method for drawing an ellipse at the given location

Declaration

Source position: fpcanvas.pp line 249

protected procedure TFPCustomCanvas.DoEllipse(

  const Bounds: TRect

); virtual; abstract;


TFPCustomCanvas.DoEllipseAndFill

DoEllipseAndFill - method for drawing an ellipse and filling it at the given location

Declaration

Source position: fpcanvas.pp line 250

protected procedure TFPCustomCanvas.DoEllipseAndFill(

  const Bounds: TRect

); virtual;


TFPCustomCanvas.DoEllipseFill

DoEllipseFill - method for filing an ellipse at the given location

Declaration

Source position: fpcanvas.pp line 248

protected procedure TFPCustomCanvas.DoEllipseFill(

  const Bounds: TRect

); virtual; abstract;


TFPCustomCanvas.DoFloodFill

DoFloodFill - method for Flood-Filling an area strarting at the given location

Declaration

Source position: fpcanvas.pp line 255

protected procedure TFPCustomCanvas.DoFloodFill(

  x: Integer;

  y: Integer

); virtual; abstract;


TFPCustomCanvas.DoGetTextHeight

DoGetTextHeight - returns the height of the given text

Declaration

Source position: fpcanvas.pp line 243

protected function TFPCustomCanvas.DoGetTextHeight(

  text: String

):Integer; virtual; abstract;


TFPCustomCanvas.DoGetTextSize

DoGetTextSize - method for finding the size (stored as w: width, h: height) of the given text

Declaration

Source position: fpcanvas.pp line 242

protected procedure TFPCustomCanvas.DoGetTextSize(

  text: String;

  var w: Integer;

  var h: Integer

); virtual; abstract;


TFPCustomCanvas.DoGetTextWidth

DoGetTextWidth - returns the width of the given text

Declaration

Source position: fpcanvas.pp line 244

protected function TFPCustomCanvas.DoGetTextWidth(

  text: String

):Integer; virtual; abstract;


TFPCustomCanvas.DoLine

DoLine - method for drawing a line between two specified points

Declaration

Source position: fpcanvas.pp line 258

protected procedure TFPCustomCanvas.DoLine(

  x1: Integer;

  y1: Integer;

  x2: Integer;

  y2: Integer

); virtual; abstract;


TFPCustomCanvas.DoLineTo

DoLineTo - method for drawing a line between the current cursor position and the specified point

Declaration

Source position: fpcanvas.pp line 257

protected procedure TFPCustomCanvas.DoLineTo(

  x: Integer;

  y: Integer

); virtual;


TFPCustomCanvas.DoLockCanvas

DoLockCanvas - method for locking the Canvas, making it impossible to change

Declaration

Source position: fpcanvas.pp line 239

protected procedure TFPCustomCanvas.DoLockCanvas; virtual;


TFPCustomCanvas.DoMoveTo

DoMoveTo - method to move the drawing cursor to the specified point

Declaration

Source position: fpcanvas.pp line 256

protected procedure TFPCustomCanvas.DoMoveTo(

  x: Integer;

  y: Integer

); virtual;


TFPCustomCanvas.DoPolygon

DoPolygon - method for drawing a polygon using the given array of points

Declaration

Source position: fpcanvas.pp line 252

protected procedure TFPCustomCanvas.DoPolygon(

  const points: array of TPoint

); virtual; abstract;


TFPCustomCanvas.DoPolygonAndFill

DoPolygonAndFill - method for drawing a polygon and filling it using the given array of points

Declaration

Source position: fpcanvas.pp line 253

protected procedure TFPCustomCanvas.DoPolygonAndFill(

  const points: array of TPoint

); virtual;


TFPCustomCanvas.DoPolygonFill

DoPolygonFill - method for filling a polygon at the given location (using supplied array of points)

Declaration

Source position: fpcanvas.pp line 251

protected procedure TFPCustomCanvas.DoPolygonFill(

  const points: array of TPoint

); virtual; abstract;


TFPCustomCanvas.DoPolyline

DoPolyline - method for drawing a PolyLine uing the given array of points

Declaration

Source position: fpcanvas.pp line 254

protected procedure TFPCustomCanvas.DoPolyline(

  const points: array of TPoint

); virtual; abstract;


TFPCustomCanvas.DoRectangle

DoRectangle - method for drawing a rectangle in the given position

Declaration

Source position: fpcanvas.pp line 245

protected procedure TFPCustomCanvas.DoRectangle(

  const Bounds: TRect

); virtual; abstract;


TFPCustomCanvas.DoRectangleAndFill

DoRectangleAndFill - method for drawing a rectangle and filling it at the given location

Declaration

Source position: fpcanvas.pp line 247

protected procedure TFPCustomCanvas.DoRectangleAndFill(

  const Bounds: TRect

); virtual;


TFPCustomCanvas.DoRectangleFill

DoRectangleFill - method for filling a rectagle in the given location

Declaration

Source position: fpcanvas.pp line 246

protected procedure TFPCustomCanvas.DoRectangleFill(

  const Bounds: TRect

); virtual; abstract;


TFPCustomCanvas.DoTextOut

DoTextOut - method for writing given text out at specified location

Declaration

Source position: fpcanvas.pp line 241

protected procedure TFPCustomCanvas.DoTextOut(

  x: Integer;

  y: Integer;

  text: String

); virtual; abstract;


TFPCustomCanvas.DoUnlockCanvas

DoUnlockCanvas - method for unlocking a previously locked Canvas

Declaration

Source position: fpcanvas.pp line 240

protected procedure TFPCustomCanvas.DoUnlockCanvas; virtual;


TFPCustomCanvas.Draw

Draw the nominated Image at the specified location

Declaration

Source position: fpcanvas.pp line 298

public procedure TFPCustomCanvas.Draw(

  x: Integer;

  y: Integer;

  image: TFPCustomImage

);


TFPCustomCanvas.Ellipse

Ellipse - method to draw an ellipse to fit the given rectangle

Declaration

Source position: line 0

public procedure TFPCustomCanvas.Ellipse(

  const Bounds: TRect

);

procedure TFPCustomCanvas.Ellipse(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

);


TFPCustomCanvas.EllipseC

EllipseC - method to draw an ellipse given starting coordinates and radii for x- and y- directions

Declaration

Source position: fpcanvas.pp line 280

public procedure TFPCustomCanvas.EllipseC(

  x: Integer;

  y: Integer;

  rx: LongWord;

  ry: LongWord

);


TFPCustomCanvas.Erase

Erase - clear away the drawing

Declaration

Source position: fpcanvas.pp line 300

public procedure TFPCustomCanvas.Erase; virtual;


TFPCustomCanvas.FloodFill

Method to FloodFill an area with colour, starting at the given point

Declaration

Source position: fpcanvas.pp line 286

public procedure TFPCustomCanvas.FloodFill(

  x: Integer;

  y: Integer

);


TFPCustomCanvas.Font

The Font to be used for text in this Canvas

Declaration

Source position: fpcanvas.pp line 303

public property TFPCustomCanvas.Font: TFPCustomFont
  read GetFont
  write SetFont;


TFPCustomCanvas.GetClipping

Declaration

Source position: fpcanvas.pp line 236

protected function TFPCustomCanvas.GetClipping: Boolean; virtual;


TFPCustomCanvas.GetClipRect

GetClipRect - returns the coordinates of the rectangle used for clipping

Declaration

Source position: fpcanvas.pp line 234

protected function TFPCustomCanvas.GetClipRect: TRect; virtual;


TFPCustomCanvas.GetColor

GetColor - finds the colour at the given location

Declaration

Source position: fpcanvas.pp line 229

protected function TFPCustomCanvas.GetColor(

  x: Integer;

  y: Integer

):TFPColor; virtual; abstract;


TFPCustomCanvas.GetHeight

GetHeight - returns the height of the Canvas

Declaration

Source position: fpcanvas.pp line 231

protected function TFPCustomCanvas.GetHeight: Integer; virtual; abstract;


TFPCustomCanvas.GetTextHeight

GetTextHeight - returns height of the specified text

Declaration

Source position: fpcanvas.pp line 275

public function TFPCustomCanvas.GetTextHeight(

  text: String

):Integer;


TFPCustomCanvas.GetTextSize

GetTextSize - finds the size (stored as w: width, h: height) of the specified text

Declaration

Source position: fpcanvas.pp line 274

public procedure TFPCustomCanvas.GetTextSize(

  text: String;

  var w: Integer;

  var h: Integer

);


TFPCustomCanvas.GetTextWidth

GetTextWidth - returns width of the specified text

Declaration

Source position: fpcanvas.pp line 276

public function TFPCustomCanvas.GetTextWidth(

  text: String

):Integer;


TFPCustomCanvas.GetWidth

GetWidth - returns the Width

Declaration

Source position: fpcanvas.pp line 233

protected function TFPCustomCanvas.GetWidth: Integer; virtual; abstract;


TFPCustomCanvas.Height

The Height of the Canvas

Declaration

Source position: fpcanvas.pp line 311

public property TFPCustomCanvas.Height: Integer
  read GetHeight
  write SetHeight;


TFPCustomCanvas.Interpolation

The Interpolation algorithm to be used for connecting the indeterminate areas between specified points in an Image

Declaration

Source position: fpcanvas.pp line 306

public property TFPCustomCanvas.Interpolation: TFPCustomInterpolation
  read FInterpolation
  write FInterpolation;


TFPCustomCanvas.Line

Draw a Line between the first and second points

Declaration

Source position: line 0

public procedure TFPCustomCanvas.Line(

  x1: Integer;

  y1: Integer;

  x2: Integer;

  y2: Integer

);

procedure TFPCustomCanvas.Line(

  const p1: TPoint;

  const p2: TPoint

);

procedure TFPCustomCanvas.Line(

  const points: TRect

);


TFPCustomCanvas.LineTo

LineTo - draw a line between the current Pen position and the specified point

Declaration

Source position: line 0

public procedure TFPCustomCanvas.LineTo(

  x: Integer;

  y: Integer

);

procedure TFPCustomCanvas.LineTo(

  p: TPoint

);


TFPCustomCanvas.LockCanvas

LockCanvas, ensuring no changes can be made

Declaration

Source position: fpcanvas.pp line 266

public procedure TFPCustomCanvas.LockCanvas;


TFPCustomCanvas.LockCount

Declaration

Source position: fpcanvas.pp line 302

public property TFPCustomCanvas.LockCount: Integer
  read FLocks;


TFPCustomCanvas.Locked

Returns True if Canvas is Locked

Declaration

Source position: fpcanvas.pp line 268

public function TFPCustomCanvas.Locked: Boolean;


TFPCustomCanvas.ManageResources

ManageResources - if True, then resource management is being used

Declaration

Source position: fpcanvas.pp line 313

public property TFPCustomCanvas.ManageResources: Boolean
  read FManageResources
  write FManageResources;


TFPCustomCanvas.Pen

The Pen to be used for writing in this Canvas

Declaration

Source position: fpcanvas.pp line 304

public property TFPCustomCanvas.Pen: TFPCustomPen
  read GetPen
  write SetPen;


TFPCustomCanvas.PenPos

PenPos - the current position of the Pen

Declaration

Source position: fpcanvas.pp line 310

public property TFPCustomCanvas.PenPos: TPoint
  read FPenPos
  write SetPenPos;


TFPCustomCanvas.Polygon

Method to draw a Polygon, ie a closed figure with the last point joined to the first

Declaration

Source position: fpcanvas.pp line 281

public procedure TFPCustomCanvas.Polygon(

  const points: array of TPoint

);


TFPCustomCanvas.Polyline

Method to draw a Polyline, ie a figure connecting the points in sequence, but not necessarily producing a closed figure

Declaration

Source position: fpcanvas.pp line 282

public procedure TFPCustomCanvas.Polyline(

  const points: array of TPoint

);


TFPCustomCanvas.Rectangle

Method to draw a Rectangle within the specified bounds, or given the limiting coordinates

Declaration

Source position: line 0

public procedure TFPCustomCanvas.Rectangle(

  const Bounds: TRect

);

procedure TFPCustomCanvas.Rectangle(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

);


TFPCustomCanvas.SetBrush

SetBrush - specifies the Brush to use

Declaration

Source position: fpcanvas.pp line 223

protected procedure TFPCustomCanvas.SetBrush(

  AValue: TFPCustomBrush

); virtual;


TFPCustomCanvas.SetClipping

Declaration

Source position: fpcanvas.pp line 237

protected procedure TFPCustomCanvas.SetClipping(

  const AValue: Boolean

); virtual;


TFPCustomCanvas.SetClipRect

SetClipRect - specifies the rectangle to use for clipping

Declaration

Source position: fpcanvas.pp line 235

protected procedure TFPCustomCanvas.SetClipRect(

  const AValue: TRect

); virtual;


TFPCustomCanvas.SetColor

SetColor - specifies colour at the given location

Declaration

Source position: fpcanvas.pp line 228

protected procedure TFPCustomCanvas.SetColor(

  x: Integer;

  y: Integer;

  const Value: TFPColor

); virtual; abstract;


TFPCustomCanvas.SetFont

SetFont - specifies the Font to use

Declaration

Source position: fpcanvas.pp line 222

protected procedure TFPCustomCanvas.SetFont(

  AValue: TFPCustomFont

); virtual;


TFPCustomCanvas.SetHeight

SetHeight -sspecifies Canvas height

Declaration

Source position: fpcanvas.pp line 230

protected procedure TFPCustomCanvas.SetHeight(

  AValue: Integer

); virtual; abstract;


TFPCustomCanvas.SetPen

SetPen - specifies the Pen to use

Declaration

Source position: fpcanvas.pp line 224

protected procedure TFPCustomCanvas.SetPen(

  AValue: TFPCustomPen

); virtual;


TFPCustomCanvas.SetPenPos

SetPenPos - specifies the position of the Pen

Declaration

Source position: fpcanvas.pp line 238

protected procedure TFPCustomCanvas.SetPenPos(

  const AValue: TPoint

); virtual;


TFPCustomCanvas.SetWidth

SetWidth - specifies the width of the Canvas

Declaration

Source position: fpcanvas.pp line 232

protected procedure TFPCustomCanvas.SetWidth(

  AValue: Integer

); virtual; abstract;


TFPCustomCanvas.StretchDraw

StretchDraw - steretch out the image being drawn to fit the supplied location and size

Declaration

Source position: fpcanvas.pp line 299

public procedure TFPCustomCanvas.StretchDraw(

  x: Integer;

  y: Integer;

  w: Integer;

  h: Integer;

  source: TFPCustomImage

);


TFPCustomCanvas.TextOut

Writes the Text string at the position X, Y on the canvas and leaves the pen at the end of the text

Declaration

Source position: fpcanvas.pp line 273

public procedure TFPCustomCanvas.TextOut(

  x: Integer;

  y: Integer;

  text: String

);


TFPCustomCanvas.UnlockCanvas

UnlockCanvas - frees a previously locked Canvas

Declaration

Source position: fpcanvas.pp line 267

public procedure TFPCustomCanvas.UnlockCanvas;


TFPCustomCanvas.Width

The Width of the Canvas

Declaration

Source position: fpcanvas.pp line 312

public property TFPCustomCanvas.Width: Integer
  read GetWidth
  write SetWidth;


TFPCustomDrawBrush

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomDrawBrush - base class for brush used for drawing

Declaration

Source position: fpcanvas.pp line 348

type TFPCustomDrawBrush = class(TFPCustomBrush)
public
procedure DoRectangle(); virtual; abstract; | DoRectangle - draws a rectangle within the given bounds
procedure DoEllipse(); virtual; abstract; | DoEllipse - draws an elipse to fit the given bounds
procedure DoFloodFill(); virtual; abstract; | DoFloodFill - Fllod-Fill an area with colour, starting at the given point
procedure DoPolygon(); virtual; abstract; | DoPolygon - produce a closed Polygon using the given array of points
end;

Inheritance

TFPCustomDrawBrush | TFPCustomDrawBrush - base class for brush used for drawing
|
TFPCustomBrush | TFPCustomBrush - FreePascal base class for Brushes
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomDrawBrush
TFPCustomBrush
 |  | Style
 |  | Image
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPCustomDrawBrush
 | DoRectangle
 | DoEllipse
 | DoFloodFill
 | DoPolygon
TFPCustomBrush
pt | SetStyle
pt | SetImage
pt | DoCopyProps
 | CopyBrush
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyBrush (TFPCustomBrush)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomBrush)
pt | DoDeAllocateResources (TFPCanvasHelper)
 | DoEllipse (TFPCustomDrawBrush)
 | DoFloodFill (TFPCustomDrawBrush)
 | DoPolygon (TFPCustomDrawBrush)
 | DoRectangle (TFPCustomDrawBrush)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetImage (TFPCustomBrush)
pt | SetStyle (TFPCustomBrush)
pt | UnLock (TFPCanvasHelper)


TFPCustomDrawBrush
TFPCustomBrush
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomDrawBrush.DoEllipse

DoEllipse - draws an elipse to fit the given bounds

Declaration

Source position: fpcanvas.pp line 356

public procedure TFPCustomDrawBrush.DoEllipse(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

); virtual; abstract;


TFPCustomDrawBrush.DoFloodFill

DoFloodFill - Fllod-Fill an area with colour, starting at the given point

Declaration

Source position: fpcanvas.pp line 357

public procedure TFPCustomDrawBrush.DoFloodFill(

  x: Integer;

  y: Integer

); virtual; abstract;


TFPCustomDrawBrush.DoPolygon

DoPolygon - produce a closed Polygon using the given array of points

Declaration

Source position: fpcanvas.pp line 358

public procedure TFPCustomDrawBrush.DoPolygon(

  const points: array of TPoint

); virtual; abstract;


TFPCustomDrawBrush.DoRectangle

DoRectangle - draws a rectangle within the given bounds

Declaration

Source position: fpcanvas.pp line 355

public procedure TFPCustomDrawBrush.DoRectangle(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

); virtual; abstract;


TFPCustomDrawFont

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomDrawFont - base class for drawing fonts

Declaration

Source position: fpcanvas.pp line 316

type TFPCustomDrawFont = class(TFPCustomFont)
protected
procedure DoDrawText(); virtual; abstract; | DoDrawText - method for drawing text
procedure DoGetTextSize(); virtual; abstract; | DoGetTextSize - method for finding size of text
function DoGetTextHeight(); virtual; abstract; | DoGetTextHeight - returns height of text
function DoGetTextWidth(); virtual; abstract; | DoGetTextWidth - returns width of text
end;

Inheritance

TFPCustomDrawFont | TFPCustomDrawFont - base class for drawing fonts
|
TFPCustomFont | TFPCustomFont - FreePascal base class for Fonts
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomDrawFont
TFPCustomFont
 |  | Name
 |  | Size
 | ro | Bold
 | ro | Italic
 | ro | Underline
 | ro | StrikeTrough
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


ro | Allocated (TFPCanvasHelper)
ro | Bold (TFPCustomFont)
ro | Canvas (TFPCanvasHelper)
 | DelayAllocate (TFPCanvasHelper)
ro | FixedCanvas (TFPCanvasHelper)
 | FPColor (TFPCanvasHelper)
ro | Italic (TFPCustomFont)
 | Name (TFPCustomFont)
 | Size (TFPCustomFont)
ro | StrikeTrough (TFPCustomFont)
ro | Underline (TFPCustomFont)


TFPCustomDrawFont
pt | DoDrawText
pt | DoGetTextSize
pt | DoGetTextHeight
pt | DoGetTextWidth
TFPCustomFont
pt | DoCopyProps
pt | SetName
pt | SetSize
 | CopyFont
 | GetTextSize
 | GetTextHeight
 | GetTextWidth
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyFont (TFPCustomFont)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomFont)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | DoDrawText (TFPCustomDrawFont)
pt | DoGetTextHeight (TFPCustomDrawFont)
pt | DoGetTextSize (TFPCustomDrawFont)
pt | DoGetTextWidth (TFPCustomDrawFont)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
 | GetTextHeight (TFPCustomFont)
 | GetTextSize (TFPCustomFont)
 | GetTextWidth (TFPCustomFont)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetName (TFPCustomFont)
pt | SetSize (TFPCustomFont)
pt | UnLock (TFPCanvasHelper)


TFPCustomDrawFont
TFPCustomFont
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomDrawFont.DoDrawText

DoDrawText - method for drawing text

Declaration

Source position: fpcanvas.pp line 323

protected procedure TFPCustomDrawFont.DoDrawText(

  x: Integer;

  y: Integer;

  text: String

); virtual; abstract;


TFPCustomDrawFont.DoGetTextHeight

DoGetTextHeight - returns height of text

Declaration

Source position: fpcanvas.pp line 325

protected function TFPCustomDrawFont.DoGetTextHeight(

  text: String

):Integer; virtual; abstract;


TFPCustomDrawFont.DoGetTextSize

DoGetTextSize - method for finding size of text

Declaration

Source position: fpcanvas.pp line 324

protected procedure TFPCustomDrawFont.DoGetTextSize(

  text: String;

  var w: Integer;

  var h: Integer

); virtual; abstract;


TFPCustomDrawFont.DoGetTextWidth

DoGetTextWidth - returns width of text

Declaration

Source position: fpcanvas.pp line 326

protected function TFPCustomDrawFont.DoGetTextWidth(

  text: String

):Integer; virtual; abstract;


TFPCustomDrawPen

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomDrawPen - base class for pen used for drawing figures

Declaration

Source position: fpcanvas.pp line 332

type TFPCustomDrawPen = class(TFPCustomPen)
protected
procedure DoDrawLine(); virtual; abstract; | DoDrawLine - draw a line from first to second point
procedure DoPolyline(); virtual; abstract; | DoPolyline - draw a Polyline connecting points of the array in sequence, and closing the figure if Close is True
procedure DoEllipse(); virtual; abstract; | DoEllipse - draws an ellipse within the specified space
procedure DoRectangle(); virtual; abstract; | DoRectangle - draws a rectangle with the given coordinates
end;

Inheritance

TFPCustomDrawPen | TFPCustomDrawPen - base class for pen used for drawing figures
|
TFPCustomPen | TFPCustomPen - FreePascal base class for Pens
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomDrawPen
TFPCustomPen
 |  | Style
 |  | Width
 |  | Mode
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


ro | Allocated (TFPCanvasHelper)
ro | Canvas (TFPCanvasHelper)
 | DelayAllocate (TFPCanvasHelper)
ro | FixedCanvas (TFPCanvasHelper)
 | FPColor (TFPCanvasHelper)
 | Mode (TFPCustomPen)
 | Pattern (TFPCustomPen)
 | Style (TFPCustomPen)
 | Width (TFPCustomPen)


TFPCustomDrawPen
pt | DoDrawLine
pt | DoPolyline
pt | DoEllipse
pt | DoRectangle
TFPCustomPen
pt | DoCopyProps
pt | SetMode
pt | SetWidth
pt | SetStyle
pt | SetPattern
 | CopyPen
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyPen (TFPCustomPen)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomPen)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | DoDrawLine (TFPCustomDrawPen)
pt | DoEllipse (TFPCustomDrawPen)
pt | DoPolyline (TFPCustomDrawPen)
pt | DoRectangle (TFPCustomDrawPen)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetMode (TFPCustomPen)
pt | SetPattern (TFPCustomPen)
pt | SetStyle (TFPCustomPen)
pt | SetWidth (TFPCustomPen)
pt | UnLock (TFPCanvasHelper)


TFPCustomDrawPen
TFPCustomPen
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomDrawPen.DoDrawLine

DoDrawLine - draw a line from first to second point

Declaration

Source position: fpcanvas.pp line 339

protected procedure TFPCustomDrawPen.DoDrawLine(

  x1: Integer;

  y1: Integer;

  x2: Integer;

  y2: Integer

); virtual; abstract;


TFPCustomDrawPen.DoEllipse

DoEllipse - draws an ellipse within the specified space

Declaration

Source position: fpcanvas.pp line 341

protected procedure TFPCustomDrawPen.DoEllipse(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

); virtual; abstract;


TFPCustomDrawPen.DoPolyline

DoPolyline - draw a Polyline connecting points of the array in sequence, and closing the figure if Close is True

Declaration

Source position: fpcanvas.pp line 340

protected procedure TFPCustomDrawPen.DoPolyline(

  const points: array of TPoint;

  close: Boolean

); virtual; abstract;


TFPCustomDrawPen.DoRectangle

DoRectangle - draws a rectangle with the given coordinates

Declaration

Source position: fpcanvas.pp line 342

protected procedure TFPCustomDrawPen.DoRectangle(

  left: Integer;

  top: Integer;

  right: Integer;

  bottom: Integer

); virtual; abstract;


TFPCustomFont

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomFont - FreePascal base class for Fonts

Declaration

Source position: fpcanvas.pp line 82

type TFPCustomFont = class(TFPCanvasHelper)
protected
procedure DoCopyProps(); override; | DoCopyProps - copies properties from another Canvas Helper
procedure SetName(); virtual; | SetName - specify the name of the Font
procedure SetSize(); virtual; | SetSize - specify the size for the Font
public
function CopyFont; | CopyFont - returns a copy of the font with all properties the same, but not allocated
procedure GetTextSize(); | GetTextSize - finds the size (w: width, h: height) of the specified text in the current font
function GetTextHeight(); | GetTextHeight - returns the height of the specified text
function GetTextWidth(); | GetTextWidth - returns the width of the specified text
property Name: String; [rw] | The Name of the current Font
property Size: Integer; [rw] | The Size of the current Font
property Bold: Boolean; | Is the Font Bold?
property Italic: Boolean; | Is the Font Italic?
property Underline: Boolean; | Is the Font Underline?
property StrikeTrough: Boolean; | Is the Font StrikeTrough?
end;

Inheritance

TFPCustomFont | TFPCustomFont - FreePascal base class for Fonts
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomFont
 |  | Name
 |  | Size
 | ro | Bold
 | ro | Italic
 | ro | Underline
 | ro | StrikeTrough
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPCustomFont
pt | DoCopyProps
pt | SetName
pt | SetSize
 | CopyFont
 | GetTextSize
 | GetTextHeight
 | GetTextWidth
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyFont (TFPCustomFont)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomFont)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
 | GetTextHeight (TFPCustomFont)
 | GetTextSize (TFPCustomFont)
 | GetTextWidth (TFPCustomFont)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetName (TFPCustomFont)
pt | SetSize (TFPCustomFont)
pt | UnLock (TFPCanvasHelper)


TFPCustomFont
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomFont.Bold

Is the Font Bold?

Declaration

Source position: fpcanvas.pp line 98

public property TFPCustomFont.Bold: Boolean
  index 5readGetFlagswriteSetFlags;


TFPCustomFont.CopyFont

CopyFont - returns a copy of the font with all properties the same, but not allocated

Declaration

Source position: fpcanvas.pp line 91

public function TFPCustomFont.CopyFont: TFPCustomFont;


TFPCustomFont.GetTextHeight

GetTextHeight - returns the height of the specified text

Declaration

Source position: fpcanvas.pp line 94

public function TFPCustomFont.GetTextHeight(

  text: String

):Integer;


TFPCustomFont.GetTextSize

GetTextSize - finds the size (w: width, h: height) of the specified text in the current font

Declaration

Source position: fpcanvas.pp line 93

public procedure TFPCustomFont.GetTextSize(

  text: String;

  var w: Integer;

  var h: Integer

);


TFPCustomFont.GetTextWidth

GetTextWidth - returns the width of the specified text

Declaration

Source position: fpcanvas.pp line 95

public function TFPCustomFont.GetTextWidth(

  text: String

):Integer;


TFPCustomFont.Italic

Is the Font Italic?

Declaration

Source position: fpcanvas.pp line 99

public property TFPCustomFont.Italic: Boolean
  index 6readGetFlagswriteSetFlags;


TFPCustomFont.Name

The Name of the current Font

Declaration

Source position: fpcanvas.pp line 96

public property TFPCustomFont.Name: String
  read FName
  write SetName;


TFPCustomFont.SetName

SetName - specify the name of the Font

Declaration

Source position: fpcanvas.pp line 88

protected procedure TFPCustomFont.SetName(

  AValue: String

); virtual;


TFPCustomFont.SetSize

SetSize - specify the size for the Font

Declaration

Source position: fpcanvas.pp line 89

protected procedure TFPCustomFont.SetSize(

  AValue: Integer

); virtual;


TFPCustomFont.Size

The Size of the current Font

Declaration

Source position: fpcanvas.pp line 97

public property TFPCustomFont.Size: Integer
  read FSize
  write SetSize;


TFPCustomFont.StrikeTrough

Is the Font StrikeTrough?

Declaration

Source position: fpcanvas.pp line 101

public property TFPCustomFont.StrikeTrough: Boolean
  index 8readGetFlagswriteSetFlags;


TFPCustomFont.Underline

Is the Font Underline?

Declaration

Source position: fpcanvas.pp line 100

public property TFPCustomFont.Underline: Boolean
  index 7readGetFlagswriteSetFlags;


TFPCustomFontClass

TFPCustomFontClass - class of TFPCustomFont

Declaration

Source position: fpcanvas.pp line 103

type TFPCustomFontClass = class of TFPCustomFont;


TFPCustomInterpolation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomInterpolation - FreePascal base class for interpolations while drawing in unspecified regions between specified points

Declaration

Source position: fpcanvas.pp line 158

type TFPCustomInterpolation = class
protected
procedure Initialize(); virtual; | Initialize - the image ready to apply interpolation
procedure Execute(); virtual; abstract; | Execute the interpolation
public
property Canvas: TFPCustomCanvas; [r] | The Canvas on which the interpolation is to be applied
property Image: TFPCustomImage; [r] | The Image to which the interpolation is to be applied
end;

Inheritance

TFPCustomInterpolation

TFPCustomInterpolation - FreePascal base class for interpolations while drawing in unspecified regions between specified points
|

TObject


TFPCustomInterpolation
 | ro | Canvas
 | ro | Image


TFPCustomInterpolation
pt | Initialize
pt | Execute


pt | Execute (TFPCustomInterpolation)
pt | Initialize (TFPCustomInterpolation)


TFPCustomInterpolation


TFPCustomInterpolation.Canvas

The Canvas on which the interpolation is to be applied

Declaration

Source position: fpcanvas.pp line 166

public property TFPCustomInterpolation.Canvas: TFPCustomCanvas
  read fcanvas;


TFPCustomInterpolation.Execute

Execute the interpolation

Declaration

Source position: fpcanvas.pp line 164

protected procedure TFPCustomInterpolation.Execute(

  x: Integer;

  y: Integer;

  w: Integer;

  h: Integer

); virtual; abstract;


TFPCustomInterpolation.Image

The Image to which the interpolation is to be applied

Declaration

Source position: fpcanvas.pp line 167

public property TFPCustomInterpolation.Image: TFPCustomImage
  read fimage;


TFPCustomInterpolation.Initialize

Initialize - the image ready to apply interpolation

Declaration

Source position: fpcanvas.pp line 163

protected procedure TFPCustomInterpolation.Initialize(

  aimage: TFPCustomImage;

  acanvas: TFPCustomCanvas

); virtual;


TFPCustomPen

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomPen - FreePascal base class for Pens

Declaration

Source position: fpcanvas.pp line 112

type TFPCustomPen = class(TFPCanvasHelper)
protected
procedure DoCopyProps(); override; | DoCopyProps - copies properties from another Canvas Helper
procedure SetMode(); virtual; | SetMode specifies Pen Mode
procedure SetWidth(); virtual; | SetWidth - specifies width of the Pen
procedure SetStyle(); virtual; | SetStyle - specifies style for the Pen
procedure SetPattern(); virtual; | SetPattern - specifies the pattern for the Pen
public
function CopyPen; | CopyPen - returns a copy of the pen with all properties the same, but not allocated
property Style: TFPPenStyle; [rw] | The Style of the Pen
property Width: Integer; [rw] | The Width in pixels of the current Pen
property Mode: TFPPenMode; [rw] | The Mode of the Pen
property Pattern: LongWord; [rw] | The Pattern for the Pen
end;

Inheritance

TFPCustomPen | TFPCustomPen - FreePascal base class for Pens
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPCustomPen
 |  | Style
 |  | Width
 |  | Mode
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPCustomPen
pt | DoCopyProps
pt | SetMode
pt | SetWidth
pt | SetStyle
pt | SetPattern
 | CopyPen
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
pt | Changed (TFPCanvasHelper)
pt | Changing (TFPCanvasHelper)
pt | CheckAllocated (TFPCanvasHelper)
 | CopyPen (TFPCustomPen)
 | Create (TFPCanvasHelper)
 | DeallocateResources (TFPCanvasHelper)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | Destroy (TFPCanvasHelper)
pt | DoAllocateResources (TFPCanvasHelper)
pt | DoCopyProps (TFPCanvasHelper)
pt | DoCopyProps (TFPCustomPen)
pt | DoDeAllocateResources (TFPCanvasHelper)
pt | GetAllocated (TFPCanvasHelper)
pt | GetFlags (TFPCanvasHelper)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
pt | Lock (TFPCanvasHelper)
pt | SetFixedCanvas (TFPCanvasHelper)
pt | SetFlags (TFPCanvasHelper)
pt | SetFPColor (TFPCanvasHelper)
pt | SetMode (TFPCustomPen)
pt | SetPattern (TFPCustomPen)
pt | SetStyle (TFPCustomPen)
pt | SetWidth (TFPCustomPen)
pt | UnLock (TFPCanvasHelper)


TFPCustomPen
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPCustomPen.CopyPen

CopyPen - returns a copy of the pen with all properties the same, but not allocated

Declaration

Source position: fpcanvas.pp line 125

public function TFPCustomPen.CopyPen: TFPCustomPen;


TFPCustomPen.Mode

The Mode of the Pen

Declaration

Source position: fpcanvas.pp line 129

public property TFPCustomPen.Mode: TFPPenMode
  read FMode
  write SetMode;


TFPCustomPen.Pattern

The Pattern for the Pen

Declaration

Source position: fpcanvas.pp line 130

public property TFPCustomPen.Pattern: LongWord
  read FPattern
  write SetPattern;


TFPCustomPen.SetMode

SetMode specifies Pen Mode

Declaration

Source position: fpcanvas.pp line 120

protected procedure TFPCustomPen.SetMode(

  AValue: TFPPenMode

); virtual;


TFPCustomPen.SetPattern

SetPattern - specifies the pattern for the Pen

Declaration

Source position: fpcanvas.pp line 123

protected procedure TFPCustomPen.SetPattern(

  AValue: LongWord

); virtual;


TFPCustomPen.SetStyle

SetStyle - specifies style for the Pen

Declaration

Source position: fpcanvas.pp line 122

protected procedure TFPCustomPen.SetStyle(

  AValue: TFPPenStyle

); virtual;


TFPCustomPen.SetWidth

SetWidth - specifies width of the Pen

Declaration

Source position: fpcanvas.pp line 121

protected procedure TFPCustomPen.SetWidth(

  AValue: Integer

); virtual;


TFPCustomPen.Style

The Style of the Pen

Declaration

Source position: fpcanvas.pp line 127

public property TFPCustomPen.Style: TFPPenStyle
  read FStyle
  write SetStyle;


TFPCustomPen.Width

The Width in pixels of the current Pen

Declaration

Source position: fpcanvas.pp line 128

public property TFPCustomPen.Width: Integer
  read FWidth
  write SetWidth;


TFPCustomPenClass

TFPCustomPenClass - class of TFPCustomPen

Declaration

Source position: fpcanvas.pp line 132

type TFPCustomPenClass = class of TFPCustomPen;


TFPEmptyBrush

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPEmptyBrush - dummy class for empty brush

Declaration

Source position: fpcanvas.pp line 361

type TFPEmptyBrush = class(TFPCustomBrush) end;

Inheritance

TFPEmptyBrush | TFPEmptyBrush - dummy class for empty brush
|
TFPCustomBrush | TFPCustomBrush - FreePascal base class for Brushes
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPEmptyBrush
TFPCustomBrush
 |  | Style
 |  | Image
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPEmptyBrush
TFPCustomBrush
pt | SetStyle
pt | SetImage
pt | DoCopyProps
 | CopyBrush
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


TFPEmptyBrush
TFPCustomBrush
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPEmptyFont

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPEmptyFont - dummy class for empty font

Declaration

Source position: fpcanvas.pp line 329

type TFPEmptyFont = class(TFPCustomFont) end;

Inheritance

TFPEmptyFont | TFPEmptyFont - dummy class for empty font
|
TFPCustomFont | TFPCustomFont - FreePascal base class for Fonts
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPEmptyFont
TFPCustomFont
 |  | Name
 |  | Size
 | ro | Bold
 | ro | Italic
 | ro | Underline
 | ro | StrikeTrough
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPEmptyFont
TFPCustomFont
pt | DoCopyProps
pt | SetName
pt | SetSize
 | CopyFont
 | GetTextSize
 | GetTextHeight
 | GetTextWidth
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


TFPEmptyFont
TFPCustomFont
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPEmptyPen

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPEmptyPen - dummy class for empty pen

Declaration

Source position: fpcanvas.pp line 345

type TFPEmptyPen = class(TFPCustomPen) end;

Inheritance

TFPEmptyPen | TFPEmptyPen - dummy class for empty pen
|
TFPCustomPen | TFPCustomPen - FreePascal base class for Pens
|
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
|
TPersistent
|
TObject


TFPEmptyPen
TFPCustomPen
 |  | Style
 |  | Width
 |  | Mode
 |  | Pattern
TFPCanvasHelper
 | ro | Allocated
 | ro | FixedCanvas
 | ro | Canvas
 |  | FPColor
 |  | DelayAllocate
TPersistent


TFPEmptyPen
TFPCustomPen
pt | DoCopyProps
pt | SetMode
pt | SetWidth
pt | SetStyle
pt | SetPattern
 | CopyPen
TFPCanvasHelper
pt | GetAllocated
pt | SetFlags
pt | GetFlags
pt | CheckAllocated
pt | SetFixedCanvas
pt | DoAllocateResources
pt | DoDeAllocateResources
pt | DoCopyProps
pt | SetFPColor
pt | Changing
pt | Changed
pt | Lock
pt | UnLock
 | Create
 | Destroy
 | AllocateResources
 | DeallocateResources
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


TFPEmptyPen
TFPCustomPen
TFPCanvasHelper
 | OnChanging
 | OnChange
TPersistent


TFPFontException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPFontException exception handler for FreePascal base Font class

Declaration

Source position: fpcanvas.pp line 30

type TFPFontException = class(TFPCanvasException) end;

Inheritance

TFPFontException | TFPFontException exception handler for FreePascal base Font class
|
TFPCanvasException | TFPCanvasException - exception handler for FreePascal base Canvas class
|
Exception
|
TObject


TFPFontException
TFPCanvasException
Exception
 | HelpContext
 | Message


TFPFontException
TFPCanvasException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


TFPFontException

TFPCanvasException

Exception


TFPPenException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPPenException - exception handler for FreePascal base Pen class

Declaration

Source position: fpcanvas.pp line 28

type TFPPenException = class(TFPCanvasException) end;

Inheritance

TFPPenException | TFPPenException - exception handler for FreePascal base Pen class
|
TFPCanvasException | TFPCanvasException - exception handler for FreePascal base Canvas class
|
Exception
|
TObject


TFPPenException
TFPCanvasException
Exception
 | HelpContext
 | Message


TFPPenException
TFPCanvasException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


TFPPenException

TFPCanvasException

Exception


TMitchelInterpolation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TMitchelInterpolation - one possible algorithm for interpolation

Declaration

Source position: fpcanvas.pp line 184

type TMitchelInterpolation = class(TFPBaseInterpolation)
protected
function Filter(); override; | Filter uses specific constants as coefficients in a polynomial interpolation
function MaxSupport; override; | MaxSupport factor for interpolation
end;

Inheritance

TMitchelInterpolation | TMitchelInterpolation - one possible algorithm for interpolation
|
TFPBaseInterpolation | TFPBaseInterpolation - the default interpolation to be applied if no other is specified
|
TFPCustomInterpolation | TFPCustomInterpolation - FreePascal base class for interpolations while drawing in unspecified regions between specified points
|
TObject


TMitchelInterpolation
TFPBaseInterpolation
TFPCustomInterpolation
 | ro | Canvas
 | ro | Image


TMitchelInterpolation
pt | Filter
pt | MaxSupport
TFPBaseInterpolation
pt | Execute
pt | Filter
pt | MaxSupport
TFPCustomInterpolation
pt | Initialize
pt | Execute


pt | Execute (TFPCustomInterpolation)
pt | Execute (TFPBaseInterpolation)
pt | Filter (TFPBaseInterpolation)
pt | Filter (TMitchelInterpolation)
pt | Initialize (TFPCustomInterpolation)
pt | MaxSupport (TFPBaseInterpolation)
pt | MaxSupport (TMitchelInterpolation)


TMitchelInterpolation

TFPBaseInterpolation

TFPCustomInterpolation


TMitchelInterpolation.Filter

Filter uses specific constants as coefficients in a polynomial interpolation

Declaration

Source position: fpcanvas.pp line 186

protected function TMitchelInterpolation.Filter(

  x: double

):double; override;

See also

TFPBaseInterpolation.Filter

Filter factor to be used in interpolating


FPImageException

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Declaration

Source position: fpimage.pp line 28

type FPImageException = class(Exception) end;

Inheritance

FPImageException
|

Exception
|

TObject


FPImageException
Exception
 | HelpContext
 | Message


FPImageException
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


FPImageException

Exception


TFPCustomImage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomImage - FreePascal base definition for all Image classes

Declaration

Source position: fpimage.pp line 91

type TFPCustomImage = class(TPersistent)
protected
procedure SetInternalColor(); virtual; | SetInternalColor - specify the internal colour (using TFPColor format)
function GetInternalColor(); virtual; | GetInternalColor - finds the internal colour from local store
procedure SetInternalPixel(); virtual; abstract; | SetInternalPixel - specifies the integer Color of a pixel located at the given coordinates
function GetInternalPixel(); virtual; abstract; | GetInternalPixel - returns the integer Color of the specified pixel
procedure SetUsePalette(); virtual; | SetUsePalette - specifies whether a palette is to be used in painting the Image
procedure Progress(); virtual; | Progress - method for displaying the progress of a drawing or painting action
public
constructor create(); virtual; | Create - constructor for TFPCustomImage: calls inherited Create then initialises position and size, makes a stringlist
destructor destroy; override; | Destroy - destructor for TFPCustomImage: frees the Palette then calls inherited Destroy
procedure Assign(); override;
procedure LoadFromStream(); | LoadFromStream loads data from the specified stream, optionally using the specified reader
procedure LoadFromFile(); | LoadFromFile - reads data from the specified file, optionally using the specified reader
procedure SaveToStream(); | SaveToStream - writes the data to the specified stream, using the specified writer
procedure SaveToFile(); | SaveToFile - writes image data to the specifed file, using the specified writer
procedure SetSize(); virtual; | SetSize - specify the size of the Image
property Height: Integer; [rw] | The Height of the image
property Width: Integer; [rw] | The Width of the image
property Colors: TFPColor; default; [rw] | The Colors to be used at the nominated position
property UsePalette: Boolean; [rw] | UsePalette - Use of palette for colors
property Palette: TFPPalette; [r] | The Palette to be used in painting the Image
property Pixels: Integer; [rw] | The Pixels (integer value) found at the specified location
property Extra: String; [rw] | Extra - Info unrelated with the image representation
property ExtraValue: String; [rw] | ExtraValue - additional information stored with the image
property ExtraKey: String; [rw] | ExtraKey - an additional key stored with the image
procedure RemoveExtra(); | RemoveExtra - ge rid of the ExtraKey
function ExtraCount; | ExtraCount - the number of additional (non-image) items stored with the Image
property OnProgress: TFPImgProgressEvent; [rw] | OnProgress - event handler for displaying progress of the painting process
end;

Inheritance

TFPCustomImage

TFPCustomImage - FreePascal base definition for all Image classes
|

TPersistent
|

TObject


TFPCustomImage
 |  | Height
 |  | Width
 |  | Colors
 |  | UsePalette
 | ro | Palette
 |  | Pixels
 |  | Extra
 |  | ExtraValue
 |  | ExtraKey
TPersistent


 | Colors (TFPCustomImage)
 | Extra (TFPCustomImage)
 | ExtraKey (TFPCustomImage)
 | ExtraValue (TFPCustomImage)
 | Height (TFPCustomImage)
ro | Palette (TFPCustomImage)
 | Pixels (TFPCustomImage)
 | UsePalette (TFPCustomImage)
 | Width (TFPCustomImage)


TFPCustomImage
pt | SetInternalColor
pt | GetInternalColor
pt | SetInternalPixel
pt | GetInternalPixel
pt | SetUsePalette
pt | Progress
 | create
 | destroy
 | Assign
 | LoadFromStream
 | LoadFromFile
 | SaveToStream
 | SaveToFile
 | SetSize
 | RemoveExtra
 | ExtraCount
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
 | create (TFPCustomImage)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | destroy (TFPCustomImage)
 | ExtraCount (TFPCustomImage)
pt | GetInternalColor (TFPCustomImage)
pt | GetInternalPixel (TFPCustomImage)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
 | LoadFromFile (TFPCustomImage)
 | LoadFromStream (TFPCustomImage)
pt | Progress (TFPCustomImage)
 | RemoveExtra (TFPCustomImage)
 | SaveToFile (TFPCustomImage)
 | SaveToStream (TFPCustomImage)
pt | SetInternalColor (TFPCustomImage)
pt | SetInternalPixel (TFPCustomImage)
 | SetSize (TFPCustomImage)
pt | SetUsePalette (TFPCustomImage)


TFPCustomImage

OnProgress

TPersistent


TFPCustomImage.Colors

The Colors to be used at the nominated position

Declaration

Source position: fpimage.pp line 138

public property TFPCustomImage.Colors: TFPColor
  read GetColor
  write SetColor;
  default;


TFPCustomImage.create

Create - constructor for TFPCustomImage: calls inherited Create then initialises position and size, makes a stringlist

Declaration

Source position: fpimage.pp line 123

public constructor TFPCustomImage.create(

  AWidth: Integer;

  AHeight: Integer

); virtual;

See also

TObject.Create


TFPCustomImage.destroy

Destroy - destructor for TFPCustomImage: frees the Palette then calls inherited Destroy

Declaration

Source position: fpimage.pp line 124

public destructor TFPCustomImage.destroy; override;

See also

TPersistent.Destroy


TFPCustomImage.Extra

Extra - Info unrelated with the image representation

Declaration

Source position: fpimage.pp line 144

public property TFPCustomImage.Extra: String
  read GetExtra
  write SetExtra;


TFPCustomImage.ExtraCount

ExtraCount - the number of additional (non-image) items stored with the Image

Declaration

Source position: fpimage.pp line 148

public function TFPCustomImage.ExtraCount: Integer;


TFPCustomImage.ExtraKey

ExtraKey - an additional key stored with the image

Declaration

Source position: fpimage.pp line 146

public property TFPCustomImage.ExtraKey: String
  read GetExtraKey
  write SetExtraKey;


TFPCustomImage.ExtraValue

ExtraValue - additional information stored with the image

Declaration

Source position: fpimage.pp line 145

public property TFPCustomImage.ExtraValue: String
  read GetExtraValue
  write SetExtraValue;


TFPCustomImage.GetInternalColor

GetInternalColor - finds the internal colour from local store

Declaration

Source position: fpimage.pp line 115

protected function TFPCustomImage.GetInternalColor(

  x: Integer;

  y: Integer

):TFPColor; virtual;


TFPCustomImage.GetInternalPixel

GetInternalPixel - returns the integer Color of the specified pixel

Declaration

Source position: fpimage.pp line 117

protected function TFPCustomImage.GetInternalPixel(

  x: Integer;

  y: Integer

):Integer; virtual; abstract;


TFPCustomImage.Height

The Height of the image

Declaration

Source position: fpimage.pp line 136

public property TFPCustomImage.Height: Integer
  read FHeight
  write SetHeight;


TFPCustomImage.LoadFromFile

LoadFromFile - reads data from the specified file, optionally using the specified reader

Declaration

Source position: line 0

public procedure TFPCustomImage.LoadFromFile(

  const filename: String;

  Handler: TFPCustomImageReader

);

procedure TFPCustomImage.LoadFromFile(

  const filename: String

);


TFPCustomImage.LoadFromStream

LoadFromStream loads data from the specified stream, optionally using the specified reader

Declaration

Source position: line 0

public procedure TFPCustomImage.LoadFromStream(

  Str: TStream;

  Handler: TFPCustomImageReader

);

procedure TFPCustomImage.LoadFromStream(

  Str: TStream

);


TFPCustomImage.OnProgress

OnProgress - event handler for displaying progress of the painting process

Declaration

Source position: fpimage.pp line 149

public property TFPCustomImage.OnProgress: TFPImgProgressEvent
  read FOnProgress
  write FOnProgress;


TFPCustomImage.Palette

The Palette to be used in painting the Image

Declaration

Source position: fpimage.pp line 141

public property TFPCustomImage.Palette: TFPPalette
  read FPalette;


TFPCustomImage.Pixels

The Pixels (integer value) found at the specified location

Declaration

Source position: fpimage.pp line 142

public property TFPCustomImage.Pixels: Integer
  read GetPixel
  write SetPixel;


TFPCustomImage.Progress

Progress - method for displaying the progress of a drawing or painting action

Declaration

Source position: fpimage.pp line 119

protected procedure TFPCustomImage.Progress(

  Sender: TObject;

  Stage: TProgressStage;

  PercentDone: Byte;

  RedrawNow: Boolean;

  const R: TRect;

  const Msg: AnsiString;

  var Continue: Boolean

); virtual;

Description

Progress - method for displaying the progress of a drawing or painting action

Sender: calling routine

Stage: Starting, Running or Ending

PercentDone: how much has been accomplished

RedrawNow: whether to refresh the Image

R: the rectangle in which drawing progress is being monitored

Msg: a message to show in the progress display

Continue: whether to keep on drawing


TFPCustomImage.RemoveExtra

RemoveExtra - ge rid of the ExtraKey

Declaration

Source position: fpimage.pp line 147

public procedure TFPCustomImage.RemoveExtra(

  const key: String

);


TFPCustomImage.SaveToFile

SaveToFile - writes image data to the specifed file, using the specified writer

Declaration

Source position: line 0

public procedure TFPCustomImage.SaveToFile(

  const filename: String;

  Handler: TFPCustomImageWriter

);

procedure TFPCustomImage.SaveToFile(

  const filename: String

);


TFPCustomImage.SaveToStream

SaveToStream - writes the data to the specified stream, using the specified writer

Declaration

Source position: fpimage.pp line 131

public procedure TFPCustomImage.SaveToStream(

  Str: TStream;

  Handler: TFPCustomImageWriter

);


TFPCustomImage.SetInternalColor

SetInternalColor - specify the internal colour (using TFPColor format)

Declaration

Source position: fpimage.pp line 114

protected procedure TFPCustomImage.SetInternalColor(

  x: Integer;

  y: Integer;

  const Value: TFPColor

); virtual;


TFPCustomImage.SetInternalPixel

SetInternalPixel - specifies the integer Color of a pixel located at the given coordinates

Declaration

Source position: fpimage.pp line 116

protected procedure TFPCustomImage.SetInternalPixel(

  x: Integer;

  y: Integer;

  Value: Integer

); virtual; abstract;


TFPCustomImage.SetSize

SetSize - specify the size of the Image

Declaration

Source position: fpimage.pp line 135

public procedure TFPCustomImage.SetSize(

  AWidth: Integer;

  AHeight: Integer

); virtual;


TFPCustomImage.SetUsePalette

SetUsePalette - specifies whether a palette is to be used in painting the Image

Declaration

Source position: fpimage.pp line 118

protected procedure TFPCustomImage.SetUsePalette(

  Value: Boolean

); virtual;


TFPCustomImage.UsePalette

UsePalette - Use of palette for colors

Declaration

Source position: fpimage.pp line 140

public property TFPCustomImage.UsePalette: Boolean
  read GetUsePalette
  write SetUsePalette;


TFPCustomImage.Width

The Width of the image

Declaration

Source position: fpimage.pp line 137

public property TFPCustomImage.Width: Integer
  read FWidth
  write SetWidth;


TFPCustomImageClass

TFPCustomImageClass - class of TFPCustomImage

Declaration

Source position: fpimage.pp line 151

type TFPCustomImageClass = class of TFPCustomImage;


TFPCustomImageHandler

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomImageHandler FreePascal base class for handling images

Declaration

Source position: fpimage.pp line 179

type TFPCustomImageHandler = class
protected
procedure Progress(); virtual; | Progress - method for displaying the progress of a drawing or painting action
property TheStream: TStream; [r] | TheStream from or to which the image is being read or written
property TheImage: TFPCustomImage; [r] | TheImage which is being read or written
public
constructor Create; virtual;
property OnProgress: TFPImgProgressEvent; [rw] | OnProgress event handler for showing progress of drawing or painting
end;

Inheritance

TFPCustomImageHandler

TFPCustomImageHandler FreePascal base class for handling images
|

TObject


TFPCustomImageHandler
pt | ro | TheStream
pt | ro | TheImage


pt | ro | TheImage (TFPCustomImageHandler)
pt | ro | TheStream (TFPCustomImageHandler)


TFPCustomImageHandler
pt | Progress
 | Create


pt | Progress (TFPCustomImageHandler)


TFPCustomImageHandler

OnProgress


TFPCustomImageHandler.OnProgress

OnProgress event handler for showing progress of drawing or painting

Declaration

Source position: fpimage.pp line 191

public property TFPCustomImageHandler.OnProgress: TFPImgProgressEvent
  read FOnProgress
  write FOnProgress;


TFPCustomImageHandler.Progress

Progress - method for displaying the progress of a drawing or painting action

Declaration

Source position: fpimage.pp line 185

protected procedure TFPCustomImageHandler.Progress(

  Stage: TProgressStage;

  PercentDone: Byte;

  RedrawNow: Boolean;

  const R: TRect;

  const Msg: AnsiString;

  var Continue: Boolean

); virtual;

Description

Progress - method for displaying the progress of a drawing or painting action

Sender: calling routine

Stage: Starting, Running or Ending

PercentDone: how much has been accomplished

RedrawNow: whether to refresh the Image

R: the rectangle in which drawing progress is being monitored

Msg: a message to show in the progress display

Continue: whether to keep on drawing


TFPCustomImageHandler.TheImage

TheImage which is being read or written

Declaration

Source position: fpimage.pp line 188

protected property TFPCustomImageHandler.TheImage: TFPCustomImage
  read FImage;


TFPCustomImageHandler.TheStream

TheStream from or to which the image is being read or written

Declaration

Source position: fpimage.pp line 187

protected property TFPCustomImageHandler.TheStream: TStream
  read FStream;


TFPCustomImageReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomImageReader - FreePascal base class for Image reading

Declaration

Source position: fpimage.pp line 194

type TFPCustomImageReader = class(TFPCustomImageHandler)
protected
procedure InternalRead(); virtual; abstract; | InternalRead - read specified image from nominated stream
function InternalCheck(); virtual; abstract; | InternalCheck - performs check on validity of stream, returns True if OK
public
constructor Create; override;
function ImageRead(); | ImageRead read specified image from nominated stream; returns the image
function CheckContents(); | CheckContents - Gives True if contents are readable
property DefaultImageClass: TFPCustomImageClass; [rw] | DefaultImageClass - Image Class to create when no img is given for reading
end;

Inheritance

TFPCustomImageReader | TFPCustomImageReader - FreePascal base class for Image reading
|
TFPCustomImageHandler | TFPCustomImageHandler FreePascal base class for handling images
|
TObject


TFPCustomImageReader
 |  | DefaultImageClass
TFPCustomImageHandler
pt | ro | TheStream
pt | ro | TheImage


TFPCustomImageReader
pt | InternalRead
pt | InternalCheck
 | Create
 | ImageRead
 | CheckContents
TFPCustomImageHandler
pt | Progress
 | Create


 | CheckContents (TFPCustomImageReader)
 | Create (TFPCustomImageHandler)
 | Create (TFPCustomImageReader)
 | ImageRead (TFPCustomImageReader)
pt | InternalCheck (TFPCustomImageReader)
pt | InternalRead (TFPCustomImageReader)
pt | Progress (TFPCustomImageHandler)


TFPCustomImageReader

TFPCustomImageHandler

OnProgress


TFPCustomImageReader.CheckContents

CheckContents - Gives True if contents are readable

Declaration

Source position: fpimage.pp line 204

public function TFPCustomImageReader.CheckContents(

  Str: TStream

):Boolean;


TFPCustomImageReader.DefaultImageClass

DefaultImageClass - Image Class to create when no img is given for reading

Declaration

Source position: fpimage.pp line 206

public property TFPCustomImageReader.DefaultImageClass: TFPCustomImageClass
  read FDefImageClass
  write FDefImageClass;


TFPCustomImageReader.ImageRead

ImageRead read specified image from nominated stream; returns the image

Declaration

Source position: fpimage.pp line 202

public function TFPCustomImageReader.ImageRead(

  Str: TStream;

  Img: TFPCustomImage

):TFPCustomImage;


TFPCustomImageReader.InternalCheck

InternalCheck - performs check on validity of stream, returns True if OK

Declaration

Source position: fpimage.pp line 199

protected function TFPCustomImageReader.InternalCheck(

  Str: TStream

):Boolean; virtual; abstract;


TFPCustomImageReader.InternalRead

InternalRead - read specified image from nominated stream

Declaration

Source position: fpimage.pp line 198

protected procedure TFPCustomImageReader.InternalRead(

  Str: TStream;

  Img: TFPCustomImage

); virtual; abstract;


TFPCustomImageReaderClass

TFPCustomImageReaderClass - class of TFPCustomImageReader

Declaration

Source position: fpimage.pp line 209

type TFPCustomImageReaderClass = class of TFPCustomImageReader;


TFPCustomImageWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPCustomImageWriter - FreePascal base class for writing image data

Declaration

Source position: fpimage.pp line 211

type TFPCustomImageWriter = class(TFPCustomImageHandler)
protected
procedure InternalWrite(); virtual; abstract; | InternalWrite - write specified image to nominated stream
public
procedure ImageWrite(); | ImageWrite - writes given image to stream
end;

Inheritance

TFPCustomImageWriter | TFPCustomImageWriter - FreePascal base class for writing image data
|
TFPCustomImageHandler | TFPCustomImageHandler FreePascal base class for handling images
|
TObject


TFPCustomImageWriter
TFPCustomImageHandler
pt | ro | TheStream
pt | ro | TheImage


TFPCustomImageWriter
pt | InternalWrite
 | ImageWrite
TFPCustomImageHandler
pt | Progress
 | Create


pt | InternalWrite (TFPCustomImageWriter)
pt | Progress (TFPCustomImageHandler)


TFPCustomImageWriter

TFPCustomImageHandler

OnProgress


TFPCustomImageWriter.ImageWrite

ImageWrite - writes given image to stream

Declaration

Source position: fpimage.pp line 215

public procedure TFPCustomImageWriter.ImageWrite(

  Str: TStream;

  Img: TFPCustomImage

);


TFPCustomImageWriter.InternalWrite

InternalWrite - write specified image to nominated stream

Declaration

Source position: fpimage.pp line 213

protected procedure TFPCustomImageWriter.InternalWrite(

  Str: TStream;

  Img: TFPCustomImage

); virtual; abstract;


TFPCustomImageWriterClass

TFPCustomImageWriterClass - class of TFPCustomImageWriter

Declaration

Source position: fpimage.pp line 218

type TFPCustomImageWriterClass = class of TFPCustomImageWriter;


TFPMemoryImage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPMemoryImage - FreePascal base class for an image held in memory

Declaration

Source position: fpimage.pp line 164

type TFPMemoryImage = class(TFPCustomImage)
protected
procedure SetInternalPixel(); override; | SetInternalPixel - specifies the integer Color of a pixel located at the given coordinates
function GetInternalPixel(); override; | GetInternalPixel - returns the integer Color of the specified pixel
public
constructor create(); override; | Create - constructor for TFPCustomImage: calls inherited Create then initialises position and size, makes a stringlist
destructor destroy; override; | Destroy - destructor for TFPCustomImage: frees the Palette then calls inherited Destroy
procedure SetSize(); override; | SetSize - specify the size of the Image
end;

Inheritance

TFPMemoryImage | TFPMemoryImage - FreePascal base class for an image held in memory
|
TFPCustomImage | TFPCustomImage - FreePascal base definition for all Image classes
|
TPersistent
|
TObject


TFPMemoryImage
TFPCustomImage
 |  | Height
 |  | Width
 |  | Colors
 |  | UsePalette
 | ro | Palette
 |  | Pixels
 |  | Extra
 |  | ExtraValue
 |  | ExtraKey
TPersistent


TFPMemoryImage
pt | SetInternalPixel
pt | GetInternalPixel
 | create
 | destroy
 | SetSize
TFPCustomImage
pt | SetInternalColor
pt | GetInternalColor
pt | SetInternalPixel
pt | GetInternalPixel
pt | SetUsePalette
pt | Progress
 | create
 | destroy
 | Assign
 | LoadFromStream
 | LoadFromFile
 | SaveToStream
 | SaveToFile
 | SetSize
 | RemoveExtra
 | ExtraCount
TPersistent
 | AssignError
 | AssignTo
 | DefineProperties
 | GetOwner
 | Destroy
 | Assign
 | GetNamePath


 | AssignError (TPersistent)
 | AssignTo (TPersistent)
 | create (TFPCustomImage)
 | create (TFPMemoryImage)
 | DefineProperties (TPersistent)
 | Destroy (TPersistent)
 | destroy (TFPCustomImage)
 | destroy (TFPMemoryImage)
 | ExtraCount (TFPCustomImage)
pt | GetInternalColor (TFPCustomImage)
pt | GetInternalPixel (TFPCustomImage)
pt | GetInternalPixel (TFPMemoryImage)
 | GetNamePath (TPersistent)
 | GetOwner (TPersistent)
 | LoadFromFile (TFPCustomImage)
 | LoadFromStream (TFPCustomImage)
pt | Progress (TFPCustomImage)
 | RemoveExtra (TFPCustomImage)
 | SaveToFile (TFPCustomImage)
 | SaveToStream (TFPCustomImage)
pt | SetInternalColor (TFPCustomImage)
pt | SetInternalPixel (TFPCustomImage)
pt | SetInternalPixel (TFPMemoryImage)
 | SetSize (TFPCustomImage)
 | SetSize (TFPMemoryImage)
pt | SetUsePalette (TFPCustomImage)


TFPMemoryImage

TFPCustomImage

OnProgress

TPersistent


TFPPalette

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TFPPalette - FreePascal Palette definition: base for LCL TPalette etc

Declaration

Source position: fpimage.pp line 68

type TFPPalette = class
protected
FData: PFPColorArray; | FData - local variable to hold data as a Colour Array
FCount: Integer; | FCount - local variable to hold number of colours in array
FCapacity: Integer; | FCapacity - local variable to hold total capacity of array
procedure SetCount(); virtual; | SetCount - specify the number of colours in the palette
function GetCount; | GetCount - returns the number of colours in the palette
procedure SetColor(); virtual; | SetColor - specifies the value of colour to be associated with the specified index
function GetColor(); | GetColor - returns the colour value for the specified index
procedure CheckIndex(); virtual; | CheckIndex - checks validity of supplied index
procedure EnlargeData; virtual; | EnlargeData - makes room in the array for more data
public
constructor Create(); | Create - constructor for TFPPalette: calls inherited Create then finds how much memory to allocate for the specified number of colours
destructor Destroy; override; | Destroy - destructor for TFPPalette: frees memory then calls inherited Destroy
procedure Build(); virtual; | Build an Image
procedure Copy(); virtual; | Copy from the source (APalette) to the current Palette
procedure Merge(); virtual; | Merge the contents of another palette (pal) with the current palette
function IndexOf(); virtual; | IndexOf - returns the index value for the specified colour
function Add(); virtual; | Add the specified colour to the palette and return the number of entries
procedure Clear; virtual; | Clear - empties the palette
property Color: TFPColor; default; [rw] | The current Color from the palette
property Count: Integer; [rw] | Count - the total number of entries for colours in the palette
end;

Inheritance

TFPPalette

TFPPalette - FreePascal Palette definition: base for LCL TPalette etc
|

TObject


TFPPalette
 | Color
 | Count


TFPPalette
pt | SetCount
pt | GetCount
pt | SetColor
pt | GetColor
pt | CheckIndex
pt | EnlargeData
 | Create
 | Destroy
 | Build
 | Copy
 | Merge
 | IndexOf
 | Add
 | Clear


pt | CheckIndex (TFPPalette)
 | Clear (TFPPalette)
 | Copy (TFPPalette)
 | Create (TFPPalette)
 | Destroy (TFPPalette)
pt | EnlargeData (TFPPalette)
pt | GetColor (TFPPalette)
pt | GetCount (TFPPalette)
 | IndexOf (TFPPalette)
 | Merge (TFPPalette)
pt | SetColor (TFPPalette)
pt | SetCount (TFPPalette)


TFPPalette


TFPPalette.Add

Add the specified colour to the palette and return the number of entries

Declaration

Source position: fpimage.pp line 85

public function TFPPalette.Add(

  const Value: TFPColor

):Integer; virtual;


TFPPalette.Build

Build an Image

Declaration

Source position: fpimage.pp line 81

public procedure TFPPalette.Build(

  Img: TFPCustomImage

); virtual;


TFPPalette.CheckIndex

CheckIndex - checks validity of supplied index

Declaration

Source position: fpimage.pp line 76

protected procedure TFPPalette.CheckIndex(

  index: Integer

); virtual;


TFPPalette.Clear

Clear - empties the palette

Declaration

Source position: fpimage.pp line 86

public procedure TFPPalette.Clear; virtual;


TFPPalette.Color

The current Color from the palette

Declaration

Source position: fpimage.pp line 87

public property TFPPalette.Color: TFPColor
  read GetColor
  write SetColor;
  default;


TFPPalette.Copy

Copy from the source (APalette) to the current Palette

Declaration

Source position: fpimage.pp line 82

public procedure TFPPalette.Copy(

  APalette: TFPPalette

); virtual;


TFPPalette.Count

Count - the total number of entries for colours in the palette

Declaration

Source position: fpimage.pp line 88

public property TFPPalette.Count: Integer
  read GetCount
  write SetCount;


TFPPalette.Create

Create - constructor for TFPPalette: calls inherited Create then finds how much memory to allocate for the specified number of colours

Declaration

Source position: fpimage.pp line 79

public constructor TFPPalette.Create(

  ACount: Integer

);

See also

TObject.Create


TFPPalette.Destroy

Destroy - destructor for TFPPalette: frees memory then calls inherited Destroy

Declaration

Source position: fpimage.pp line 80

public destructor TFPPalette.Destroy; override;

See also

TObject.Destroy


TFPPalette.EnlargeData

EnlargeData - makes room in the array for more data

Declaration

Source position: fpimage.pp line 77

protected procedure TFPPalette.EnlargeData; virtual;


TFPPalette.FCapacity

FCapacity - local variable to hold total capacity of array

Declaration

Source position: fpimage.pp line 71

protected TFPPalette.FCapacity: Integer;


TFPPalette.FCount

FCount - local variable to hold number of colours in array

Declaration

Source position: fpimage.pp line 71

protected TFPPalette.FCount: Integer;


TFPPalette.FData

FData - local variable to hold data as a Colour Array

Declaration

Source position: fpimage.pp line 70

protected TFPPalette.FData: PFPColorArray;


TFPPalette.GetColor

GetColor - returns the colour value for the specified index

Declaration

Source position: fpimage.pp line 75

protected function TFPPalette.GetColor(

  index: Integer

):TFPColor;


TFPPalette.GetCount

GetCount - returns the number of colours in the palette

Declaration

Source position: fpimage.pp line 73

protected function TFPPalette.GetCount: Integer;


TFPPalette.IndexOf

IndexOf - returns the index value for the specified colour

Declaration

Source position: fpimage.pp line 84

public function TFPPalette.IndexOf(

  const AColor: TFPColor

):Integer; virtual;


TFPPalette.Merge

Merge the contents of another palette (pal) with the current palette

Declaration

Source position: fpimage.pp line 83

public procedure TFPPalette.Merge(

  pal: TFPPalette

); virtual;


TFPPalette.SetColor

SetColor - specifies the value of colour to be associated with the specified index

Declaration

Source position: fpimage.pp line 74

protected procedure TFPPalette.SetColor(

  index: Integer;

  const Value: TFPColor

); virtual;


TFPPalette.SetCount

SetCount - specify the number of colours in the palette

Declaration

Source position: fpimage.pp line 72

protected procedure TFPPalette.SetCount(

  Value: Integer

); virtual;


TIHData

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TIHData - data for Image Handler

Declaration

Source position: fpimage.pp line 220

type TIHData = class

end;

Inheritance

TIHData

TIHData - data for Image Handler
|

TObject


TIHData


TImageHandlersManager

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TImageHandlersManager - class for managing image handlers

Declaration

Source position: fpimage.pp line 227

type TImageHandlersManager = class
public
constructor Create; | Create - constructor fro TImageHandlersManager: calls inherited Create then constructs list of handlers
destructor Destroy; override; | Destroy - destructor for TImageHandlersManager: frees the list of handlers then calls inherited Destroy
procedure RegisterImageHandlers(); | RegisterImageHandlers - method for registering Image Handlers
procedure RegisterImageReader(); | RegisterImageReader - method to register an Image Reader
procedure RegisterImageWriter(); | RegisterImageWriter - method to register an Image Writer
property Count: Integer; [r] | Count - the number of Image Handlers
property ImageReader: TFPCustomImageReaderClass; [r] | The ImageReader being used
property ImageWriter: TFPCustomImageWriterClass; [r] | The ImageWriter being used
property Extentions: String; [r] | The filename Extentions for the image handlers
property DefaultExtention: String; [r] | The DefaultExtention to be used if no extention is supplied
property TypeNames: String; [r] | A list of TypeNames to be used with the handler files
end;

Inheritance

TImageHandlersManager

TImageHandlersManager - class for managing image handlers
|

TObject


TImageHandlersManager
 | ro | Count
 | ro | ImageReader
 | ro | ImageWriter
 | ro | Extentions
 | ro | DefaultExtention
 | ro | TypeNames


ro | Count (TImageHandlersManager)
ro | DefaultExtention (TImageHandlersManager)
ro | Extentions (TImageHandlersManager)
ro | ImageReader (TImageHandlersManager)
ro | ImageWriter (TImageHandlersManager)
ro | TypeNames (TImageHandlersManager)


TImageHandlersManager
 | Create
 | Destroy
 | RegisterImageHandlers
 | RegisterImageReader
 | RegisterImageWriter


Create (TImageHandlersManager)

Destroy (TImageHandlersManager)

RegisterImageHandlers (TImageHandlersManager)

RegisterImageReader (TImageHandlersManager)

RegisterImageWriter (TImageHandlersManager)


TImageHandlersManager


TImageHandlersManager.Count

Count - the number of Image Handlers

Declaration

Source position: fpimage.pp line 247

public property TImageHandlersManager.Count: Integer
  read GetCount;


TImageHandlersManager.Create

Create - constructor fro TImageHandlersManager: calls inherited Create then constructs list of handlers

Declaration

Source position: fpimage.pp line 239

public constructor TImageHandlersManager.Create;

See also

TObject.Create


TImageHandlersManager.DefaultExtention

The DefaultExtention to be used if no extention is supplied

Declaration

Source position: fpimage.pp line 251

public property TImageHandlersManager.DefaultExtention: String
  read GetDefExt;


TImageHandlersManager.Destroy

Destroy - destructor for TImageHandlersManager: frees the list of handlers then calls inherited Destroy

Declaration

Source position: fpimage.pp line 240

public destructor TImageHandlersManager.Destroy; override;

See also

TObject.Destroy


TImageHandlersManager.Extentions

The filename Extentions for the image handlers

Declaration

Source position: fpimage.pp line 250

public property TImageHandlersManager.Extentions: String
  read GetExt;


TImageHandlersManager.ImageReader

The ImageReader being used

Declaration

Source position: fpimage.pp line 248

public property TImageHandlersManager.ImageReader: TFPCustomImageReaderClass
  read GetReader;


TImageHandlersManager.ImageWriter

The ImageWriter being used

Declaration

Source position: fpimage.pp line 249

public property TImageHandlersManager.ImageWriter: TFPCustomImageWriterClass
  read GetWriter;


TImageHandlersManager.RegisterImageHandlers

RegisterImageHandlers - method for registering Image Handlers

Declaration

Source position: fpimage.pp line 241

public procedure TImageHandlersManager.RegisterImageHandlers(

  const ATypeName: String;

  const TheExtentions: String;

  AReader: TFPCustomImageReaderClass;

  AWriter: TFPCustomImageWriterClass

);


TImageHandlersManager.RegisterImageReader

RegisterImageReader - method to register an Image Reader

Declaration

Source position: fpimage.pp line 243

public procedure TImageHandlersManager.RegisterImageReader(

  const ATypeName: String;

  const TheExtentions: String;

  AReader: TFPCustomImageReaderClass

);


TImageHandlersManager.RegisterImageWriter

RegisterImageWriter - method to register an Image Writer

Declaration

Source position: fpimage.pp line 245

public procedure TImageHandlersManager.RegisterImageWriter(

  const ATypeName: String;

  const TheExtentions: String;

  AWriter: TFPCustomImageWriterClass

);


TImageHandlersManager.TypeNames

A list of TypeNames to be used with the handler files

Declaration

Source position: fpimage.pp line 252

public property TImageHandlersManager.TypeNames: String
  read GetTypeName;


TFPCustomTimer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Custom timer class

Declaration

Source position: fptimer.pp line 40

type TFPCustomTimer = class(TComponent)
protected
property Continue: Boolean; [rw]
procedure Timer; virtual;
function CreateTimerDriver;
public
constructor Create(); override; | Create a new timer
destructor Destroy; override; | Release a timer instance from memory
procedure StartTimer; virtual; | Start the timer
procedure StopTimer; virtual; | Stop the timer
protected
property Enabled: Boolean; [rw]
property Interval: Integer; [rw]
property OnTimer: TNotifyEvent; [rw]
end;

Inheritance

TFPCustomTimer

Custom timer class
|

TComponent
|

TObject

Description

TFPCustomTimer is the timer class containing the timer's implementation. It relies on an extra driver instance (of type TFPTimerDriver) to do the actual work.

TFPCustomTimer publishes no events or properties, so it is unsuitable for handling in an IDE. The TFPTimer descendent class publishes all needed events of TFPCustomTimer.

See also

TFPTimerDriver | Abstract driver class
TFPTimer | Timer class with published properties


TFPCustomTimer
pt |  | Continue
pt |  | Enabled
pt |  | Interval
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
pt |  | Continue (TFPCustomTimer)
 |  | DesignInfo (TComponent)
pt |  | Enabled (TFPCustomTimer)
pt |  | Interval (TFPCustomTimer)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TFPCustomTimer
pt | Timer
pt | CreateTimerDriver
 | Create
 | Destroy
 | StartTimer
 | StopTimer
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | Create (TComponent)
 | Create (TFPCustomTimer)
pt | CreateTimerDriver (TFPCustomTimer)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TFPCustomTimer)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | StartTimer (TFPCustomTimer)
 | StopTimer (TFPCustomTimer)
pt | Timer (TFPCustomTimer)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TFPCustomTimer

pt

OnTimer

TComponent


pt

OnTimer (TFPCustomTimer)


TFPCustomTimer.Continue

Declaration

Source position: fptimer.pp line 50

protected property TFPCustomTimer.Continue: Boolean
  read FContinue
  write FContinue;


TFPCustomTimer.Create

Create a new timer

Declaration

Source position: fptimer.pp line 54

public constructor TFPCustomTimer.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner of the timer instance

Description

Create instantiates a new TFPCustomTimer instance. It creates the timer driver instance from the DefaultTimerDriverClass class pointer.

See also

TFPCustomTimer.Destroy

Release a timer instance from memory


TFPCustomTimer.CreateTimerDriver

Declaration

Source position: fptimer.pp line 52

protected function TFPCustomTimer.CreateTimerDriver: TFPTimerDriver;


TFPCustomTimer.Destroy

Release a timer instance from memory

Declaration

Source position: fptimer.pp line 55

public destructor TFPCustomTimer.Destroy; override;

Description

Destroy releases the timer driver component from memory, and then calls Inherited to clean the TFPCustomTimer instance from memory.

See also

TFPCustomTimer.Create

Create a new timer


TFPCustomTimer.Enabled

Declaration

Source position: fptimer.pp line 59

protected property TFPCustomTimer.Enabled: Boolean
  read FEnabled
  write SetEnabled;


TFPCustomTimer.Interval

Declaration

Source position: fptimer.pp line 60

protected property TFPCustomTimer.Interval: Integer
  read FInterval
  write FInterval;


TFPCustomTimer.OnTimer

Declaration

Source position: fptimer.pp line 61

protected property TFPCustomTimer.OnTimer: TNotifyEvent
  read FOnTimer
  write FOnTimer;


TFPCustomTimer.StartTimer

Start the timer

Declaration

Source position: fptimer.pp line 56

public procedure TFPCustomTimer.StartTimer; virtual;

Description

StartTimer starts the timer. After a call to StartTimer, the timer will start producing timer ticks.

The timer stops producing ticks only when the StopTimer event is called.

See also

StopTimer | Stop the timer
Enabled | Start or stop the timer
OnTimer | Event called on each timer tick.


TFPCustomTimer.StopTimer

Stop the timer

Declaration

Source position: fptimer.pp line 57

public procedure TFPCustomTimer.StopTimer; virtual;

Description

Stoptimer stops a started timer. After a call to StopTimer, the timer no longer produces timer ticks.

See also

StartTimer | Start the timer
Enabled | Start or stop the timer
OnTimer | Event called on each timer tick.


TFPCustomTimer.Timer

Declaration

Source position: fptimer.pp line 51

protected procedure TFPCustomTimer.Timer; virtual;


TFPTimer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Timer class with published properties

Declaration

Source position: fptimer.pp line 64

type TFPTimer = class(TFPCustomTimer)
published
property Enabled; | Start or stop the timer
property Interval; | Timer tick interval in milliseconds.
property OnTimer; | Event called on each timer tick.
end;

Inheritance

TFPTimer | Timer class with published properties
|
TFPCustomTimer | Custom timer class
|
TComponent
|
TObject

Description

TFPTimer implements no new events or properties, but merely publishes events and properties already implemented in TFPCustomTimer: Enabled, OnTimer and Interval.

The TFPTimer class is suitable for use in an IDE.

See also

TFPCustomTimer | Custom timer class
Enabled | Start or stop the timer
OnTimer | Event called on each timer tick.
Interval | Timer tick interval in milliseconds.


TFPTimer
pl | ro | Enabled
pl | ro | Interval
TFPCustomTimer
pt |  | Continue
pt |  | Enabled
pt |  | Interval
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
pt |  | Continue (TFPCustomTimer)
 |  | DesignInfo (TComponent)
pt |  | Enabled (TFPCustomTimer)
pl | ro | Enabled (TFPTimer)
pt |  | Interval (TFPCustomTimer)
pl | ro | Interval (TFPTimer)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TFPTimer
TFPCustomTimer
pt | Timer
pt | CreateTimerDriver
 | Create
 | Destroy
 | StartTimer
 | StopTimer
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


TFPTimer
pl | ro | OnTimer
TFPCustomTimer
pt |  | OnTimer
TComponent


pt |  | OnTimer (TFPCustomTimer)
pl | ro | OnTimer (TFPTimer)


TFPTimer.Enabled

Start or stop the timer

Declaration

Source position: fptimer.pp line 66

published property TFPTimer.Enabled;

Description

Enabled controls whether the timer is active. Setting Enabled to True will start the timer (calling StartTimer), setting it to False will stop the timer (calling StopTimer).

See also

StartTimer | Start the timer
StopTimer | Stop the timer
OnTimer | Event called on each timer tick.
Interval | Timer tick interval in milliseconds.


TFPTimer.Interval

Timer tick interval in milliseconds.

Declaration

Source position: fptimer.pp line 67

published property TFPTimer.Interval;

Description

Interval specifies the timer interval in milliseconds. Every Interval milliseconds, the OnTimer event handler will be called.

Note that the milliseconds interval is a minimum interval. Under high system load, the timer tick may arrive later.

See also

OnTimer | Event called on each timer tick.
Enabled | Start or stop the timer


TFPTimer.OnTimer

Event called on each timer tick.

Declaration

Source position: fptimer.pp line 68

published property TFPTimer.OnTimer;

Description

OnTimer is called on each timer tick. The event handler must be assigned to a method that will do the actual work that should occur when the timer fires.

See also

Interval | Timer tick interval in milliseconds.
Enabled | Start or stop the timer


TFPTimerDriver

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract driver class

Declaration

Source position: fptimer.pp line 71

type TFPTimerDriver = class(TObject)
protected
FTimer: TFPCustomTimer;
public
constructor Create(); virtual; | Create new driver instance
procedure StartTimer; virtual; abstract; | Start the timer
procedure StopTimer; virtual; abstract; | Stop the timer
property Timer: TFPCustomTimer; [r] | Timer tick
end;

Inheritance

TFPTimerDriver

Abstract driver class
|

TObject

Description

TFPTimerDriver is the abstract timer driver class: it simply provides an interface for the TFPCustomTimer class to use.

The fpTimer unit implements a descendent of this class which implements the default timer mechanism.

See also

TFPCustomTimer | Custom timer class
DefaultTimerDriverClass | Actual timer class to be used


TFPTimerDriver

ro

Timer


ro

Timer (TFPTimerDriver)


TFPTimerDriver
 | Create
 | StartTimer
 | StopTimer


TFPTimerDriver


TFPTimerDriver.Create

Create new driver instance

Declaration

Source position: fptimer.pp line 75

public constructor TFPTimerDriver.Create(

  ATimer: TFPCustomTimer

); virtual;

Arguments

ATimer

Timer instance that created the driver

Description

Create should be overridden by descendents of TFPTimerDriver to do additional initialization of the timer driver. Create just stores (in Timer) a reference to the ATimer instance which created the driver instance.

See also

Timer | Timer tick
TFPTimer | Timer class with published properties


TFPTimerDriver.FTimer

Declaration

Source position: fptimer.pp line 73

protected TFPTimerDriver.FTimer: TFPCustomTimer;


TFPTimerDriver.StartTimer

Start the timer

Declaration

Source position: fptimer.pp line 76

public procedure TFPTimerDriver.StartTimer; virtual; abstract;

Description

StartTimer is called by TFPCustomTimer.StartTimer. It should be overridden by descendents of TFPTimerDriver to actually start the timer.

See also

TFPCustomTimer.StartTimer | Start the timer
TFPTimerDriver.StopTimer | Stop the timer


TFPTimerDriver.StopTimer

Stop the timer

Declaration

Source position: fptimer.pp line 77

public procedure TFPTimerDriver.StopTimer; virtual; abstract;

Description

StopTimer is called by TFPCustomTimer.StopTimer. It should be overridden by descendents of TFPTimerDriver to actually stop the timer.

See also

TFPCustomTimer.StopTimer | Stop the timer
TFPTimerDriver.StartTimer | Start the timer


TFPTimerDriver.Timer

Timer tick

Declaration

Source position: fptimer.pp line 78

public property TFPTimerDriver.Timer: TFPCustomTimer
  read FTimer;

Description

Timer calls the TFPCustomTimer timer event. Descendents of TFPTimerDriver should call Timer whenever a timer tick occurs.

See also

TFPTimer.OnTimer | Event called on each timer tick.
TFPTimerDriver.StartTimer | Start the timer
TFPTimerDriver.StopTimer | Stop the timer


TFPTimerDriverClass

Class of TFPTimerDriver

Declaration

Source position: fptimer.pp line 80

type TFPTimerDriverClass = class of TFPTimerDriver;

Description

TFPTimerDriverClass is the class pointer of TFPTimerDriver it exists mainly for the purpose of being able to set DefaultTimerDriverClass, so a custom timer driver can be used for the timer instances.

See also

DefaultTimerDriverClass

Actual timer class to be used


EMOFileError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised in case of an error.

Declaration

Source position: gettext.pp line 70

type EMOFileError = class(Exception) end;

Inheritance

EMOFileError

Exception raised in case of an error.
|

Exception
|

TObject

Description

EMOFileError is raised in case an TMOFile instance is created with an invalid .mo.

See also

TMOFile

Class providing access to a .mo file.


EMOFileError
Exception
 | HelpContext
 | Message


EMOFileError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EMOFileError

Exception


TMOFile

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class providing access to a .mo file.

Declaration

Source position: gettext.pp line 55

type TMOFile = class
protected
StringCount: LongWord;
HashTableSize: LongWord;
HashTable: PLongWordArray;
OrigTable: PMOStringTable;
TranslTable: PMOStringTable;
OrigStrings: PPCharArray;
TranslStrings: PPCharArray;
public
procedure Create(); | Create a new instance of the TMOFile class.
destructor Destroy; override; | Removes the TMOFile instance from memory
function Translate(); | Translate a string
end;

Inheritance

TMOFile

Class providing access to a .mo file.
|

TObject

Description

TMOFile is a class providing easy access to a .mo file. It can be used to translate any of the strings that reside in the .mo file. The internal structure of the .mo is completely hidden.


TMOFile


TMOFile
 | Create
 | Destroy
 | Translate


TMOFile.Create

Create a new instance of the TMOFile class.

Declaration

Source position: line 0

public constructor TMOFile.Create(

  const AFilename: String

);

constructor TMOFile.Create(

  AStream: TStream

);

Arguments

AFilename

File to open.

Arguments

AStream

Contents of a .mo file.

Description

Create creates a new instance of the MOFile class. It opens the file AFileName or the stream AStream. If a stream is provided, it should be seekable.

The whole contents of the file is read into memory during the Create call. This means that the stream is no longer needed after the Create call.

Errors

If the named file does not exist, then an exception may be raised. If the file does not contain a valid TMOFileHeader structure, then an EMOFileError exception is raised.

See also

TMOFile.Destroy

Removes the TMOFile instance from memory


TMOFile.Destroy

Removes the TMOFile instance from memory

Declaration

Source position: gettext.pp line 64

public destructor TMOFile.Destroy; override;

Description

Destroy cleans the internal structures with the contents of the .mo. After this the TMOFile instance is removed from memory.

See also

TMOFile.Create

Create a new instance of the TMOFile class.


TMOFile.HashTable

Declaration

Source position: gettext.pp line 58

protected TMOFile.HashTable: PLongWordArray;


TMOFile.HashTableSize

Declaration

Source position: gettext.pp line 57

protected TMOFile.HashTableSize: LongWord;


TMOFile.OrigStrings

Declaration

Source position: gettext.pp line 60

protected TMOFile.OrigStrings: PPCharArray;


TMOFile.OrigTable

Declaration

Source position: gettext.pp line 59

protected TMOFile.OrigTable: PMOStringTable;


TMOFile.StringCount

Declaration

Source position: gettext.pp line 57

protected TMOFile.StringCount: LongWord;


TMOFile.Translate

Translate a string

Declaration

Source position: line 0

public function TMOFile.Translate(

  AOrig: PChar;

  ALen: Integer;

  AHash: LongWord

):String;

function TMOFile.Translate(

  AOrig: String;

  AHash: LongWord

):String;

function TMOFile.Translate(

  AOrig: String

):String;

Arguments

AOrig | String to translate.
ALen | Length of the original string.
AHash | Hash value of the original string.

Function result

Translated string.

Arguments

AOrig | String to translate.
AHash | Hash value of the original string.

Function result

Translated string.

Arguments

AOrig

String to translate.

Function result

Translated string.

Description

Translate translates the string AOrig. The string should be in the .mo file as-is. The string can be given as a plain string, as a PChar (with length ALen). If the hash value (AHash) of the string is not given, it is calculated.

If the string is in the .mo file, the translated string is returned. If the string is not in the file, an empty string is returned.

Errors

None.


TMOFile.TranslStrings

Declaration

Source position: gettext.pp line 60

protected TMOFile.TranslStrings: PPCharArray;


TMOFile.TranslTable

Declaration

Source position: gettext.pp line 59

protected TMOFile.TranslTable: PMOStringTable;


TMOFileHeader

Structure found at the head of a .mo file.

Declaration

Source position: gettext.pp line 30

type TMOFileHeader = packed record
magic: LongWord; | Magic constant, should equal MOFileHeaderMagic.
revision: LongWord; | File revision
nstrings: LongWord; | Number of string pairs in the file
OrigTabOffset: LongWord; | Offset of the original strings description table.
TransTabOffset: LongWord; | Offset of the translated strings description table.
HashTabSize: LongWord; | Size of hashing table.
HashTabOffset: LongWord; | Offset of hashing table.
end;

Description

This structure describes the structure of a .mo file with string localizations.


EIDEAError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception for IDEA Stream errors.

Declaration

Source position: idea.pp line 72

type EIDEAError = class(EStreamError) end;

Inheritance

EIDEAError

Exception for IDEA Stream errors.
|

EStreamError
|

TObject

Description

EIDEAError is used to signal errors in the IDEA encryption decryption streams.


EIDEAError

EStreamError


TIDEADeCryptStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

IDEA Decryption stream.

Declaration

Source position: idea.pp line 102

type TIDEADeCryptStream = class(TIDEAStream)
public
constructor Create(); overload; | Constructor to create a new TIDEADecryptStream instance
function Read(); override; | Reads data from the stream, decrypting it as needed
function Seek(); override; | Set position on the stream
end;

Inheritance

TIDEADeCryptStream | IDEA Decryption stream.
|
TIDEAStream | Ancestor stream for IDEA encryption/decryption streams.
|
TOwnerStream
|
TObject

Description

TIDEADecryptStream is a stream which decrypts anything that is read from it using the IDEA mechanism. It reads the encrypted data from a source stream and decrypts it using the CipherIDEA algorithm. It is a read-only stream: it is not possible to write data to this stream.

When creating a TIDEADecryptStream instance, an IDEA decryption key should be passed to the constructor, as well as the stream from which encrypted data should be read written.

The encrypted data can be created with a TIDEAEncryptStream encryption stream.

See also

TIDEAEncryptStream | IDEA encryption stream.
TIDEAStream.Create | Creates a new instance of the TIDEAStream class
CipherIDEA | Encrypt or decrypt a buffer.


TIDEADeCryptStream
TIDEAStream
 | ro | Key
TOwnerStream
 | ro | Source
 |  | SourceOwner


ro | Key (TIDEAStream)
ro | Source (TOwnerStream)
 | SourceOwner (TOwnerStream)


TIDEADeCryptStream
 | Create
 | Read
 | Seek
TIDEAStream
pt | CreateCryptKey
 | Create
TOwnerStream
 | Create
 | Destroy


pt | CreateCryptKey (TIDEAStream)
 | Destroy (TOwnerStream)
 | Read (TIDEADeCryptStream)
 | Seek (TIDEADeCryptStream)


TIDEADeCryptStream

TIDEAStream

TOwnerStream


TIDEADeCryptStream.Create

Constructor to create a new TIDEADecryptStream instance

Declaration

Source position: idea.pp line 104

public constructor TIDEADeCryptStream.Create(

  const AKey: String;

  Dest: TStream

); overload;

Arguments

AKey | String to use as the encryption key
Dest | Source stream with encrypted data

Description

Create creates a new TIDEADecryptStream instance using the the string AKey to compute the encryption key, which is then passed on to the inherited constructor TIDEAStream.Create. It is an easy-access function which introduces no new functionality.

The string is truncated at the maximum length of the TIdeaCryptKey structure, so it makes no sense to provide a string with length longer than this structure.

See also

TIdeaCryptKey | Type for holding an encyption/decryption IDEA key.
TIDEAStream.Create | Creates a new instance of the TIDEAStream class
TIDEAEnCryptStream.Create | Constructor to create a new TIDEAEncryptStream instance


TIDEADeCryptStream.Read

Reads data from the stream, decrypting it as needed

Declaration

Source position: idea.pp line 105

public function TIDEADeCryptStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Buffer to place the descrypted data
Count | Number of bytes that should be read from the stream.

Function result

Number of bytes actually read.

Description

Read attempts to read Count bytes from the stream, placing them in Buffer the bytes are read from the source stream and decrypted as they are read. (bytes are read from the source stream in blocks of 8 bytes. The function returns the number of bytes actually read.

Errors

If an error occurs when reading data from the source stream, an exception may be raised.

See also

Write | Write data to the stream
Seek | Set position on the stream
TIDEAEncryptStream | IDEA encryption stream.


TIDEADeCryptStream.Seek

Set position on the stream

Declaration

Source position: idea.pp line 106

public function TIDEADeCryptStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset to apply to the position in the stream
Origin | Origin from where Offset should be counted.

Function result

New position in the stream

Description

Seek will only work on a forward seek. It emulates a forward seek by reading and discarding bytes from the input stream. The TIDEADecryptStream stream tries to provide seek capabilities for the following limited number of cases:

Origin=soFromBeginning
If Offset is larger than the current position, then the remaining bytes are skipped by reading them from the stream and discarding them.
Origin=soFromCurrent
If Offset is zero, the current position is returned. If it is positive, then Offset bytes are skipped by reading them from the stream and discarding them.

Errors

An EIDEAError exception is raised if the stream does not allow the requested seek operation.

See also

Read

Reads data from the stream, decrypting it as needed


TIDEAEncryptStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

IDEA encryption stream.

Declaration

Source position: idea.pp line 91

type TIDEAEncryptStream = class(TIDEAStream)
public
constructor Create(); overload; | Constructor to create a new TIDEAEncryptStream instance
destructor Destroy; override; | Flush data buffers and free the stream instance.
function Write(); override; | Write bytes to the stream to be encrypted
function Seek(); override; | Set stream position
procedure Flush; | Write remaining bytes from the stream
end;

Inheritance

TIDEAEncryptStream | IDEA encryption stream.
|
TIDEAStream | Ancestor stream for IDEA encryption/decryption streams.
|
TOwnerStream
|
TObject

Description

TIDEAEncryptStream is a stream which encrypts anything that is written to it using the IDEA mechanism, and then writes the encrypted data to the destination stream using the CipherIDEA algorithm. It is a write-only stream: it is not possible to read data from this stream.

When creating a TIDEAEncryptStream instance, an IDEA encryption key should be passed to the constructor, as well as the stream to which encrypted data should be written.

The resulting encrypted data can be read again with a TIDEADecryptStream decryption stream.

See also

TIDEADecryptStream | IDEA Decryption stream.
TIDEAStream.Create | Creates a new instance of the TIDEAStream class
CipherIDEA | Encrypt or decrypt a buffer.


TIDEAEncryptStream
TIDEAStream
 | ro | Key
TOwnerStream
 | ro | Source
 |  | SourceOwner


TIDEAEncryptStream
 | Create
 | Destroy
 | Write
 | Seek
 | Flush
TIDEAStream
pt | CreateCryptKey
 | Create
TOwnerStream
 | Create
 | Destroy


pt | CreateCryptKey (TIDEAStream)
 | Destroy (TOwnerStream)
 | Destroy (TIDEAEncryptStream)
 | Flush (TIDEAEncryptStream)
 | Seek (TIDEAEncryptStream)
 | Write (TIDEAEncryptStream)


TIDEAEncryptStream

TIDEAStream

TOwnerStream


TIDEAEncryptStream.Create

Constructor to create a new TIDEAEncryptStream instance

Declaration

Source position: idea.pp line 93

public constructor TIDEAEncryptStream.Create(

  const AKey: String;

  Dest: TStream

); overload;

Arguments

AKey | String to use as key data.
Dest | Destination stream for encrypted data

Description

Create creates a new TIDEAEncryptStream instance using the the string AKey to compute the encryption key, which is then passed on to the inherited constructor TIDEAStream.Create. It is an easy-access function which introduces no new functionality.

The string is truncated at the maximum length of the TIdeaCryptKey structure, so it makes no sense to provide a string with length longer than this structure.

See also

TIdeaCryptKey | Type for holding an encyption/decryption IDEA key.
TIDEAStream.Create | Creates a new instance of the TIDEAStream class
TIDEADeCryptStream.Create | Constructor to create a new TIDEADecryptStream instance


TIDEAEncryptStream.Destroy

Flush data buffers and free the stream instance.

Declaration

Source position: idea.pp line 94

public destructor TIDEAEncryptStream.Destroy; override;

Description

Destroy flushes any data still remaining in the internal encryption buffer, and then calls the inherited Destroy

By default, the destination stream is not freed when the encryption stream is freed.

Errors

None.

See also

TIDEAStream.Create

Creates a new instance of the TIDEAStream class


TIDEAEncryptStream.Flush

Write remaining bytes from the stream

Declaration

Source position: idea.pp line 97

public procedure TIDEAEncryptStream.Flush;

Description

Flush writes the current encryption buffer to the stream. Encryption always happens in blocks of 8 bytes, so if the buffer is not completely filled at the end of the writing operations, it must be flushed. It should never be called directly, unless at the end of all writing operations. It is called automatically when the stream is destroyed.

Errors

None.

See also

Write

Write bytes to the stream to be encrypted


TIDEAEncryptStream.Seek

Set stream position

Declaration

Source position: idea.pp line 96

public function TIDEAEncryptStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Number of bytes to move stream pointer
Origin | Where to move stream pointer from

Function result

New location after seek operation

Description

Seek return the current position if called with 0 and soFromCurrent as arguments. With all other values, it will always raise an exception, since it is impossible to set the position on an encryption stream.

Errors

An EIDEAError will be raised unless called with 0 and soFromCurrent as arguments.

See also

Write | Write bytes to the stream to be encrypted
EIDEAError | Exception for IDEA Stream errors.


TIDEAEncryptStream.Write

Write bytes to the stream to be encrypted

Declaration

Source position: idea.pp line 95

public function TIDEAEncryptStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Buffer containing data to be written
Count | Number of bytes to write.

Function result

Number of bytes actually written.

Description

Write writes Count bytes from Buffer to the stream, encrypting the bytes as they are written (encryption in blocks of 8 bytes).

Errors

If an error occurs writing to the destination stream, an error may occur.

See also

Read

Reads data from the stream, decrypting it as needed


TIDEAStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ancestor stream for IDEA encryption/decryption streams.

Declaration

Source position: idea.pp line 76

type TIDEAStream = class(TOwnerStream)
protected
procedure CreateCryptKey();
public
constructor Create(); overload; | Creates a new instance of the TIDEAStream class
property Key: TIDEAKey; [r] | Key used when encrypting/decrypting
end;

Inheritance

TIDEAStream

Ancestor stream for IDEA encryption/decryption streams.
|

TOwnerStream
|

TObject

Description

Do not create instances of TIDEAStream directly. It implements no useful functionality: it serves as a common ancestor of the TIDEAEncryptStream and TIDEADeCryptStream, and simply provides some fields that these descendent classes use when encrypting/decrypting. One of these classes should be created, depending on whether one wishes to encrypt or to decrypt.

See also

TIDEAEncryptStream | IDEA encryption stream.
TIDEADeCryptStream | IDEA Decryption stream.


TIDEAStream
 | ro | Key
TOwnerStream
 | ro | Source
 |  | SourceOwner


TIDEAStream
pt | CreateCryptKey
 | Create
TOwnerStream
 | Create
 | Destroy


pt | CreateCryptKey (TIDEAStream)
 | Destroy (TOwnerStream)


TIDEAStream

TOwnerStream


TIDEAStream.Create

Creates a new instance of the TIDEAStream class

Declaration

Source position: idea.pp line 85

public constructor TIDEAStream.Create(

  AKey: TIDEAKey;

  Dest: TStream

); overload;

Arguments

AKey | Key to use for encryption/decryption
Dest | Stream to write encrypted data to/read encrypted data from

Description

Create stores the encryption/decryption key and then calls the inherited Create to store the Dest stream.

Errors

None.

See also

TIDEAEncryptStream | IDEA encryption stream.
TIDEADeCryptStream | IDEA Decryption stream.


TIDEAStream.CreateCryptKey

Declaration

Source position: idea.pp line 83

protected procedure TIDEAStream.CreateCryptKey(

  const S: String;

  var Key: TIdeaCryptKey

);


TIDEAStream.Key

Key used when encrypting/decrypting

Declaration

Source position: idea.pp line 86

public property TIDEAStream.Key: TIDEAKey
  read FKey;

Description

Key is the key as it was passed to the constructor of the stream. It cannot be changed while data is read or written. It is the key as it is used when encrypting/decrypting.

See also

CipherIdea

Encrypt or decrypt a buffer.


EIniCol

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception used for error reporting.

Declaration

Source position: inicol.pp line 76

type EIniCol = class(Exception) end;

Inheritance

EIniCol

Exception used for error reporting.
|

Exception
|

TObject

Description

EIniCol is used to report error conditions in the load and save methods of TIniCollection.


EIniCol
Exception
 | HelpContext
 | Message


EIniCol
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EIniCol

Exception


TIniCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection which can write itself to an .ini file

Declaration

Source position: inicol.pp line 25

type TIniCollection = class(TCollection)
protected
FPrefix: String;
FSectionPrefix: String;
public
procedure Load; | Loads the collection from the default filename.
procedure Save; | Save the collection to the default filename.
procedure SaveToIni(); virtual; | Save the collection to a TCustomIniFile descendent
procedure SaveToFile(); | Save collection to a file in .ini file format
procedure LoadFromIni(); virtual; | Load collection from a file in .ini file format.
procedure LoadFromFile(); | Load collection from file.
property Prefix: String; [r] | Prefix used in global section
property SectionPrefix: String; [r] | Prefix string for section names
property FileName: String; [rw] | Filename of the collection
property GlobalSection: String; [rw] | Name of the global section
end;

Inheritance

TIniCollection

Collection which can write itself to an .ini file
|

TCollection
|

TObject

Description

TIniCollection is a collection descendent which has the capability to write itself to an .ini file. It introduces some load and save mechanisms, which can be used to write all items in the collection to disk. The items should be descendents of the type TIniCollectionItem.

All methods work using a TCustomInifile class, making it possible to save to alternate file formats, or even databases.

An instance of TIniCollection should never be used directly. Instead, a descendent should be used, which sets the FPrefix and FSectionPrefix protected variables.

See also

TIniCollection.LoadFromFile | Load collection from file.
TIniCollection.LoadFromIni | Load collection from a file in .ini file format.
TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent
TIniCollection.SaveToFile | Save collection to a file in .ini file format


TIniCollection
 | ro | Prefix
 | ro | SectionPrefix
 |  | FileName
 |  | GlobalSection
TCollection
 |  | PropName
 | ro | UpdateCount
 | ro | Count
 | ro | ItemClass
 |  | Items


ro | Count (TCollection)
 | FileName (TIniCollection)
 | GlobalSection (TIniCollection)
ro | ItemClass (TCollection)
 | Items (TCollection)
ro | Prefix (TIniCollection)
 | PropName (TCollection)
ro | SectionPrefix (TIniCollection)
ro | UpdateCount (TCollection)


TIniCollection
 | Load
 | Save
 | SaveToIni
 | SaveToFile
 | LoadFromIni
 | LoadFromFile
TCollection
 | GetCount
 | GetPropName
 | InsertItem
 | RemoveItem
 | GetAttrCount
 | GetAttr
 | GetItemAttr
 | Changed
 | GetItem
 | SetItem
 | SetItemName
 | SetPropName
 | Update
 | Notify
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetNamePath
 | Insert
 | FindItemID
 | Sort


Add (TCollection)

Assign (TCollection)

BeginUpdate (TCollection)

Changed (TCollection)

Clear (TCollection)

Create (TCollection)

Delete (TCollection)

Destroy (TCollection)

EndUpdate (TCollection)

FindItemID (TCollection)

GetAttr (TCollection)

GetAttrCount (TCollection)

GetCount (TCollection)

GetItem (TCollection)

GetItemAttr (TCollection)

GetNamePath (TCollection)

GetPropName (TCollection)

Insert (TCollection)

InsertItem (TCollection)

Load (TIniCollection)

LoadFromFile (TIniCollection)

LoadFromIni (TIniCollection)

Notify (TCollection)

Owner (TCollection)

RemoveItem (TCollection)

Save (TIniCollection)

SaveToFile (TIniCollection)

SaveToIni (TIniCollection)

SetItem (TCollection)

SetItemName (TCollection)

SetPropName (TCollection)

Sort (TCollection)

Update (TCollection)


TIniCollection

TCollection


TIniCollection.FileName

Filename of the collection

Declaration

Source position: inicol.pp line 41

public property TIniCollection.FileName: String
  read FFileName
  write FFileName;

Description

FileName is the filename as used in the last LoadFromFile or SaveToFile operation. It is used in the Load or Save calls.

See also

Save | Save the collection to the default filename.
LoadFromFile | Load collection from file.
SaveToFile | Save collection to a file in .ini file format
Load | Loads the collection from the default filename.


TIniCollection.FPrefix

Declaration

Source position: inicol.pp line 30

protected TIniCollection.FPrefix: String;


TIniCollection.FSectionPrefix

Declaration

Source position: inicol.pp line 31

protected TIniCollection.FSectionPrefix: String;


TIniCollection.GlobalSection

Name of the global section

Declaration

Source position: inicol.pp line 42

public property TIniCollection.GlobalSection: String
  read FGlobalSection
  write FGlobalSection;

Description

GlobalSection contains the value of the Section argument in the LoadFromIni or SaveToIni calls. It's used in the Load or Save calls.

See also

Save | Save the collection to the default filename.
LoadFromFile | Load collection from file.
SaveToFile | Save collection to a file in .ini file format
Load | Loads the collection from the default filename.


TIniCollection.Load

Loads the collection from the default filename.

Declaration

Source position: inicol.pp line 33

public procedure TIniCollection.Load;

Description

Load loads the collection from the file as specified in the FileName property. It calls the LoadFromFile method to do this.

Errors

If the collection was not loaded or saved to file before this call, an EIniCol exception will be raised.

See also

TIniCollection.LoadFromFile | Load collection from file.
TIniCollection.LoadFromIni | Load collection from a file in .ini file format.
TIniCollection.Save | Save the collection to the default filename.
FileName | Filename of the collection


TIniCollection.LoadFromFile

Load collection from file.

Declaration

Source position: inicol.pp line 38

public procedure TIniCollection.LoadFromFile(

  AFileName: String;

  Section: String

);

Arguments

AFileName | Filename to load collection from
Section | Section to use as global section

Description

LoadFromFile creates a TMemIniFile instance using AFileName as the filename. It calls LoadFromIni using this instance and Section as the parameters.

See also

TIniCollection.LoadFromIni | Load collection from a file in .ini file format.
TIniCollection.Load | Loads the collection from the default filename.
TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent
TIniCollection.SaveToFile | Save collection to a file in .ini file format


TIniCollection.LoadFromIni

Load collection from a file in .ini file format.

Declaration

Source position: inicol.pp line 37

public procedure TIniCollection.LoadFromIni(

  Ini: TCustomInifile;

  Section: String

); virtual;

Arguments

Ini | Ini object to load data from.
Section | Name of the global section.

Description

LoadFromIni will load the collection from the Ini instance. It first clears the collection, and reads the number of items from the global section with the name as passed through the Section argument. After this, an item is created and added to the collection, and its data is read by calling the TIniCollectionItem.LoadFromIni method, passing the appropriate section name as found in the global section.

The description of the global section can be found in the TIniCollection.SaveToIni method description.

See also

TIniCollection.LoadFromFile | Load collection from file.
TIniCollectionItem.LoadFromIni | Method called when the item must be loaded
TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent


TIniCollection.Prefix

Prefix used in global section

Declaration

Source position: inicol.pp line 39

public property TIniCollection.Prefix: String
  read FPrefix;

Description

Prefix is used when writing the section names of the items in the collection to the global section, or when reading the names from the global section. If the prefix is set to Item then the global section might look something like this:

[MyCollection]
Count=2
Item1=FirstItem
Item2=SecondItem

A descendent of TIniCollection should set the value of this property, it cannot be empty.

See also

TIniCollection.SectionPrefix | Prefix string for section names
TIniCollection.GlobalSection | Name of the global section


TIniCollection.Save

Save the collection to the default filename.

Declaration

Source position: inicol.pp line 34

public procedure TIniCollection.Save;

Description

Save writes the collection to the file as specified in the FileName property, using GlobalSection as the section. It calls the SaveToFile method to do this.

Errors

If the collection was not loaded or saved to file before this call, an EIniCol exception will be raised.

See also

TIniCollection.SaveToFile | Save collection to a file in .ini file format
TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent
TIniCollection.Load | Loads the collection from the default filename.
FileName | Filename of the collection


TIniCollection.SaveToFile

Save collection to a file in .ini file format

Declaration

Source position: inicol.pp line 36

public procedure TIniCollection.SaveToFile(

  AFileName: String;

  Section: String

);

Arguments

AFileName | File to save collection to.
Section | Section name for global section.

Description

SaveToFile will create a TMemIniFile instance with the AFileName argument as a filename. This instance is passed on to the SaveToIni method, together with the Section argument, to do the actual saving.

Errors

An exception may be raised if the path in AFileName does not exist.

See also

TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent
TIniCollection.LoadFromFile | Load collection from file.


TIniCollection.SaveToIni

Save the collection to a TCustomIniFile descendent

Declaration

Source position: inicol.pp line 35

public procedure TIniCollection.SaveToIni(

  Ini: TCustomInifile;

  Section: String

); virtual;

Arguments

Ini | Inifile class to use when writing data.
Section | Section to which to write the global data

Description

SaveToIni does the actual writing. It writes the number of elements in the global section (as specified by the Section argument), as well as the section name for each item in the list. The item names are written using the Prefix property for the key. After this it calls the SaveToIni method of all TIniCollectionItem instances.

This means that the global section of the .ini file will look something like this:

[globalsection]
Count=3
Prefix1=SectionPrefixFirstItemName
Prefix2=SectionPrefixSecondItemName
Prefix3=SectionPrefixThirdItemName

This construct allows to re-use an ini file for multiple collections.

After this method is called, the GlobalSection property contains the value of Section, it will be used in the Save method.

See also

TIniCollectionItem.SaveToIni

Method called when the item must be saved


TIniCollection.SectionPrefix

Prefix string for section names

Declaration

Source position: inicol.pp line 40

public property TIniCollection.SectionPrefix: String
  read FSectionPrefix;

Description

SectionPrefix is a string that is prepended to the section name as returned by the TIniCollectionItem.SectionName property to return the exact section name. It can be empty.

See also

TIniCollection.Section

TIniCollection.GlobalSection

Name of the global section


TIniCollectionItem

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection item with support for loading/saving from/to ini file

Declaration

Source position: inicol.pp line 13

type TIniCollectionItem = class(TCollectionItem)
protected
function GetSectionName; virtual; abstract;
procedure SetSectionName(); virtual; abstract;
public
procedure SaveToIni(); virtual; abstract; | Method called when the item must be saved
procedure LoadFromIni(); virtual; abstract; | Method called when the item must be loaded
procedure SaveToFile(); | Save item to a file
procedure LoadFromFile(); | Load item from a file
property SectionName: String; [rw] | Default section name
end;

Inheritance

TIniCollectionItem

Collection item with support for loading/saving from/to ini file
|

TCollectionItem
|

TObject

Description

TIniCollectionItem is a #rtl.classes.tcollectionitem descendent which has some extra methods for saving/loading the item to or from an .ini file.

To use this class, a descendent should be made, and the SaveToIni and LoadFromIni methods should be overridden. They should implement the actual loading and saving. The loading and saving is always initiated by the methods in TIniCollection, TIniCollection.LoadFromIni and TIniCollection.SaveToIni respectively.

See also

TIniCollection | Collection which can write itself to an .ini file
TIniCollectionItem.SaveToIni | Method called when the item must be saved
TIniCollectionItem.LoadFromIni | Method called when the item must be loaded
TIniCollection.LoadFromIni | Load collection from a file in .ini file format.
TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent


TIniCollectionItem
 |  | SectionName
TCollectionItem
 | ro | UpdateCount
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName


ro | ID (TCollectionItem)
 | Index (TCollectionItem)
 | SectionName (TIniCollectionItem)
ro | UpdateCount (TCollectionItem)


TIniCollectionItem
pt | GetSectionName
pt | SetSectionName
 | SaveToIni
 | LoadFromIni
 | SaveToFile
 | LoadFromFile
TCollectionItem
 | GetIndex
 | SetCollection
 | Changed
 | GetOwner
 | GetDisplayName
 | SetIndex
 | SetDisplayName
 | Create
 | Destroy
 | GetNamePath


 | Changed (TCollectionItem)
 | Create (TCollectionItem)
 | Destroy (TCollectionItem)
 | GetDisplayName (TCollectionItem)
 | GetIndex (TCollectionItem)
 | GetNamePath (TCollectionItem)
 | GetOwner (TCollectionItem)
pt | GetSectionName (TIniCollectionItem)
 | LoadFromFile (TIniCollectionItem)
 | LoadFromIni (TIniCollectionItem)
 | SaveToFile (TIniCollectionItem)
 | SaveToIni (TIniCollectionItem)
 | SetCollection (TCollectionItem)
 | SetDisplayName (TCollectionItem)
 | SetIndex (TCollectionItem)
pt | SetSectionName (TIniCollectionItem)


TIniCollectionItem

TCollectionItem


TIniCollectionItem.GetSectionName

Declaration

Source position: inicol.pp line 15

protected function TIniCollectionItem.GetSectionName: String; virtual; abstract;


TIniCollectionItem.LoadFromFile

Load item from a file

Declaration

Source position: inicol.pp line 21

public procedure TIniCollectionItem.LoadFromFile(

  FileName: String;

  Section: String

);

Arguments

FileName | Filename from which to load item
Section | Section from which to load

Description

LoadFromFile creates an instance of TMemIniFile and calls LoadFromIni to load the item from the indicated file in .ini format from the section Section.

Errors

None.

See also

SaveToFile | Save item to a file
LoadFromIni | Method called when the item must be loaded


TIniCollectionItem.LoadFromIni

Method called when the item must be loaded

Declaration

Source position: inicol.pp line 19

public procedure TIniCollectionItem.LoadFromIni(

  Ini: TCustomInifile;

  Section: String

); virtual; abstract;

Arguments

Ini | TCustomIniFile instance from which the item should be loaded
Section | Section from which data should be loaded.

Description

LoadFromIni is called by TIniCollection.LoadFromIni when it saves this item. Descendent classes should override this method to load the data they need to load. All read methods of the TCustomIniFile instance passed in Ini can be used, as long as the reading happens in the section passed in Section.

Errors

No checking is done to see whether the values are actually read from the correct section.

See also

TIniCollection.LoadFromIni | Load collection from a file in .ini file format.
SaveToIni | Method called when the item must be saved
LoadFromFile | Load item from a file
SaveToFile | Save item to a file


TIniCollectionItem.SaveToFile

Save item to a file

Declaration

Source position: inicol.pp line 20

public procedure TIniCollectionItem.SaveToFile(

  FileName: String;

  Section: String

);

Arguments

FileName | Name of file to which the item should be saved.
Section | Section under which the item should be saved.

Description

SaveToFile creates an instance of TIniFile with the indicated FileName calls SaveToIni to save the item to the indicated file in .ini format under the section Section

Errors

An exception can occur if the file is not writeable.

See also

SaveToIni | Method called when the item must be saved
LoadFromFile | Load item from a file


TIniCollectionItem.SaveToIni

Method called when the item must be saved

Declaration

Source position: inicol.pp line 18

public procedure TIniCollectionItem.SaveToIni(

  Ini: TCustomInifile;

  Section: String

); virtual; abstract;

Arguments

Ini | TCustomIniFile instance to which the item should be saved
Section | Section under which data should be saved.

Description

SaveToIni is called by TIniCollection.SaveToIni when it saves this item. Descendent classes should override this method to save the data they need to save. All write methods of the TCustomIniFile instance passed in Ini can be used, as long as the writing happens in the section passed in Section.

Errors

No checking is done to see whether the values are actually written to the correct section.

See also

TIniCollection.SaveToIni | Save the collection to a TCustomIniFile descendent
LoadFromIni | Method called when the item must be loaded
SaveToFile | Save item to a file
LoadFromFile | Load item from a file


TIniCollectionItem.SectionName

Default section name

Declaration

Source position: inicol.pp line 22

public property TIniCollectionItem.SectionName: String
  read GetSectionName
  write SetSectionName;

Description

SectionName is the section name under which the item will be saved or from which it should be read. The read/write functions should be overridden in descendents to determine a unique section name within the .ini file.

See also

SaveToFile | Save item to a file
LoadFromIni | Method called when the item must be loaded


TIniCollectionItem.SetSectionName

Declaration

Source position: inicol.pp line 16

protected procedure TIniCollectionItem.SetSectionName(

  const Value: String

); virtual; abstract;


TNamedIniCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of named collection items

Declaration

Source position: inicol.pp line 64

type TNamedIniCollection = class(TIniCollection)
public
function IndexOfUserData(); | Search for an item based on it's UserData property
function IndexOfName(); | Search for an item, based on its name, and return its position
function FindByName(); | Return the item based on its name
function FindByUserData(); | Return the item based on its UserData
property NamedItems: TNamedIniCollectionItem; default; [rw] | Indexed access to the TNamedIniCollectionItem items
end;

Inheritance

TNamedIniCollection | Collection of named collection items
|
TIniCollection | Collection which can write itself to an .ini file
|
TCollection
|
TObject

Description

TNamedIniCollection is the collection to go with the TNamedIniCollectionItem item class. it provides some functions to look for items based on the UserData or based on the Name.

See also

TNamedIniCollectionItem | TIniCollectionItem with a name property
IndexOfUserData | Search for an item based on it's UserData property
IndexOfName | Search for an item, based on its name, and return its position


TNamedIniCollection
 |  | NamedItems
TIniCollection
 | ro | Prefix
 | ro | SectionPrefix
 |  | FileName
 |  | GlobalSection
TCollection
 |  | PropName
 | ro | UpdateCount
 | ro | Count
 | ro | ItemClass
 |  | Items


ro | Count (TCollection)
 | FileName (TIniCollection)
 | GlobalSection (TIniCollection)
ro | ItemClass (TCollection)
 | Items (TCollection)
 | NamedItems (TNamedIniCollection)
ro | Prefix (TIniCollection)
 | PropName (TCollection)
ro | SectionPrefix (TIniCollection)
ro | UpdateCount (TCollection)


TNamedIniCollection
 | IndexOfUserData
 | IndexOfName
 | FindByName
 | FindByUserData
TIniCollection
 | Load
 | Save
 | SaveToIni
 | SaveToFile
 | LoadFromIni
 | LoadFromFile
TCollection
 | GetCount
 | GetPropName
 | InsertItem
 | RemoveItem
 | GetAttrCount
 | GetAttr
 | GetItemAttr
 | Changed
 | GetItem
 | SetItem
 | SetItemName
 | SetPropName
 | Update
 | Notify
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetNamePath
 | Insert
 | FindItemID
 | Sort


Add (TCollection)

Assign (TCollection)

BeginUpdate (TCollection)

Changed (TCollection)

Clear (TCollection)

Create (TCollection)

Delete (TCollection)

Destroy (TCollection)

EndUpdate (TCollection)

FindByName (TNamedIniCollection)

FindByUserData (TNamedIniCollection)

FindItemID (TCollection)

GetAttr (TCollection)

GetAttrCount (TCollection)

GetCount (TCollection)

GetItem (TCollection)

GetItemAttr (TCollection)

GetNamePath (TCollection)

GetPropName (TCollection)

IndexOfName (TNamedIniCollection)

IndexOfUserData (TNamedIniCollection)

Insert (TCollection)

InsertItem (TCollection)

Load (TIniCollection)

LoadFromFile (TIniCollection)

LoadFromIni (TIniCollection)

Notify (TCollection)

Owner (TCollection)

RemoveItem (TCollection)

Save (TIniCollection)

SaveToFile (TIniCollection)

SaveToIni (TIniCollection)

SetItem (TCollection)

SetItemName (TCollection)

SetPropName (TCollection)

Sort (TCollection)

Update (TCollection)


TNamedIniCollection

TIniCollection

TCollection


TNamedIniCollection.FindByName

Return the item based on its name

Declaration

Source position: inicol.pp line 71

public function TNamedIniCollection.FindByName(

  const AName: String

):TNamedIniCollectionItem;

Arguments

AName

Name to look for

Function result

Named item, or Nil if none was found

Description

FindByName returns the collection item whose name matches AName (case insensitive match). It calls IndexOfName and returns the item at the found position. If no item is found, Nil is returned.

Errors

If no item is found, Nil is returned.

See also

IndexOfName | Search for an item, based on its name, and return its position
FindByUserData | Return the item based on its UserData


TNamedIniCollection.FindByUserData

Return the item based on its UserData

Declaration

Source position: inicol.pp line 72

public function TNamedIniCollection.FindByUserData(

  UserData: TObject

):TNamedIniCollectionItem;

Arguments

UserData

Userdata to look for

Function result

Found item, or Nil if none was found.

Description

FindByName returns the collection item whose UserData property value matches the UserData parameter. If no item is found, Nil is returned.

Errors

If no item is found, Nil is returned.


TNamedIniCollection.IndexOfName

Search for an item, based on its name, and return its position

Declaration

Source position: inicol.pp line 70

public function TNamedIniCollection.IndexOfName(

  const AName: String

):Integer;

Arguments

AName

Name to look for (case insensitive)

Function result

Index of found item or -1 if none was found

Description

IndexOfName searches the list of items and returns the index of the item which has name equal to AName (case insentitive). If no such item exists, -1 is returned.

Note that the (linear) search starts at the last element and works it's way back to the first.

Errors

If no item exists, -1 is returned.

See also

IndexOfUserData | Search for an item based on it's UserData property
TNamedIniCollectionItem.Name | Name of the item


TNamedIniCollection.IndexOfUserData

Search for an item based on it's UserData property

Declaration

Source position: inicol.pp line 69

public function TNamedIniCollection.IndexOfUserData(

  UserData: TObject

):Integer;

Arguments

UserData

UserData to search for

Function result

Index of found item, or -1 if none was found

Description

IndexOfUserData searches the list of items and returns the index of the item which has UserData in its UserData property. If no such item exists, -1 is returned.

Note that the (linear) search starts at the last element and works it's way back to the first.

Errors

If no item exists, -1 is returned.

See also

IndexOfName | Search for an item, based on its name, and return its position
TNamedIniCollectionItem.UserData | User-defined data


TNamedIniCollection.NamedItems

Indexed access to the TNamedIniCollectionItem items

Declaration

Source position: inicol.pp line 73

public property TNamedIniCollection.NamedItems: TNamedIniCollectionItem
  read GetNamedItem
  write SetNamedItem;
  default;

Description

NamedItem is the default property of the TNamedIniCollection collection. It allows indexed access to the TNamedIniCollectionItem items. The index is zero based.

See also

TNamedIniCollectionItem

TIniCollectionItem with a name property


TNamedIniCollectionItem

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TIniCollectionItem with a name property

Declaration

Source position: inicol.pp line 47

type TNamedIniCollectionItem = class(TIniCollectionItem)
protected
FName: String;
FUserData: TObject;
procedure SetCollection(); override;
function GetSectionName; override;
procedure SetSectionName(); override;
public
property UserData: TObject; [rw] | User-defined data
published
property Name: String; [rw] | Name of the item
end;

Inheritance

TNamedIniCollectionItem | TIniCollectionItem with a name property
|
TIniCollectionItem | Collection item with support for loading/saving from/to ini file
|
TCollectionItem
|
TObject

Description

TNamedIniCollectionItem is a TIniCollectionItem descent with a published name property. The name is used as the section name when saving the item to the ini file.

See also

TIniCollectionItem

Collection item with support for loading/saving from/to ini file


TNamedIniCollectionItem
 |  | UserData
pl |  | Name
TIniCollectionItem
 |  | SectionName
TCollectionItem
 | ro | UpdateCount
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName


 | ro | ID (TCollectionItem)
 |  | Index (TCollectionItem)
pl |  | Name (TNamedIniCollectionItem)
 |  | SectionName (TIniCollectionItem)
 | ro | UpdateCount (TCollectionItem)
 |  | UserData (TNamedIniCollectionItem)


TNamedIniCollectionItem
pt | SetCollection
pt | GetSectionName
pt | SetSectionName
TIniCollectionItem
pt | GetSectionName
pt | SetSectionName
 | SaveToIni
 | LoadFromIni
 | SaveToFile
 | LoadFromFile
TCollectionItem
 | GetIndex
 | SetCollection
 | Changed
 | GetOwner
 | GetDisplayName
 | SetIndex
 | SetDisplayName
 | Create
 | Destroy
 | GetNamePath


 | Changed (TCollectionItem)
 | Create (TCollectionItem)
 | Destroy (TCollectionItem)
 | GetDisplayName (TCollectionItem)
 | GetIndex (TCollectionItem)
 | GetNamePath (TCollectionItem)
 | GetOwner (TCollectionItem)
pt | GetSectionName (TIniCollectionItem)
pt | GetSectionName (TNamedIniCollectionItem)
 | LoadFromFile (TIniCollectionItem)
 | LoadFromIni (TIniCollectionItem)
 | SaveToFile (TIniCollectionItem)
 | SaveToIni (TIniCollectionItem)
 | SetCollection (TCollectionItem)
pt | SetCollection (TNamedIniCollectionItem)
 | SetDisplayName (TCollectionItem)
 | SetIndex (TCollectionItem)
pt | SetSectionName (TIniCollectionItem)
pt | SetSectionName (TNamedIniCollectionItem)


TNamedIniCollectionItem

TIniCollectionItem

TCollectionItem


TNamedIniCollectionItem.FName

Declaration

Source position: inicol.pp line 51

protected TNamedIniCollectionItem.FName: String;


TNamedIniCollectionItem.FUserData

Declaration

Source position: inicol.pp line 52

protected TNamedIniCollectionItem.FUserData: TObject;


TNamedIniCollectionItem.GetSectionName

Declaration

Source position: inicol.pp line 55

protected function TNamedIniCollectionItem.GetSectionName: String; override;


TNamedIniCollectionItem.Name

Name of the item

Declaration

Source position: inicol.pp line 60

published property TNamedIniCollectionItem.Name: String
  read FName
  write SetName;

Description

Name is the name of this item. It is also used as the section name when writing the collection item to the .ini file.

See also

TNamedIniCollectionItem.UserData

User-defined data


TNamedIniCollectionItem.SetCollection

Declaration

Source position: inicol.pp line 54

protected procedure TNamedIniCollectionItem.SetCollection(

  Value: TCollection

); override;


TNamedIniCollectionItem.SetSectionName

Declaration

Source position: inicol.pp line 56

protected procedure TNamedIniCollectionItem.SetSectionName(

  const Value: String

); override;


TNamedIniCollectionItem.UserData

User-defined data

Declaration

Source position: inicol.pp line 58

public property TNamedIniCollectionItem.UserData: TObject
  read FUserData
  write FUserData;

Description

UserData can be used to associate an arbitrary object with the item - much like the Objects property of a TStrings.


TCustomIniFile

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract ini file object

Declaration

Source position: inifiles.pp line 120

type TCustomIniFile = class
public
constructor Create(); virtual; | Instantiate a new instance of TCustomIniFile.
destructor Destroy; override; | Remove the TCustomIniFile instance from memory
function SectionExists(); virtual; | Check if a section exists.
function ReadString(); virtual; abstract; | Read a string valued key
procedure WriteString(); virtual; abstract; | Write a string value
function ReadInteger(); virtual; | Read an integer value from the file
procedure WriteInteger(); virtual; | Write an integer value
function ReadBool(); virtual; |
procedure WriteBool(); virtual; | Write boolean value
function ReadDate(); virtual; | Read a date value
function ReadDateTime(); virtual; | Read a Date/Time value
function ReadFloat(); virtual; | Read a floating point value
function ReadTime(); virtual; | Read a time value
function ReadBinaryStream(); virtual; | Read binary data
procedure WriteDate(); virtual; | Write date value
procedure WriteDateTime(); virtual; | Write date/time value
procedure WriteFloat(); virtual; | Write a floating-point value
procedure WriteTime(); virtual; | Write time value
procedure WriteBinaryStream(); virtual; | Write binary data
procedure ReadSection(); virtual; abstract; | Read the key names in a section
procedure ReadSections(); virtual; abstract; | Read the list of sections
procedure ReadSectionValues(); virtual; abstract; | Read names and values of a section
procedure EraseSection(); virtual; abstract; | Clear a section
procedure DeleteKey(); virtual; abstract; | Delete a key from a section
procedure UpdateFile; virtual; abstract; | Update the file on disk
function ValueExists(); virtual; | Check if a value exists
property FileName: String; [r] | Name of the .ini file
property EscapeLineFeeds: Boolean; [r] | Should linefeeds be escaped ?
property CaseSensitive: Boolean; [rw] | Are key and section names case sensitive
property StripQuotes: Boolean; [rw] | Should quotes be stripped from string values
end;

Inheritance

TCustomIniFile

Abstract ini file object
|

TObject

Description

TCustomIniFile implements all calls for manipulating a .ini. It does not implement any of this behaviour, the behaviour must be implemented in a descendent class like TIniFile or TMemIniFile.

Since TCustomIniFile is an abstract class, it should never be created directly. Instead, one of the TIniFile or TMemIniFile classes should be created.

See also

TIniFile | Ini file implementation
TMemIniFile | Inifile cached in memory


TCustomIniFile
 | ro | FileName
 | ro | EscapeLineFeeds
 |  | CaseSensitive
 |  | StripQuotes


ro | EscapeLineFeeds (TCustomIniFile)
ro | FileName (TCustomIniFile)
 | StripQuotes (TCustomIniFile)


TCustomIniFile
 | Create
 | Destroy
 | SectionExists
 | ReadString
 | WriteString
 | ReadInteger
 | WriteInteger
 | ReadBool
 | WriteBool
 | ReadDate
 | ReadDateTime
 | ReadFloat
 | ReadTime
 | ReadBinaryStream
 | WriteDate
 | WriteDateTime
 | WriteFloat
 | WriteTime
 | WriteBinaryStream
 | ReadSection
 | ReadSections
 | ReadSectionValues
 | EraseSection
 | DeleteKey
 | UpdateFile
 | ValueExists


Create (TCustomIniFile)

DeleteKey (TCustomIniFile)

Destroy (TCustomIniFile)

EraseSection (TCustomIniFile)

ReadBinaryStream (TCustomIniFile)

ReadBool (TCustomIniFile)

ReadDate (TCustomIniFile)

ReadDateTime (TCustomIniFile)

ReadFloat (TCustomIniFile)

ReadInteger (TCustomIniFile)

ReadSection (TCustomIniFile)

ReadSections (TCustomIniFile)

ReadSectionValues (TCustomIniFile)

ReadString (TCustomIniFile)

ReadTime (TCustomIniFile)

SectionExists (TCustomIniFile)

UpdateFile (TCustomIniFile)

ValueExists (TCustomIniFile)

WriteBinaryStream (TCustomIniFile)

WriteBool (TCustomIniFile)

WriteDate (TCustomIniFile)

WriteDateTime (TCustomIniFile)

WriteFloat (TCustomIniFile)

WriteInteger (TCustomIniFile)

WriteString (TCustomIniFile)

WriteTime (TCustomIniFile)


TCustomIniFile


TCustomIniFile.CaseSensitive

Are key and section names case sensitive

Declaration

Source position: inifiles.pp line 156

public property TCustomIniFile.CaseSensitive: Boolean
  read FCaseSensitive
  write FCaseSensitive;

Description

CaseSensitive determines whether searches for sections and keys are performed case-sensitive or not. By default, they are not case sensitive.

See also

EscapeLineFeeds

Should linefeeds be escaped ?


TCustomIniFile.Create

Instantiate a new instance of TCustomIniFile.

Declaration

Source position: inifiles.pp line 128

public constructor TCustomIniFile.Create(

  const AFileName: String;

  AEscapeLineFeeds: Boolean = false

); virtual;

Arguments

AFileName | Filename to read
AEscapeLineFeeds | Should escaping of linefeeds be enabled ?

Description

Create creates a new instance of TCustomIniFile and loads it with the data from AFileName, if this file exists. If the AEscapeLineFeeds parameter is True, then lines which have their end-of-line markers escaped with a backslash, will be concatenated. This means that the following 2 lines

Description=This is a \
line with a long text

is equivalent to

Description=This is a line with a long text

By default, not escaping of linefeeds is performed (for Delphi compatibility)

Errors

If the file cannot be read, an exception may be raised.

See also

Destroy

Remove the TCustomIniFile instance from memory


TCustomIniFile.DeleteKey

Delete a key from a section

Declaration

Source position: inifiles.pp line 151

public procedure TCustomIniFile.DeleteKey(

  const Section: String;

  const Ident: String

); virtual; abstract;

Arguments

Section | Section from which to delete key
Ident | Name of key to delete

Description

DeleteKey deletes the key Ident from section Section. If the key or section didn't exist prior to the DeleteKey call, nothing happens.

See also

EraseSection

Clear a section


TCustomIniFile.Destroy

Remove the TCustomIniFile instance from memory

Declaration

Source position: inifiles.pp line 129

public destructor TCustomIniFile.Destroy; override;

Description

Destroy cleans up all internal structures and then calls the inherited Destroy.

See also

TCustomIniFile

Abstract ini file object


TCustomIniFile.EraseSection

Clear a section

Declaration

Source position: inifiles.pp line 150

public procedure TCustomIniFile.EraseSection(

  const Section: String

); virtual; abstract;

Arguments

Section

Name of section to erase

Description

EraseSection deletes all values from the section named Section and removes the section from the ini file. If the section didn't exist prior to a call to EraseSection, nothing happens.

See also

SectionExists | Check if a section exists.
ReadSections | Read the list of sections
DeleteKey | Delete a key from a section


TCustomIniFile.EscapeLineFeeds

Should linefeeds be escaped ?

Declaration

Source position: inifiles.pp line 155

public property TCustomIniFile.EscapeLineFeeds: Boolean
  read FEscapeLineFeeds;

Description

EscapeLineFeeds determines whether escaping of linefeeds is enabled: For a description of this feature, see Create, as the value of this property must be specified when the TCustomIniFile instance is created.

By default, EscapeLineFeeds is False.

See also

Create | Instantiate a new instance of TCustomIniFile.
CaseSensitive | Are key and section names case sensitive


TCustomIniFile.FileName

Name of the .ini file

Declaration

Source position: inifiles.pp line 154

public property TCustomIniFile.FileName: String
  read FFileName;

Description

FileName is the name of the ini file on disk. It should be specified when the TCustomIniFile instance is created. Contrary to the Delphi implementation, if no path component is present in the filename, the filename is not searched in the windows directory.

See also

Create

Instantiate a new instance of TCustomIniFile.


TCustomIniFile.ReadBinaryStream

Read binary data

Declaration

Source position: inifiles.pp line 141

public function TCustomIniFile.ReadBinaryStream(

  const Section: String;

  const Name: String;

  Value: TStream

):Integer; virtual;

Arguments

Section | Section to read Name from
Name | Name of key to retrieve value from
Value | Stream to write data to.

Function result

Number of bytes written to Value

Description

ReadBinaryStream reads the key Name in section Section, and returns the value in the stream Value. If the specified key or section do not exist, then the contents of Value are left untouched. The stream is not cleared prior to adding data to it.

The data is interpreted as a series of 2-byte hexadecimal values, each representing a byte in the data stream, i.e, it should always be an even number of hexadecimal characters.

See also

WriteBinaryStream | Write binary data
ReadInteger | Read an integer value from the file
ReadBool |
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadString | Read a string valued key


TCustomIniFile.ReadBool

Declaration

Source position: inifiles.pp line 135

public function TCustomIniFile.ReadBool(

  const Section: String;

  const Ident: String;

  Default: Boolean

):Boolean; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a boolean

Description

ReadString reads the key Ident in section Section, and returns the value as a boolean (valid values are 0 and 1). If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid integer value, False is also returned.

See also

WriteBool | Write boolean value
ReadInteger | Read an integer value from the file
ReadString | Read a string valued key
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.ReadDate

Read a date value

Declaration

Source position: inifiles.pp line 137

public function TCustomIniFile.ReadDate(

  const Section: String;

  const Ident: String;

  Default: TDateTime

):TDateTime; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a TDateTime

Description

ReadDate reads the key Ident in section Section, and returns the value as a date (TDateTime). If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid date value, Default is also returned. The international settings of the SysUtils are taken into account when deciding if the read value is a correct date.

See also

WriteDate | Write date value
ReadInteger | Read an integer value from the file
ReadBool |
ReadString | Read a string valued key
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.ReadDateTime

Read a Date/Time value

Declaration

Source position: inifiles.pp line 138

public function TCustomIniFile.ReadDateTime(

  const Section: String;

  const Ident: String;

  Default: TDateTime

):TDateTime; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a TDateTime

Description

ReadDateTime reads the key Ident in section Section, and returns the value as a date/time (TDateTime). If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid date/time value, Default is also returned. The international settings of the SysUtils are taken into account when deciding if the read value is a correct date/time.

See also

WriteDateTime | Write date/time value
ReadInteger | Read an integer value from the file
ReadBool |
ReadDate | Read a date value
ReadString | Read a string valued key
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.ReadFloat

Read a floating point value

Declaration

Source position: inifiles.pp line 139

public function TCustomIniFile.ReadFloat(

  const Section: String;

  const Ident: String;

  Default: Double

):Double; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a floating point value

Description

ReadFloat reads the key Ident in section Section, and returns the value as a float (Double). If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid float value, Default is also returned. The international settings of the SysUtils are taken into account when deciding if the read value is a correct float.

See also

WriteFloat | Write a floating-point value
ReadInteger | Read an integer value from the file
ReadBool |
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadString | Read a string valued key
ReadBinaryStream | Read binary data


TCustomIniFile.ReadInteger

Read an integer value from the file

Declaration

Source position: inifiles.pp line 133

public function TCustomIniFile.ReadInteger(

  const Section: String;

  const Ident: String;

  Default: LongInt

):LongInt; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as an integer.

Description

ReadInteger reads the key Ident in section Section, and returns the value as an integer. If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid integer value, Default is also returned.

See also

WriteInteger | Write an integer value
ReadString | Read a string valued key
ReadBool |
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.ReadSection

Read the key names in a section

Declaration

Source position: inifiles.pp line 147

public procedure TCustomIniFile.ReadSection(

  const Section: String;

  Strings: TStrings

); virtual; abstract;

Arguments

Section | Section for which to read key names
Strings | Stringlist to store key names in

Description

ReadSection will return the names of the keys in section Section in Strings, one string per key. If a non-existing section is specified, the list is cleared. To return the values of the keys as well, the ReadSectionValues method should be used.

See also

ReadSections | Read the list of sections
SectionExists | Check if a section exists.
ReadSectionValues | Read names and values of a section


TCustomIniFile.ReadSections

Read the list of sections

Declaration

Source position: inifiles.pp line 148

public procedure TCustomIniFile.ReadSections(

  Strings: TStrings

); virtual; abstract;

Arguments

Strings

Stringlist in which to return section names

Description

ReadSections returns the names of existing sections in Strings. It also returns names of empty sections.

See also

SectionExists | Check if a section exists.
ReadSectionValues | Read names and values of a section
ReadSection | Read the key names in a section


TCustomIniFile.ReadSectionValues

Read names and values of a section

Declaration

Source position: inifiles.pp line 149

public procedure TCustomIniFile.ReadSectionValues(

  const Section: String;

  Strings: TStrings

); virtual; abstract;

Arguments

Section | Section for which to read key names and values
Strings | Stringlist to store key/value pairs in

Description

ReadSectionValues returns the keys and their values in the section Section in Strings. They are returned as Key=Value strings, one per key, so the Values property of the stringlist can be used to read the values. To retrieve just the names of the available keys, ReadSection can be used.

See also

SectionExists | Check if a section exists.
ReadSections | Read the list of sections
ReadSection | Read the key names in a section


TCustomIniFile.ReadString

Read a string valued key

Declaration

Source position: inifiles.pp line 131

public function TCustomIniFile.ReadString(

  const Section: String;

  const Ident: String;

  const Default: String

):String; virtual; abstract;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a string.

Description

ReadString reads the key Ident in section Section, and returns the value as a string. If the specified key or section do not exist, then the value in Default is returned. Note that if the key exists, but is empty, an empty string will be returned.

See also

WriteString | Write a string value
ReadInteger | Read an integer value from the file
ReadBool |
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadTime | Read a time value
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.ReadTime

Read a time value

Declaration

Source position: inifiles.pp line 140

public function TCustomIniFile.ReadTime(

  const Section: String;

  const Ident: String;

  Default: TDateTime

):TDateTime; virtual;

Arguments

Section | Section to read Ident from
Ident | Name of key to retrieve value from
Default | Default value to return when the key Ident does not exist.

Function result

Value of Ident as a TDateTime

Description

ReadTime reads the key Ident in section Section, and returns the value as a time (TDateTime). If the specified key or section do not exist, then the value in Default is returned. If the key exists, but contains an invalid time value, Default is also returned. The international settings of the SysUtils are taken into account when deciding if the read value is a correct time.

See also

WriteTime | Write time value
ReadInteger | Read an integer value from the file
ReadBool |
ReadDate | Read a date value
ReadDateTime | Read a Date/Time value
ReadString | Read a string valued key
ReadFloat | Read a floating point value
ReadBinaryStream | Read binary data


TCustomIniFile.SectionExists

Check if a section exists.

Declaration

Source position: inifiles.pp line 130

public function TCustomIniFile.SectionExists(

  const Section: String

):Boolean; virtual;

Arguments

Section

Name of the section

Function result

True if a section named Section exists and is non-empty.

Description

SectionExists returns True if a section with name Section exists, and contains keys. (comments are not considered keys)

See also

TCustomIniFile.ValueExists

Check if a value exists


TCustomIniFile.StripQuotes

Should quotes be stripped from string values

Declaration

Source position: inifiles.pp line 157

public property TCustomIniFile.StripQuotes: Boolean
  read FStripQuotes
  write FStripQuotes;

Description

StripQuotes determines whether quotes around string values are stripped from the value when reading the values from file. By default, quotes are not stripped (this is Delphi and Windows compatible).


TCustomIniFile.UpdateFile

Update the file on disk

Declaration

Source position: inifiles.pp line 152

public procedure TCustomIniFile.UpdateFile; virtual; abstract;

Description

UpdateFile writes the in-memory image of the ini-file to disk. To speed up operation of the inifile class, the whole ini-file is read into memory when the class is created, and all operations are performed in-memory. If CacheUpdates is set to True, any changes to the inifile are only in memory, until they are committed to disk with a call to UpdateFile. If CacheUpdates is set to False, then all operations which cause a change in the .ini file will immediatly be committed to disk with a call to UpdateFile. Since the whole file is written to disk, this may have serious impact on performance.

See also

CacheUpdates

Should changes be kept in memory


TCustomIniFile.ValueExists

Check if a value exists

Declaration

Source position: inifiles.pp line 153

public function TCustomIniFile.ValueExists(

  const Section: String;

  const Ident: String

):Boolean; virtual;

Arguments

Section | Section in which to look for Ident
Ident | Key name to look for.

Function result

True if Ident exists in section Section

Description

ValueExists checks whether the key Ident exists in section Section. It returns True if a key was found, or False if not. The key may be empty.

See also

SectionExists

Check if a section exists.


TCustomIniFile.WriteBinaryStream

Write binary data

Declaration

Source position: inifiles.pp line 146

public procedure TCustomIniFile.WriteBinaryStream(

  const Section: String;

  const Name: String;

  Value: TStream

); virtual;

Arguments

Section | Section to write key value to
Name | Key name with which to write value
Value | Binary data to write

Description

WriteBinaryStream writes the binary data in Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist.

The binary data is encoded using a 2-byte hexadecimal value per byte in the data stream. The data stream must be seekable, so it's size can be determined. The data stream is not repositioned, it must be at the correct position.

See also

ReadBinaryStream | Read binary data
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteString | Write a string value


TCustomIniFile.WriteBool

Write boolean value

Declaration

Source position: inifiles.pp line 136

public procedure TCustomIniFile.WriteBool(

  const Section: String;

  const Ident: String;

  Value: Boolean

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Boolean value to write

Description

WriteBool writes the boolean Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist.

See also

ReadBool |
WriteInteger | Write an integer value
WriteString | Write a string value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteDate

Write date value

Declaration

Source position: inifiles.pp line 142

public procedure TCustomIniFile.WriteDate(

  const Section: String;

  const Ident: String;

  Value: TDateTime

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Date value to write

Description

WriteDate writes the date Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist. The date is written using the internationalization settings in the SysUtils unit.

See also

ReadDate | Read a date value
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteString | Write a string value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteDateTime

Write date/time value

Declaration

Source position: inifiles.pp line 143

public procedure TCustomIniFile.WriteDateTime(

  const Section: String;

  const Ident: String;

  Value: TDateTime

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Date/Time value to write

Description

WriteDateTime writes the date/time Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist. The date/time is written using the internationalization settings in the SysUtils unit.

See also

ReadDateTime | Read a Date/Time value
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteDate | Write date value
WriteString | Write a string value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteFloat

Write a floating-point value

Declaration

Source position: inifiles.pp line 144

public procedure TCustomIniFile.WriteFloat(

  const Section: String;

  const Ident: String;

  Value: Double

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Float value to write

Description

WriteFloat writes the time Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist. The floating point value is written using the internationalization settings in the SysUtils unit.

See also

ReadFloat | Read a floating point value
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteString | Write a string value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteInteger

Write an integer value

Declaration

Source position: inifiles.pp line 134

public procedure TCustomIniFile.WriteInteger(

  const Section: String;

  const Ident: String;

  Value: LongInt

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Integer value to write

Description

WriteInteger writes the integer Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist.

See also

ReadInteger | Read an integer value from the file
WriteString | Write a string value
WriteBool | Write boolean value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteString

Write a string value

Declaration

Source position: inifiles.pp line 132

public procedure TCustomIniFile.WriteString(

  const Section: String;

  const Ident: String;

  const Value: String

); virtual; abstract;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | String value to write

Description

WriteString writes the string Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist.

See also

ReadString | Read a string valued key
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteTime | Write time value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


TCustomIniFile.WriteTime

Write time value

Declaration

Source position: inifiles.pp line 145

public procedure TCustomIniFile.WriteTime(

  const Section: String;

  const Ident: String;

  Value: TDateTime

); virtual;

Arguments

Section | Section to write key value to
Ident | Key name with which to write value
Value | Time value to write

Description

WriteTime writes the time Value with the name Ident to the section Section, overwriting any previous value that may exist there. The section will be created if it does not exist. The time is written using the internationalization settings in the SysUtils unit.

See also

ReadTime | Read a time value
WriteInteger | Write an integer value
WriteBool | Write boolean value
WriteDate | Write date value
WriteDateTime | Write date/time value
WriteString | Write a string value
WriteFloat | Write a floating-point value
WriteBinaryStream | Write binary data


THashedStringList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

String list with support for has values

Declaration

Source position: inifiles.pp line 61

type THashedStringList = class(TStringList)
protected
procedure Changed; override;
public
constructor Create; | Instantiates a new instance of THashedStringList
destructor Destroy; override; | Clean up instance
function IndexOf(); override; | Returns the index of a string in the list of strings
function IndexOfName(); override; | Return the index of a name in the list of name=value pairs
end;

Inheritance

THashedStringList

String list with support for has values
|

TStringList
|

TObject

Description

THashedStringList is a TStringList descendent which creates has values for the strings and names (in the case of a name-value pair) stored in it. The IndexOf and IndexOfName functions make use of these hash values to quicklier locate a value.

See also

IndexOf | Returns the index of a string in the list of strings
IndexOfName | Return the index of a name in the list of name=value pairs


THashedStringList
TStringList
 | Duplicates
 | Sorted
 | CaseSensitive


THashedStringList
pt | Changed
 | Create
 | Destroy
 | IndexOf
 | IndexOfName
TStringList
 | ExchangeItems
 | Grow
 | QuickSort
 | SetSorted
 | SetCaseSensitive
 | Changed
 | Changing
 | Get
 | GetCapacity
 | GetCount
 | GetObject
 | Put
 | PutObject
 | SetCapacity
 | SetUpdateState
 | InsertItem
 | DoCompareText
 | Destroy
 | Add
 | Clear
 | Delete
 | Exchange
 | Find
 | IndexOf
 | Insert
 | Sort
 | CustomSort


pt | Changed (THashedStringList)
 | Changing (TStringList)
 | Clear (TStringList)
 | Create (THashedStringList)
 | CustomSort (TStringList)
 | Delete (TStringList)
 | Destroy (TStringList)
 | Destroy (THashedStringList)
 | DoCompareText (TStringList)
 | Exchange (TStringList)
 | ExchangeItems (TStringList)
 | Find (TStringList)
 | Get (TStringList)
 | GetCapacity (TStringList)
 | GetCount (TStringList)
 | GetObject (TStringList)
 | Grow (TStringList)
 | IndexOf (TStringList)
 | IndexOf (THashedStringList)
 | IndexOfName (THashedStringList)
 | Insert (TStringList)
 | InsertItem (TStringList)
 | Put (TStringList)
 | PutObject (TStringList)
 | QuickSort (TStringList)
 | SetCapacity (TStringList)
 | SetCaseSensitive (TStringList)
 | SetSorted (TStringList)
 | SetUpdateState (TStringList)
 | Sort (TStringList)


THashedStringList
TStringList
 | OnChange
 | OnChanging


THashedStringList.Changed

Declaration

Source position: inifiles.pp line 70

protected procedure THashedStringList.Changed; override;


THashedStringList.Create

Instantiates a new instance of THashedStringList

Declaration

Source position: inifiles.pp line 72

public constructor THashedStringList.Create;

Description

Create calls the inherited Create, and then instantiates the hash tables.

Errors

If no enough memory is available, an exception may be raised.

See also

THashedStringList.Destroy

Clean up instance


THashedStringList.Destroy

Clean up instance

Declaration

Source position: inifiles.pp line 73

public destructor THashedStringList.Destroy; override;

Description

Destroy cleans up the hash tables and then calls the inherited Destroy.

See also

THashedStringList.Create

Instantiates a new instance of THashedStringList


THashedStringList.IndexOf

Returns the index of a string in the list of strings

Declaration

Source position: inifiles.pp line 74

public function THashedStringList.IndexOf(

  const S: String

):Integer; override;

Arguments

S

String to locate in the list

Function result

Index of S or -1 if S is not in the list.

Description

IndexOf overrides the TStringList.IndexOf method and uses the hash values to look for the location of S.

See also

TStringList.IndexOf

THashedStringList.IndexOfName

Return the index of a name in the list of name=value pairs


THashedStringList.IndexOfName

Return the index of a name in the list of name=value pairs

Declaration

Source position: inifiles.pp line 75

public function THashedStringList.IndexOfName(

  const Name: String

):Integer; override;

Arguments

Name

Name to look for

Function result

Index of name Name or -1 if no name=value pair exists with Name.

Description

IndexOfName overrides the TStrings.IndexOfName method and uses the hash values of the names to look for the location of Name.

See also

TStrings.IndexOfName

THashedStringList.IndexOf

Returns the index of a string in the list of strings


TIniFile

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ini file implementation

Declaration

Source position: inifiles.pp line 162

type TIniFile = class(TCustomIniFile)
protected
procedure MaybeUpdateFile;
property Dirty: Boolean; [r]
public
procedure Create(); | Create a new instance of TIniFile
destructor Destroy; override; | Remove the TIniFile instance from memory
function ReadString(); override; | Read a string
procedure WriteString(); override; | Write string to file
procedure ReadSection(); override; | Read the key names in a section
procedure ReadSectionRaw(); | Read raw section
procedure ReadSections(); override; | Read section names
procedure ReadSectionValues(); override; |
procedure EraseSection(); override; |
procedure DeleteKey(); override; | Delete key
procedure UpdateFile; override; | Update the file on disk
property Stream: TStream; [r] | Stream from which ini file was read
property CacheUpdates: Boolean; [rw] | Should changes be kept in memory
end;

Inheritance

TIniFile | Ini file implementation
|
TCustomIniFile | Abstract ini file object
|
TObject

Description

TIniFile is an implementation of TCustomIniFile which does the same as TMemIniFile, namely it reads the whole file into memory. Unlike TMemIniFile it does not cache updates in memory, but immediatly writes any changes to disk.

TIniFile introduces no new methods, it just implements the abstract methods introduced in TCustomIniFile

See also

TCustomIniFile | Abstract ini file object
TMemIniFile | Inifile cached in memory


TIniFile
pt | ro | Dirty
 | ro | Stream
 |  | CacheUpdates
TCustomIniFile
 | ro | FileName
 | ro | EscapeLineFeeds
 |  | CaseSensitive
 |  | StripQuotes


pt | ro | Dirty (TIniFile)
 | ro | EscapeLineFeeds (TCustomIniFile)
 | ro | FileName (TCustomIniFile)
 | ro | Stream (TIniFile)
 |  | StripQuotes (TCustomIniFile)


TIniFile
pt | MaybeUpdateFile
 | Create
 | Destroy
 | ReadString
 | WriteString
 | ReadSection
 | ReadSectionRaw
 | ReadSections
 | ReadSectionValues
 | EraseSection
 | DeleteKey
 | UpdateFile
TCustomIniFile
 | Create
 | Destroy
 | SectionExists
 | ReadString
 | WriteString
 | ReadInteger
 | WriteInteger
 | ReadBool
 | WriteBool
 | ReadDate
 | ReadDateTime
 | ReadFloat
 | ReadTime
 | ReadBinaryStream
 | WriteDate
 | WriteDateTime
 | WriteFloat
 | WriteTime
 | WriteBinaryStream
 | ReadSection
 | ReadSections
 | ReadSectionValues
 | EraseSection
 | DeleteKey
 | UpdateFile
 | ValueExists


 | Create (TCustomIniFile)
 | Create (TIniFile)
 | DeleteKey (TCustomIniFile)
 | DeleteKey (TIniFile)
 | Destroy (TCustomIniFile)
 | Destroy (TIniFile)
 | EraseSection (TCustomIniFile)
 | EraseSection (TIniFile)
pt | MaybeUpdateFile (TIniFile)
 | ReadBinaryStream (TCustomIniFile)
 | ReadBool (TCustomIniFile)
 | ReadDate (TCustomIniFile)
 | ReadDateTime (TCustomIniFile)
 | ReadFloat (TCustomIniFile)
 | ReadInteger (TCustomIniFile)
 | ReadSection (TCustomIniFile)
 | ReadSection (TIniFile)
 | ReadSectionRaw (TIniFile)
 | ReadSections (TCustomIniFile)
 | ReadSections (TIniFile)
 | ReadSectionValues (TCustomIniFile)
 | ReadSectionValues (TIniFile)
 | ReadString (TCustomIniFile)
 | ReadString (TIniFile)
 | ReadTime (TCustomIniFile)
 | SectionExists (TCustomIniFile)
 | UpdateFile (TCustomIniFile)
 | UpdateFile (TIniFile)
 | ValueExists (TCustomIniFile)
 | WriteBinaryStream (TCustomIniFile)
 | WriteBool (TCustomIniFile)
 | WriteDate (TCustomIniFile)
 | WriteDateTime (TCustomIniFile)
 | WriteFloat (TCustomIniFile)
 | WriteInteger (TCustomIniFile)
 | WriteString (TCustomIniFile)
 | WriteString (TIniFile)
 | WriteTime (TCustomIniFile)


TIniFile

TCustomIniFile


TIniFile.CacheUpdates

Should changes be kept in memory

Declaration

Source position: inifiles.pp line 188

public property TIniFile.CacheUpdates: Boolean
  read FCacheUpdates
  write SetCacheUpdates;

Description

CacheUpdates determines how to deal with changes to the ini-file data: if set to True then changes are kept in memory till the file is written to disk with a call to UpdateFile. If it is set to False then each call that changes the data of the ini-file will result in a call to UpdateFile. This is the default behaviour, but it may aversely affect performance.

See also

UpdateFile

Update the file on disk


TIniFile.Create

Create a new instance of TIniFile

Declaration

Source position: line 0

public constructor TIniFile.Create(

  const AFileName: String;

  AEscapeLineFeeds: Boolean = false

); override;

constructor TIniFile.Create(

  AStream: TStream;

  AEscapeLineFeeds: Boolean = false

);

Arguments

AFileName | Filename to read from
AEscapeLineFeeds | Should escaping of linefeeds be enabled ?

Arguments

AStream | Stream to read ini data from
AEscapeLineFeeds | Should escaping of linefeeds be enabled ?

Description

Create creates a new instance of TIniFile and initializes the class by reading the file from disk if the filename AFileName is specified, or from stream in case AStream is specified. It also sets most variables to their initial values, i.e. AEscapeLineFeeds is saved prior to reading the file, and Cacheupdates is set to False.

See also

TCustomIniFile | Abstract ini file object
TMemIniFile | Inifile cached in memory


TIniFile.DeleteKey

Delete key

Declaration

Source position: inifiles.pp line 185

public procedure TIniFile.DeleteKey(

  const Section: String;

  const Ident: String

); override;

Arguments

Section | Section in which to delete key
Ident | Name of key to delete

Description

DeleteKey deletes the Ident from the section Section. This operation is performed on the in-memory copy of the ini file. if CacheUpdates is False, then the file is immediatly updated on disk.

See also

CacheUpdates

Should changes be kept in memory


TIniFile.Destroy

Remove the TIniFile instance from memory

Declaration

Source position: inifiles.pp line 177

public destructor TIniFile.Destroy; override;

Description

Destroy writes any pending changes to disk, and cleans up the TIniFile structures, and then calls the inherited Destroy, effectively removing the instance from memory.

Errors

If an error happens when the file is written to disk, an exception will be raised.

See also

UpdateFile | Update the file on disk
CacheUpdates | Should changes be kept in memory


TIniFile.Dirty

Declaration

Source position: inifiles.pp line 173

protected property TIniFile.Dirty: Boolean
  read FDirty;


TIniFile.EraseSection

Declaration

Source position: inifiles.pp line 184

public procedure TIniFile.EraseSection(

  const Section: String

); override;

Arguments

Section

Section to erase

Description

Erasesection deletes the section Section from memory, if CacheUpdates is False, then the file is immediatly updated on disk. This method is the implementation of the abstract TCustomIniFile.EraseSection method.

See also

TCustomIniFile.EraseSection | Clear a section
TIniFile.ReadSection | Read the key names in a section
TIniFile.ReadSections | Read section names


TIniFile.MaybeUpdateFile

Declaration

Source position: inifiles.pp line 172

protected procedure TIniFile.MaybeUpdateFile;


TIniFile.ReadSection

Read the key names in a section

Declaration

Source position: inifiles.pp line 180

public procedure TIniFile.ReadSection(

  const Section: String;

  Strings: TStrings

); override;

Arguments

Section | Section to read names from
Strings | Stringlist to store names in

Description

ReadSection reads the key names from Section into Strings, taking the in-memory copy of the ini file. This is the implementation for the abstract TCustomIniFile.ReadSection

See also

TCustomIniFile.ReadSection | Read the key names in a section
TIniFile.ReadSectionRaw | Read raw section


TIniFile.ReadSectionRaw

Read raw section

Declaration

Source position: inifiles.pp line 181

public procedure TIniFile.ReadSectionRaw(

  const Section: String;

  Strings: TStrings

);

Arguments

Section | Section name to read
Strings | Strings to store section contents in

Description

ReadSectionRaw returns the contents of the section Section as it is: this includes the comments in the section. (these are also stored in memory)

See also

TIniFile.ReadSection | Read the key names in a section
TCustomIniFile.ReadSection | Read the key names in a section


TIniFile.ReadSections

Read section names

Declaration

Source position: inifiles.pp line 182

public procedure TIniFile.ReadSections(

  Strings: TStrings

); override;

Arguments

Strings

Stringlist to store section names in

Description

ReadSections is the implementation of TCustomIniFile.ReadSections. It operates on the in-memory copy of the inifile, and places all section names in Strings.

See also

TIniFile.ReadSection | Read the key names in a section
TCustomIniFile.ReadSections | Read the list of sections
TIniFile.ReadSectionValues |


TIniFile.ReadSectionValues

Declaration

Source position: inifiles.pp line 183

public procedure TIniFile.ReadSectionValues(

  const Section: String;

  Strings: TStrings

); override;

Arguments

Section | Section to read key name/values from
Strings | Stringlist to store key/value pairs in.

Description

ReadSectionValues is the implementation of TCustomIniFile.ReadSectionValues. It operates on the in-memory copy of the inifile, and places all key names from Section together with their values in Strings.

See also

TIniFile.ReadSection | Read the key names in a section
TCustomIniFile.ReadSectionValues | Read names and values of a section
TIniFile.ReadSections | Read section names


TIniFile.ReadString

Read a string

Declaration

Source position: inifiles.pp line 178

public function TIniFile.ReadString(

  const Section: String;

  const Ident: String;

  const Default: String

):String; override;

Arguments

Section | Section to search key value in
Ident | Key name
Default | Default value if none is found.

Function result

Value of the string or Default if none found.

Description

ReadString implements the TCustomIniFile.ReadString abstract method by looking at the in-memory copy of the ini file and returning the string found there.

See also

TCustomIniFile.ReadString

Read a string valued key


TIniFile.Stream

Stream from which ini file was read

Declaration

Source position: inifiles.pp line 187

public property TIniFile.Stream: TStream
  read FStream;

Description

Stream is the stream which was used to create the IniFile. The UpdateFile method will use this stream to write changes to.

See also

Create | Create a new instance of TIniFile
UpdateFile | Update the file on disk


TIniFile.UpdateFile

Update the file on disk

Declaration

Source position: inifiles.pp line 186

public procedure TIniFile.UpdateFile; override;

Description

UpdateFile writes the in-memory data for the ini file to disk. The whole file is written. If the ini file was instantiated from a stream, then the stream is updated. Note that the stream must be seekable for this to work correctly. The ini file is marked as 'clean' after a call to UpdateFile (i.e. not in need of writing to disk).

Errors

If an error occurs when writing to stream or disk, an exception may be raised.

See also

CacheUpdates

Should changes be kept in memory


TIniFile.WriteString

Write string to file

Declaration

Source position: inifiles.pp line 179

public procedure TIniFile.WriteString(

  const Section: String;

  const Ident: String;

  const Value: String

); override;

Arguments

Section | Section to write key value in
Ident | Key name to use
Value | String value to write

Description

WriteString implements the TCustomIniFile.WriteString abstract method by writing the string to the in-memory copy of the ini file. If CacheUpdates property is False, then the whole file is immediatly written to disk as well.

Errors

If an error happens when the file is written to disk, an exception will be raised.


TIniFileKey

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Object representing a key=value pair in the ini file.

Declaration

Source position: inifiles.pp line 78

type TIniFileKey = class
public
constructor Create(); | Create a new instance of TIniFileKey
property Ident: String; [rw] | Key name
property Value: String; [rw] | Key value
end;

Inheritance

TIniFileKey

Object representing a key=value pair in the ini file.
|

TObject

Description

TIniFileKey is used to keep the key/value pairs in the ini file in memory. It is an internal structure, used internally by the TIniFile class.

See also

TIniFile

Ini file implementation


TIniFileKey
 | Ident
 | Value


TIniFileKey

Create


TIniFileKey


TIniFileKey.Create

Create a new instance of TIniFileKey

Declaration

Source position: inifiles.pp line 83

public constructor TIniFileKey.Create(

  AIdent: String;

  AValue: String

);

Arguments

AIdent | Key name
AValue | Key value

Description

Create instantiates a new instance of TIniFileKey on the heap. It fills Ident with AIdent and Value with AValue.

See also

Ident | Key name
Value | Key value


TIniFileKey.Ident

Key name

Declaration

Source position: inifiles.pp line 84

public property TIniFileKey.Ident: String
  read FIdent
  write FIdent;

Description

Ident is the key value part of the key/value pair.

See also

Value

Key value


TIniFileKey.Value

Key value

Declaration

Source position: inifiles.pp line 85

public property TIniFileKey.Value: String
  read FValue
  write FValue;

Description

Value is the value part of the key/value pair.

See also

Ident

Key name


TIniFileKeyList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Key list object

Declaration

Source position: inifiles.pp line 88

type TIniFileKeyList = class(TList)
public
destructor Destroy; override; | Free the instance
procedure Clear; override; | Clear the list
property Items: TIniFileKey; default; [r] | Indexed access to TIniFileKey items in the list
end;

Inheritance

TIniFileKeyList

Key list object
|

TList
|

TObject

Description

TIniFileKeyList maintains a list of TIniFileKey instances on behalf of the TIniFileSection class. It stores they keys of one section of the .ini files.

See also

TIniFileKey | Object representing a key=value pair in the ini file.
TIniFileSection | Ini file section object


TIniFileKeyList
 | ro | Items
TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List


ro | Items (TIniFileKeyList)
ro | List (TList)


TIniFileKeyList
 | Destroy
 | Clear
TList
 | CopyMove
 | MergeMove
 | DoCopy
 | DoSrcUnique
 | DoAnd
 | DoDestUnique
 | DoOr
 | DoXOr
 | Get
 | Grow
 | Put
 | Notify
 | SetCapacity
 | GetCapacity
 | SetCount
 | GetCount
 | GetList
 | Create
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort


Add (TList)

AddList (TList)

Assign (TList)

Clear (TList)

Clear (TIniFileKeyList)

CopyMove (TList)

Create (TList)

Delete (TList)

Destroy (TList)

Destroy (TIniFileKeyList)

DoAnd (TList)

DoCopy (TList)

DoDestUnique (TList)

DoOr (TList)

DoSrcUnique (TList)

DoXOr (TList)

Error (TList)

Exchange (TList)

Expand (TList)

Extract (TList)

First (TList)

Get (TList)

GetCapacity (TList)

GetCount (TList)

GetList (TList)

Grow (TList)

IndexOf (TList)

Insert (TList)

Last (TList)

MergeMove (TList)

Move (TList)

Notify (TList)

Pack (TList)

Put (TList)

Remove (TList)

SetCapacity (TList)

SetCount (TList)

Sort (TList)


TIniFileKeyList

TList


TIniFileKeyList.Clear

Clear the list

Declaration

Source position: inifiles.pp line 94

public procedure TIniFileKeyList.Clear; override;

Description

Clear removes all TIniFileKey instances from the list, and frees the instances.

See also

TIniFileKey

Object representing a key=value pair in the ini file.


TIniFileKeyList.Destroy

Free the instance

Declaration

Source position: inifiles.pp line 93

public destructor TIniFileKeyList.Destroy; override;

Description

Destroy clears up the list using Clear and then calls the inherited destroy.

See also

Clear

Clear the list


TIniFileKeyList.Items

Indexed access to TIniFileKey items in the list

Declaration

Source position: inifiles.pp line 95

public property TIniFileKeyList.Items: TIniFileKey
  read GetItem;
  default;

Description

Items provides indexed access to the TIniFileKey items in the list. The index is zero-based and runs from 0 to Count-1.

See also

TIniFileKey

Object representing a key=value pair in the ini file.


TIniFileSection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ini file section object

Declaration

Source position: inifiles.pp line 98

type TIniFileSection = class
public
function Empty; | Is the section empty
constructor Create(); | Create a new section object
destructor Destroy; override; | Free the section object from memory
property Name: String; [r] | Name of the section
property KeyList: TIniFileKeyList; [r] | List of key/value pairs in this section
end;

Inheritance

TIniFileSection

Ini file section object
|

TObject

Description

TIniFileSection is a class which represents a section in the .ini, and is used internally by the TIniFile class (one instance of TIniFileSection is created for each section in the file by the TIniFileSectionList list). The name of the section is stored in the Name property, and the key/value pairs in this section are available in the KeyList property.

See also

TIniFileKeyList | Key list object
TIniFile | Ini file implementation
TIniFileSectionList | Section objects list


TIniFileSection
 | ro | Name
 | ro | KeyList


ro | KeyList (TIniFileSection)
ro | Name (TIniFileSection)


TIniFileSection
 | Empty
 | Create
 | Destroy


TIniFileSection


TIniFileSection.Create

Create a new section object

Declaration

Source position: inifiles.pp line 104

public constructor TIniFileSection.Create(

  AName: String

);

Arguments

AName

Name for the section

Description

Create instantiates a new TIniFileSection class, and sets the name to AName. It allocates a TIniFileKeyList instance to keep all the key/value pairs for this section.

See also

TIniFileKeyList

Key list object


TIniFileSection.Destroy

Free the section object from memory

Declaration

Source position: inifiles.pp line 105

public destructor TIniFileSection.Destroy; override;

Description

Destroy cleans up the key list, and then calls the inherited Destroy, removing the TIniFileSection instance from memory.

See also

Create | Create a new section object
TIniFileKeyList | Key list object


TIniFileSection.Empty

Is the section empty

Declaration

Source position: inifiles.pp line 103

public function TIniFileSection.Empty: Boolean;

Function result

True if the section is empty

Description

Empty returns True if the section contains no key values (even if they are empty). It may contain comments.


TIniFileSection.KeyList

List of key/value pairs in this section

Declaration

Source position: inifiles.pp line 107

public property TIniFileSection.KeyList: TIniFileKeyList
  read FKeyList;

Description

KeyList is the TIniFileKeyList instance that is used by the TIniFileSection to keep the key/value pairs of the section.

See also

TIniFileSection.Name | Name of the section
TIniFileKeyList | Key list object


TIniFileSection.Name

Name of the section

Declaration

Source position: inifiles.pp line 106

public property TIniFileSection.Name: String
  read FName;

Description

Name is the name of the section in the file.

See also

TIniFileSection.KeyList

List of key/value pairs in this section


TIniFileSectionList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Section objects list

Declaration

Source position: inifiles.pp line 110

type TIniFileSectionList = class(TList)
public
destructor Destroy; override; | Free the object from memory
procedure Clear; override; | Clear the list
property Items: TIniFileSection; default; [r] | Indexed access to all the section objects in the list
end;

Inheritance

TIniFileSectionList

Section objects list
|

TList
|

TObject

Description

TIniFileSectionList maintains a list of TIniFileSection instances, one for each section in an .ini file. TIniFileSectionList is used internally by the TIniFile class to represent the sections in the file.

See also

TIniFileSection | Ini file section object
TIniFile | Ini file implementation


TIniFileSectionList
 | ro | Items
TList
 |  | Capacity
 |  | Count
 |  | Items
 | ro | List


ro | Items (TIniFileSectionList)
ro | List (TList)


TIniFileSectionList
 | Destroy
 | Clear
TList
 | CopyMove
 | MergeMove
 | DoCopy
 | DoSrcUnique
 | DoAnd
 | DoDestUnique
 | DoOr
 | DoXOr
 | Get
 | Grow
 | Put
 | Notify
 | SetCapacity
 | GetCapacity
 | SetCount
 | GetCount
 | GetList
 | Create
 | Destroy
 | AddList
 | Add
 | Clear
 | Delete
 | Error
 | Exchange
 | Expand
 | Extract
 | First
 | IndexOf
 | Insert
 | Last
 | Move
 | Assign
 | Remove
 | Pack
 | Sort


Add (TList)

AddList (TList)

Assign (TList)

Clear (TList)

Clear (TIniFileSectionList)

CopyMove (TList)

Create (TList)

Delete (TList)

Destroy (TList)

Destroy (TIniFileSectionList)

DoAnd (TList)

DoCopy (TList)

DoDestUnique (TList)

DoOr (TList)

DoSrcUnique (TList)

DoXOr (TList)

Error (TList)

Exchange (TList)

Expand (TList)

Extract (TList)

First (TList)

Get (TList)

GetCapacity (TList)

GetCount (TList)

GetList (TList)

Grow (TList)

IndexOf (TList)

Insert (TList)

Last (TList)

MergeMove (TList)

Move (TList)

Notify (TList)

Pack (TList)

Put (TList)

Remove (TList)

SetCapacity (TList)

SetCount (TList)

Sort (TList)


TIniFileSectionList

TList


TIniFileSectionList.Clear

Clear the list

Declaration

Source position: inifiles.pp line 116

public procedure TIniFileSectionList.Clear; override;

Description

Clear removes all TIniFileSection items from the list, and frees the items it removes from the list.

See also

TIniFileSection | Ini file section object
TIniFileSectionList.Items | Indexed access to all the section objects in the list


TIniFileSectionList.Destroy

Free the object from memory

Declaration

Source position: inifiles.pp line 115

public destructor TIniFileSectionList.Destroy; override;

Description

Destroy calls Clear to clear the section list and the calls the inherited Destroy

See also

Clear

Clear the list


TIniFileSectionList.Items

Indexed access to all the section objects in the list

Declaration

Source position: inifiles.pp line 117

public property TIniFileSectionList.Items: TIniFileSection
  read GetItem;
  default;

Description

Items provides indexed access to all the section objects in the list. Index should run from 0 to Count-1.

See also

TIniFileSection | Ini file section object
TIniFileSectionList.Clear | Clear the list


TMemIniFile

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Inifile cached in memory

Declaration

Source position: inifiles.pp line 191

type TMemIniFile = class(TIniFile)
public
constructor Create(); override; | Create a new instance of TMemIniFile
procedure Clear; | Clear the data
procedure GetStrings(); | Get contents of ini file as stringlist
procedure Rename(); | Rename the ini file
procedure SetStrings(); | Set data from a stringlist
end;

Inheritance

TMemIniFile | Inifile cached in memory
|
TIniFile | Ini file implementation
|
TCustomIniFile | Abstract ini file object
|
TObject

Description

TMemIniFile is a simple descendent of TIniFile which introduces some extra methods to be compatible to the Delphi implementation of TMemIniFile. The FPC implementation of TIniFile is implemented as a TMemIniFile, except that TIniFile does not cache its updates, and TMemIniFile does.

See also

TIniFile | Ini file implementation
TCustomIniFile | Abstract ini file object
CacheUpdates | Should changes be kept in memory


TMemIniFile
TIniFile
pt | ro | Dirty
 | ro | Stream
 |  | CacheUpdates
TCustomIniFile
 | ro | FileName
 | ro | EscapeLineFeeds
 |  | CaseSensitive
 |  | StripQuotes


TMemIniFile
 | Create
 | Clear
 | GetStrings
 | Rename
 | SetStrings
TIniFile
pt | MaybeUpdateFile
 | Create
 | Destroy
 | ReadString
 | WriteString
 | ReadSection
 | ReadSectionRaw
 | ReadSections
 | ReadSectionValues
 | EraseSection
 | DeleteKey
 | UpdateFile
TCustomIniFile
 | Create
 | Destroy
 | SectionExists
 | ReadString
 | WriteString
 | ReadInteger
 | WriteInteger
 | ReadBool
 | WriteBool
 | ReadDate
 | ReadDateTime
 | ReadFloat
 | ReadTime
 | ReadBinaryStream
 | WriteDate
 | WriteDateTime
 | WriteFloat
 | WriteTime
 | WriteBinaryStream
 | ReadSection
 | ReadSections
 | ReadSectionValues
 | EraseSection
 | DeleteKey
 | UpdateFile
 | ValueExists


 | Clear (TMemIniFile)
 | Create (TCustomIniFile)
 | Create (TIniFile)
 | Create (TMemIniFile)
 | DeleteKey (TCustomIniFile)
 | DeleteKey (TIniFile)
 | Destroy (TCustomIniFile)
 | Destroy (TIniFile)
 | EraseSection (TCustomIniFile)
 | EraseSection (TIniFile)
 | GetStrings (TMemIniFile)
pt | MaybeUpdateFile (TIniFile)
 | ReadBinaryStream (TCustomIniFile)
 | ReadBool (TCustomIniFile)
 | ReadDate (TCustomIniFile)
 | ReadDateTime (TCustomIniFile)
 | ReadFloat (TCustomIniFile)
 | ReadInteger (TCustomIniFile)
 | ReadSection (TCustomIniFile)
 | ReadSection (TIniFile)
 | ReadSectionRaw (TIniFile)
 | ReadSections (TCustomIniFile)
 | ReadSections (TIniFile)
 | ReadSectionValues (TCustomIniFile)
 | ReadSectionValues (TIniFile)
 | ReadString (TCustomIniFile)
 | ReadString (TIniFile)
 | ReadTime (TCustomIniFile)
 | Rename (TMemIniFile)
 | SectionExists (TCustomIniFile)
 | SetStrings (TMemIniFile)
 | UpdateFile (TCustomIniFile)
 | UpdateFile (TIniFile)
 | ValueExists (TCustomIniFile)
 | WriteBinaryStream (TCustomIniFile)
 | WriteBool (TCustomIniFile)
 | WriteDate (TCustomIniFile)
 | WriteDateTime (TCustomIniFile)
 | WriteFloat (TCustomIniFile)
 | WriteInteger (TCustomIniFile)
 | WriteString (TCustomIniFile)
 | WriteString (TIniFile)
 | WriteTime (TCustomIniFile)


TMemIniFile

TIniFile

TCustomIniFile


TMemIniFile.Clear

Clear the data

Declaration

Source position: inifiles.pp line 194

public procedure TMemIniFile.Clear;

Description

Clear removes all sections and key/value pairs from memory. If CacheUpdates is set to False then the file on disk will immediatly be emptied.

See also

SetStrings | Set data from a stringlist
GetStrings | Get contents of ini file as stringlist


TMemIniFile.Create

Create a new instance of TMemIniFile

Declaration

Source position: inifiles.pp line 193

public constructor TMemIniFile.Create(

  const AFileName: String;

  AEscapeLineFeeds: Boolean = false

); override;

Arguments

AFileName | Name of file to read data from
AEscapeLineFeeds | Should linefeed escaping be turned on

Description

Create simply calls the inherited Create, and sets the CacheUpdates to True so updates will be kept in memory till they are explicitly written to disk.

See also

TIniFile.Create | Create a new instance of TIniFile
CacheUpdates | Should changes be kept in memory


TMemIniFile.GetStrings

Get contents of ini file as stringlist

Declaration

Source position: inifiles.pp line 195

public procedure TMemIniFile.GetStrings(

  List: TStrings

);

Arguments

List

Stringlist in which to copy the data

Description

GetStrings returns the whole contents of the ini file in a single stringlist, List. This includes comments and empty sections.

The GetStrings call can be used to get data for a call to SetStrings, which can be used to copy data between 2 in-memory ini files.

See also

SetStrings | Set data from a stringlist
Clear | Clear the data


TMemIniFile.Rename

Rename the ini file

Declaration

Source position: inifiles.pp line 196

public procedure TMemIniFile.Rename(

  const AFileName: String;

  Reload: Boolean

);

Arguments

AFileName | New filename
Reload | Load memory data from new file ?

Description

Rename will rename the ini file with the new name AFileName. If Reload is True then the in-memory contents will be cleared and replaced with the contents found in AFileName, if it exists. If Reload is False, the next call to UpdateFile will replace the contents of AFileName with the in-memory data.

See also

UpdateFile

Update the file on disk


TMemIniFile.SetStrings

Set data from a stringlist

Declaration

Source position: inifiles.pp line 197

public procedure TMemIniFile.SetStrings(

  List: TStrings

);

Arguments

List

Stringlist to get data from

Description

SetStrings sets the in-memory data from the List stringlist. The data is first cleared.

The SetStrings call can be used to set the data of the ini file to a list of strings obtained with GetStrings. The two calls combined can be used to copy data between 2 in-memory ini files.

See also

GetStrings | Get contents of ini file as stringlist
Clear | Clear the data


EIOStreamError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Error thrown in case of an invalid operation on a TIOStream.

Declaration

Source position: iostream.pp line 23

type EIOStreamError = class(EStreamError) end;

Inheritance

EIOStreamError

Error thrown in case of an invalid operation on a TIOStream.
|

EStreamError
|

TObject


EIOStreamError

EStreamError


TIOStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream which handles standard input/output and stderr.

Declaration

Source position: iostream.pp line 25

type TIOStream = class(THandleStream)
public
constructor Create(); | Construct a new instance of TIOStream
function Read(); override; | Read data from the stream.
function Write(); override; | Write data to the stream
procedure SetSize(); override; | Set the size of the stream
function Seek(); override; | Set the stream position
end;

Inheritance

TIOStream

Stream which handles standard input/output and stderr.
|

THandleStream
|

TObject

Description

TIOStream can be used to create a stream which reads from or writes to the standard input, output or stderr file descriptors. It is a descendent of THandleStream. The type of stream that is created is determined by the TIOSType argument to the constructor. The handle of the standard input, output or stderr file descriptors is determined automatically.

The TIOStream keeps an internal Position, and attempts to provide minimal Seek behaviour based on this position.

See also

TIOSType

Type of stream to create

THandleStream


TIOStream

THandleStream

ro

Handle


ro

Handle (THandleStream)


TIOStream
 | Create
 | Read
 | Write
 | SetSize
 | Seek
THandleStream
 | SetSize
 | Create
 | Read
 | Write
 | Seek


Create (THandleStream)

Create (TIOStream)

Read (THandleStream)

Read (TIOStream)

Seek (THandleStream)

Seek (TIOStream)

SetSize (THandleStream)

SetSize (TIOStream)

Write (THandleStream)

Write (TIOStream)


TIOStream

THandleStream


TIOStream.Create

Construct a new instance of TIOStream

Declaration

Source position: iostream.pp line 31

public constructor TIOStream.Create(

  aIOSType: TIOSType

);

Arguments

aIOSType

Type of stream to create

Description

Create creates a new instance of TIOStream, which can subsequently be used

Errors

No checking is performed to see whether the requested file descriptor is actually open for reading/writing. In that case, subsequent calls to Read or Write or seek will fail.

See also

TIOStream.Read | Read data from the stream.
TIOStream.Write | Write data to the stream


TIOStream.Read

Read data from the stream.

Declaration

Source position: iostream.pp line 32

public function TIOStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer for the read data
Count | Number of bytes to read

Function result

The number of bytes actually read

Description

Read checks first whether the type of the stream allows reading (type is iosInput). If not, it raises a EIOStreamError exception. If the stream can be read, it calls the inherited Read to actually read the data.

Errors

An EIOStreamError exception is raised if the stream does not allow reading.

See also

TIOSType | Type of stream to create
TIOStream.Write | Write data to the stream


TIOStream.Seek

Set the stream position

Declaration

Source position: iostream.pp line 35

public function TIOStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Byte offset to position the stream on
Origin | Where to start the byte offset

Function result

New position of the stream.

Description

Seek overrides the standard Seek implementation. Normally, standard input, output and stderr are not seekable. The TIOStream stream tries to provide seek capabilities for the following limited number of cases:

Origin=soFromBeginning
If Offset is larger than the current position, then the remaining bytes are skipped by reading them from the stream and discarding them, if the stream is of type iosInput.
Origin=soFromCurrent
If Offset is zero, the current position is returned. If it is positive, then Offset bytes are skipped by reading them from the stream and discarding them, if the stream is of type iosInput.

All other cases will result in a EIOStreamError exception.

Errors

An EIOStreamError exception is raised if the stream does not allow the requested seek operation.

See also

EIOStreamError

Error thrown in case of an invalid operation on a TIOStream.


TIOStream.SetSize

Set the size of the stream

Declaration

Source position: iostream.pp line 34

public procedure TIOStream.SetSize(

  NewSize: LongInt

); override;

Arguments

NewSize

New size for the stream/

Description

SetSize overrides the standard SetSize implementation. It always raises an exception, because the standard input, output and stderr files have no size.

Errors

An EIOStreamError exception is raised when this method is called.

See also

EIOStreamError

Error thrown in case of an invalid operation on a TIOStream.


TIOStream.Write

Write data to the stream

Declaration

Source position: iostream.pp line 33

public function TIOStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer containing the data to be written.
Count | Number of bytes to write.

Function result

Number of bytes actually written.

Description

Write checks first whether the type of the stream allows writing (type is iosOutput or iosError). If not, it raises a EIOStreamError exception. If the stream can be written to, it calls the inherited Write to actually read the data.

Errors

An EIOStreamError exception is raised if the stream does not allow writing.

See also

TIOSType | Type of stream to create
TIOStream.Read | Read data from the stream.


TTarArchive

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to examine and read tar archives

Declaration

Source position: libtar.pp line 152

type TTarArchive = class
protected
FStream: TStream;
FOwnsStream: Boolean;
FBytesToGo: Int64;
public
procedure Create(); | Create a new instance of the archive
destructor Destroy; override; | Destroy TTarArchive instance
procedure Reset; | Reset archive
function FindNext(); | Find next archive entry
procedure ReadFile(); | Read a file from the archive
procedure GetFilePos(); | Return current archive position
procedure SetFilePos(); | Set position in archive
end;

Inheritance

TTarArchive

Class to examine and read tar archives
|

TObject

Description

TTarArchive is the class used to read and examine .tar archives. It can be constructed from a stream or from a filename. Creating an instance will not perform any operation on the stream yet.

See also

TTarWriter | Class to write tar archives
FindNext | Find next archive entry


TTarArchive


TTarArchive
 | Create
 | Destroy
 | Reset
 | FindNext
 | ReadFile
 | GetFilePos
 | SetFilePos


Create (TTarArchive)

Destroy (TTarArchive)

FindNext (TTarArchive)

GetFilePos (TTarArchive)

ReadFile (TTarArchive)

Reset (TTarArchive)

SetFilePos (TTarArchive)


TTarArchive.Create

Create a new instance of the archive

Declaration

Source position: line 0

public constructor TTarArchive.Create(

  Stream: TStream

); overload;

constructor TTarArchive.Create(

  Filename: String;

  FileMode: Word = fmOpenRead or fmShareDenyWrite

); overload;

Arguments

Stream

Stream to read archive from

Arguments

Filename | Filename to open and read archive from
FileMode | Filemode to open file with.

Description

Create can be used to create a new instance of TTarArchive using either a Stream TStream descendent or using a name of a file to open: FileName. In case of the filename, an open mode can be specified.

Errors

In case a filename is specified and the file cannot be opened, an exception will occur.

See also

FindNext

Find next archive entry


TTarArchive.Destroy

Destroy TTarArchive instance

Declaration

Source position: libtar.pp line 161

public destructor TTarArchive.Destroy; override;

Description

Destroy closes the archive stream (if it created a stream) and cleans up the TTarArchive instance.

See also

TTarArchive.Create

Create a new instance of the archive


TTarArchive.FBytesToGo

Declaration

Source position: libtar.pp line 156

protected TTarArchive.FBytesToGo: Int64;


TTarArchive.FindNext

Find next archive entry

Declaration

Source position: libtar.pp line 163

public function TTarArchive.FindNext(

  var DirRec: TTarDirRec

):Boolean;

Arguments

DirRec

Information about the archive

Function result

True if the next entry was found.

Description

FindNext positions the file pointer on the next archive entry, and returns all information about the entry in DirRec. It returns True if the operation was succeful, or False if not (for instance, when the end of the archive was reached).

Errors

In case there are no more entries, False is returned.

See also

TTarArchive.ReadFile

Read a file from the archive


TTarArchive.FOwnsStream

Declaration

Source position: libtar.pp line 155

protected TTarArchive.FOwnsStream: Boolean;


TTarArchive.FStream

Declaration

Source position: libtar.pp line 154

protected TTarArchive.FStream: TStream;


TTarArchive.GetFilePos

Return current archive position

Declaration

Source position: libtar.pp line 169

public procedure TTarArchive.GetFilePos(

  var Current: Int64;

  var Size: Int64

);

Arguments

Current | Current position in archive
Size | Archive size

Description

GetFilePos returns the position in the tar archive in Current and the complete archive size in Size.

See also

TTarArchive.SetFilePos | Set position in archive
TTarArchive.Reset | Reset archive


TTarArchive.ReadFile

Read a file from the archive

Declaration

Source position: line 0

public procedure TTarArchive.ReadFile(

  Buffer: POINTER

); overload;

procedure TTarArchive.ReadFile(

  Stream: TStream

); overload;

procedure TTarArchive.ReadFile(

  Filename: String

); overload;

function TTarArchive.ReadFile: String; overload;

Arguments

Buffer

Memory buffer to copy file contents to.

Arguments

Stream

Stream to copy file contents to.

Arguments

Filename

Filename for file in which to write file content.

Function result

File contents as string

Description

ReadFile can be used to read the current file in the archive. It can be called after the archive was succesfully positioned on an entry in the archive. The file can be read in various ways:

  • directly in a memory buffer. No checks are performed to see whether the buffer points to enough memory.
  • It can be copied to a Stream.
  • It can be copied to a file with name FileName.
  • The file content can be copied to a string

Errors

An exception may occur if the buffer is not large enough, or when the file specified in filename cannot be opened.


TTarArchive.Reset

Reset archive

Declaration

Source position: libtar.pp line 162

public procedure TTarArchive.Reset;

Description

Reset sets the archive file position on the beginning of the archive.

See also

TTarArchive.Create

Create a new instance of the archive


TTarArchive.SetFilePos

Set position in archive

Declaration

Source position: libtar.pp line 170

public procedure TTarArchive.SetFilePos(

  NewPos: Int64

);

Arguments

NewPos

New position in the archive

Description

SetFilePos can be used to set the absolute position in the tar archive.

See also

TTarArchive.Reset | Reset archive
TTarArchive.GetFilePos | Return current archive position


TTarWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to write tar archives

Declaration

Source position: libtar.pp line 174

type TTarWriter = class
protected
FStream: TStream;
FOwnsStream: Boolean;
FFinalized: Boolean;
FPermissions: TTarPermissions;
FUID: Integer;
FGID: Integer;
FUserName: String;
FGroupName: String;
FMode: TTarModes;
FMagic: String;
constructor CreateEmpty;
public
procedure Create(); | Create a new archive
destructor Destroy; override; | Close archive and clean up TTarWriter
procedure AddFile(); | Add a file to the archive
procedure AddStream(); | Add stream contents to archive.
procedure AddString(); | Add string as file data
procedure AddDir(); | Add directory to archive
procedure AddSymbolicLink(); | Add a symbolic link to the archive
procedure AddLink(); | Add hard link to archive
procedure AddVolumeHeader(); | Add volume header entry
procedure Finalize; | Finalize the archive
property Permissions: TTarPermissions; [rw] | Archive entry permissions
property UID: Integer; [rw] | Archive entry user ID
property GID: Integer; [rw] | Archive entry group ID
property UserName: String; [rw] | Archive entry user name
property GroupName: String; [rw] | Archive entry group name
property Mode: TTarModes; [rw] | Archive entry mode
property Magic: String; [rw] | Archive entry Magic constant
end;

Inheritance

TTarWriter

Class to write tar archives
|

TObject

Description

TTarWriter can be used to create .tar archives. It can be created using a filename, in which case the archive will be written to the filename, or it can be created using a stream, in which case the archive will be written to the stream - for instance a compression stream.

See also

TTarArchive

Class to examine and read tar archives


TTarWriter
 | Permissions
 | UID
 | GID
 | UserName
 | GroupName
 | Mode
 | Magic


GID (TTarWriter)

GroupName (TTarWriter)

Magic (TTarWriter)

Mode (TTarWriter)

Permissions (TTarWriter)

UID (TTarWriter)

UserName (TTarWriter)


TTarWriter
pt | CreateEmpty
 | Create
 | Destroy
 | AddFile
 | AddStream
 | AddString
 | AddDir
 | AddSymbolicLink
 | AddLink
 | AddVolumeHeader
 | Finalize


 | AddDir (TTarWriter)
 | AddFile (TTarWriter)
 | AddLink (TTarWriter)
 | AddStream (TTarWriter)
 | AddString (TTarWriter)
 | AddSymbolicLink (TTarWriter)
 | AddVolumeHeader (TTarWriter)
 | Create (TTarWriter)
pt | CreateEmpty (TTarWriter)
 | Destroy (TTarWriter)
 | Finalize (TTarWriter)


TTarWriter


TTarWriter.AddDir

Add directory to archive

Declaration

Source position: libtar.pp line 195

public procedure TTarWriter.AddDir(

  Dirname: String;

  DateGmt: TDateTime;

  MaxDirSize: Int64 = 0

);

Arguments

Dirname | Directory name to add
DateGmt | Directory timestamp
MaxDirSize | Max directory size

Description

AddDir adds a directory entry to the archive. The entry is written with name DirName, maximum directory size MaxDirSize (0 means unlimited) and timestamp DateGmt.

Note that this call only adds an entry for a directory to the archive: if DirName is an existing directory, it does not write all files in the directory to the archive.

The directory entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddLink | Add hard link to archive
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddString | Add string as file data
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddFile

Add a file to the archive

Declaration

Source position: libtar.pp line 192

public procedure TTarWriter.AddFile(

  Filename: String;

  TarFilename: String = ''

);

Arguments

Filename | File to add to the archive
TarFilename | Alternative filename, stored in archive

Description

AddFile adds a file to the archive: the contents is read from FileName. Optionally, an alternative filename can be specified in TarFileName. This name should contain only forward slash path separators. If it is not specified, the name will be computed from FileName.

The archive entry is written with the current owner data and permissions.

Errors

If FileName cannot be opened, an exception will be raised.

See also

TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddString | Add string as file data
TTarWriter.AddLink | Add hard link to archive
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddLink

Add hard link to archive

Declaration

Source position: libtar.pp line 197

public procedure TTarWriter.AddLink(

  Filename: String;

  Linkname: String;

  DateGmt: TDateTime

);

Arguments

Filename | Entry filename
Linkname | Target of hard link
DateGmt | Timestamp of entry

Description

AddLink adds a hard link entry to the archive. The entry has name FileName, timestamp DateGmt and points to LinkName.

The link entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddString | Add string as file data
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddStream

Add stream contents to archive.

Declaration

Source position: libtar.pp line 193

public procedure TTarWriter.AddStream(

  Stream: TStream;

  TarFilename: String;

  FileDateGmt: TDateTime

);

Arguments

Stream | Stream data to be added to archive
TarFilename | Archive entry name
FileDateGmt | Archive entry timestamp

Description

AddStream will add the contents of Stream to the archive. The Stream will not be reset: only the contents of the stream from the current position will be written to the archive. The entry will be written with file name TarFileName. This name should contain only forward slash path separators. The entry will be written with timestamp FileDateGmt.

The archive entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddString | Add string as file data
TTarWriter.AddLink | Add hard link to archive
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddString

Add string as file data

Declaration

Source position: libtar.pp line 194

public procedure TTarWriter.AddString(

  Contents: String;

  TarFilename: String;

  FileDateGmt: TDateTime

);

Arguments

Contents | Data for file entry
TarFilename | Name for filename
FileDateGmt | Timestamp for filename.

Description

AddString adds the string Contents as the data of an entry with file name TarFileName. This name should contain only forward slash path separators. The entry will be written with timestamp FileDateGmt.

The archive entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddLink | Add hard link to archive
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddSymbolicLink

Add a symbolic link to the archive

Declaration

Source position: libtar.pp line 196

public procedure TTarWriter.AddSymbolicLink(

  Filename: String;

  Linkname: String;

  DateGmt: TDateTime

);

Arguments

Filename | Filename for entry
Linkname | Target of symbolic link
DateGmt | Timestamp of entry

Description

AddSymbolicLink adds a symbolic link entry to the archive, with name FileName, pointing to LinkName. The entry is written with timestamp DateGmt.

The link entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddLink | Add hard link to archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddString | Add string as file data
TTarWriter.AddVolumeHeader | Add volume header entry


TTarWriter.AddVolumeHeader

Add volume header entry

Declaration

Source position: libtar.pp line 198

public procedure TTarWriter.AddVolumeHeader(

  VolumeId: String;

  DateGmt: TDateTime

);

Arguments

VolumeId | Volume name to write
DateGmt | Timestamp of archive entry

Description

AddVolumeHeader adds a volume header entry to the archive. The entry is written with name VolumeID and timestamp DateGmt.

The volume header entry is written with the current owner data and permissions.

See also

TTarWriter.AddFile | Add a file to the archive
TTarWriter.AddStream | Add stream contents to archive.
TTarWriter.AddSymbolicLink | Add a symbolic link to the archive
TTarWriter.AddDir | Add directory to archive
TTarWriter.AddString | Add string as file data
TTarWriter.AddLink | Add hard link to archive


TTarWriter.Create

Create a new archive

Declaration

Source position: line 0

public constructor TTarWriter.Create(

  TargetStream: TStream

); overload;

constructor TTarWriter.Create(

  TargetFilename: String;

  Mode: Integer = fmCreate

); overload;

Arguments

TargetStream

Stream to write archive to.

Arguments

TargetFilename | Filename to write archive to.
Mode | Mode to open target file with. File must be writable

Description

Create creates a new TTarWriter instance. This will start a new .tar archive. The archive will be written to the TargetStream stream or to a file with name TargetFileName, which will be opened with filemode Mode.

Errors

In case TargetFileName cannot be opened, an exception will be raised.

See also

TTarWriter.Destroy

Close archive and clean up TTarWriter


TTarWriter.CreateEmpty

Declaration

Source position: libtar.pp line 187

protected constructor TTarWriter.CreateEmpty;


TTarWriter.Destroy

Close archive and clean up TTarWriter

Declaration

Source position: libtar.pp line 191

public destructor TTarWriter.Destroy; override;

Description

Destroy will close the archive (i.e. it writes the end-of-archive marker, if it was not yet written), and then frees the TTarWriter instance.

See also

TTarWriter.Finalize

Finalize the archive


TTarWriter.FFinalized

Declaration

Source position: libtar.pp line 178

protected TTarWriter.FFinalized: Boolean;


TTarWriter.FGID

Declaration

Source position: libtar.pp line 182

protected TTarWriter.FGID: Integer;


TTarWriter.FGroupName

Declaration

Source position: libtar.pp line 184

protected TTarWriter.FGroupName: String;


TTarWriter.Finalize

Finalize the archive

Declaration

Source position: libtar.pp line 199

public procedure TTarWriter.Finalize;

Description

Finalize writes the end-of-archive marker to the archive. No more entries can be added after Finalize was called.

If the TTarWriter instance is destroyed, it will automatically call finalize if finalize was not yet called.

See also

TTarWriter.Destroy

Close archive and clean up TTarWriter


TTarWriter.FMagic

Declaration

Source position: libtar.pp line 186

protected TTarWriter.FMagic: String;


TTarWriter.FMode

Declaration

Source position: libtar.pp line 185

protected TTarWriter.FMode: TTarModes;


TTarWriter.FOwnsStream

Declaration

Source position: libtar.pp line 177

protected TTarWriter.FOwnsStream: Boolean;


TTarWriter.FPermissions

Declaration

Source position: libtar.pp line 180

protected TTarWriter.FPermissions: TTarPermissions;


TTarWriter.FStream

Declaration

Source position: libtar.pp line 176

protected TTarWriter.FStream: TStream;


TTarWriter.FUID

Declaration

Source position: libtar.pp line 181

protected TTarWriter.FUID: Integer;


TTarWriter.FUserName

Declaration

Source position: libtar.pp line 183

protected TTarWriter.FUserName: String;


TTarWriter.GID

Archive entry group ID

Declaration

Source position: libtar.pp line 202

public property TTarWriter.GID: Integer
  read FGID
  write FGID;

Description

GID is used for the GID field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.GroupName

Archive entry group name

Declaration

Source position: libtar.pp line 204

public property TTarWriter.GroupName: String
  read FGroupName
  write FGroupName;

Description

GroupName is used for the GroupName field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.Magic

Archive entry Magic constant

Declaration

Source position: libtar.pp line 206

public property TTarWriter.Magic: String
  read FMagic
  write FMagic;

Description

Magic is used for the Magic field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.Mode

Archive entry mode

Declaration

Source position: libtar.pp line 205

public property TTarWriter.Mode: TTarModes
  read FMode
  write FMode;

Description

Mode is used for the Mode field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.Permissions

Archive entry permissions

Declaration

Source position: libtar.pp line 200

public property TTarWriter.Permissions: TTarPermissions
  read FPermissions
  write FPermissions;

Description

Permissions is used for the permissions field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.UID

Archive entry user ID

Declaration

Source position: libtar.pp line 201

public property TTarWriter.UID: Integer
  read FUID
  write FUID;

Description

UID is used for the UID field of the archive entries.

See also

TTarDirRec

Tar Directory entry


TTarWriter.UserName

Archive entry user name

Declaration

Source position: libtar.pp line 203

public property TTarWriter.UserName: String
  read FUserName
  write FUserName;

Description

UserName is used for the UserName field of the archive entries.

See also

TTarDirRec

Tar Directory entry


EPipeCreation

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurred during the creation of a pipe pair.

Declaration

Source position: pipes.pp line 27

type EPipeCreation = class(EPipeError) end;

Inheritance

EPipeCreation | Exception raised when an error occurred during the creation of a pipe pair.
|
EPipeError | Exception raised when an invalid operation is performed on a pipe stream.
|
EStreamError
|
TObject


EPipeCreation

EPipeError

EStreamError


EPipeError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an invalid operation is performed on a pipe stream.

Declaration

Source position: pipes.pp line 25

type EPipeError = class(EStreamError) end;

Inheritance

EPipeError

Exception raised when an invalid operation is performed on a pipe stream.
|

EStreamError
|

TObject


EPipeError

EStreamError


EPipeSeek

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an invalid seek operation is attempted on a pipe.

Declaration

Source position: pipes.pp line 26

type EPipeSeek = class(EPipeError) end;

Inheritance

EPipeSeek | Exception raised when an invalid seek operation is attempted on a pipe.
|
EPipeError | Exception raised when an invalid operation is performed on a pipe stream.
|
EStreamError
|
TObject


EPipeSeek

EPipeError

EStreamError


TInputPipeStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TStream descendent which wraps the read end of a pipe.

Declaration

Source position: pipes.pp line 31

type TInputPipeStream = class(THandleStream)
public
function Write(); override; | Write data to the stream.
function Seek(); override; | Set the current position of the stream
function Read(); override; | Read data from the stream to a buffer.
property NumBytesAvailable: DWord; [r] | Number of bytes available for reading.
end;

Inheritance

TInputPipeStream

TStream descendent which wraps the read end of a pipe.
|

THandleStream
|

TObject

Description

TInputPipeStream is created by the CreatePipeStreams call to represent the reading end of a pipe. It is a TStream descendent which does not allow writing, and which mimics the seek operation.

See also

TStream
CreatePipeStreams | Create a pair of pipe stream.
TOutputPipeStream | TStream descendent which wraps the write end of a pipe.


TInputPipeStream
 | ro | NumBytesAvailable
THandleStream
 | ro | Handle


ro | Handle (THandleStream)
ro | NumBytesAvailable (TInputPipeStream)


TInputPipeStream
 | Write
 | Seek
 | Read
THandleStream
 | SetSize
 | Create
 | Read
 | Write
 | Seek


Create (THandleStream)

Read (THandleStream)

Read (TInputPipeStream)

Seek (THandleStream)

Seek (TInputPipeStream)

SetSize (THandleStream)

Write (THandleStream)

Write (TInputPipeStream)


TInputPipeStream

THandleStream


TInputPipeStream.NumBytesAvailable

Number of bytes available for reading.

Declaration

Source position: pipes.pp line 39

public property TInputPipeStream.NumBytesAvailable: DWord
  read GetNumBytesAvailable;

Description

NumBytesAvailable is the number of bytes available for reading. This is the number of bytes in the OS buffer for the pipe. It is not a number of bytes in an internal buffer.

If this number is nonzero, then reading NumBytesAvailable bytes from the stream will not block the process. Reading more than NumBytesAvailable bytes will block the process, while it waits for the requested number of bytes to become available.

See also

TInputPipeStream.Read

Read data from the stream to a buffer.


TInputPipeStream.Read

Read data from the stream to a buffer.

Declaration

Source position: pipes.pp line 38

public function TInputPipeStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer where to write the data read from the stream.
Count | Number of bytes to read from the stream.

Function result

Number of bytes actually read from the stream.

Description

Read calls the inherited read and adjusts the internal position pointer of the stream.

Errors

None.

See also

Write | Write data to the stream.
Seek | Set the current position of the stream


TInputPipeStream.Seek

Set the current position of the stream

Declaration

Source position: pipes.pp line 37

public function TInputPipeStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset, in bytes, starting at Origin
Origin | Where to start counting Offset bytes.

Function result

New position of the stream.

Description

Seek overrides the standard Seek implementation. Normally, pipe streams stderr are not seekable. The TInputPipeStream stream tries to provide seek capabilities for the following limited number of cases:

Origin=soFromBeginning
If Offset is larger than the current position, then the remaining bytes are skipped by reading them from the stream and discarding them.
Origin=soFromCurrent
If Offset is zero, the current position is returned. If it is positive, then Offset bytes are skipped by reading them from the stream and discarding them, if the stream is of type iosInput.

All other cases will result in a EPipeSeek exception.

Errors

An EPipeSeek exception is raised if the stream does not allow the requested seek operation.

See also

EPipeSeek

Exception raised when an invalid seek operation is attempted on a pipe.

Seek


TInputPipeStream.Write

Write data to the stream.

Declaration

Source position: pipes.pp line 36

public function TInputPipeStream.Write(

  const Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer containing the data to be written.
Count | Number of bytes that must be written.

Function result

Number of bytes actually written.

Description

Write overrides the parent implementation of Write. On a TInputPipeStream will always raise an exception, as the pipe is read-only.

Errors

An ENoWritePipe exception is raised when this function is called.

See also

Read | Read data from the stream to a buffer.
Seek | Set the current position of the stream


TOutputPipeStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TStream descendent which wraps the write end of a pipe.

Declaration

Source position: pipes.pp line 42

type TOutputPipeStream = class(THandleStream)
public
function Seek(); override; | Sets the position in the stream
function Read(); override; | Read data from the stream.
end;

Inheritance

TOutputPipeStream

TStream descendent which wraps the write end of a pipe.
|

THandleStream
|

TObject

Description

TOutputPipeStream is created by the CreatePipeStreams call to represent the writing end of a pipe. It is a TStream descendent which does not allow reading.

See also

TStream
CreatePipeStreams | Create a pair of pipe stream.
TInputPipeStream | TStream descendent which wraps the read end of a pipe.


TOutputPipeStream

THandleStream

ro

Handle


TOutputPipeStream
 | Seek
 | Read
THandleStream
 | SetSize
 | Create
 | Read
 | Write
 | Seek


Create (THandleStream)

Read (THandleStream)

Read (TOutputPipeStream)

Seek (THandleStream)

Seek (TOutputPipeStream)

SetSize (THandleStream)

Write (THandleStream)


TOutputPipeStream

THandleStream


TOutputPipeStream.Read

Read data from the stream.

Declaration

Source position: pipes.pp line 45

public function TOutputPipeStream.Read(

  var Buffer;

  Count: LongInt

):LongInt; override;

Arguments

Buffer | Memory buffer where to write the data read from the stream.
Count | Number of bytes to read from the stream.

Function result

Number of bytes actually read from the stream.

Description

Read overrides the parent Read implementation. It always raises an exception, because a output pipe is write-only.

Errors

An ENoReadPipe exception is raised when this function is called.

See also

Seek

Sets the position in the stream


TOutputPipeStream.Seek

Sets the position in the stream

Declaration

Source position: pipes.pp line 44

public function TOutputPipeStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset | Offset, in bytes, starting at Origin
Origin | Where to start counting Offset bytes.

Function result

New position of the stream.

Description

Seek is overridden in TOutputPipeStream. Calling this method will always raise an exception: an output pipe is not seekable.

Errors

An EPipeSeek exception is raised if this method is called.


TNonFreePooledMemManager

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Memory manager for fixed memory blocks which does not free any memory

Declaration

Source position: pooledmm.pp line 73

type TNonFreePooledMemManager = class
public
ClearOnCreate: Boolean; | Determines whether newly allocated memory should be cleared
property ItemSize: Integer; [r] | Size of an item in the list
procedure Clear; | Clears the memory
constructor Create(); | Creates a new instance of TNonFreePooledMemManager
destructor Destroy; override; | Removes the TNonFreePooledMemManager instance from memory
function NewItem; | Return a pointer to a new memory block
procedure EnumerateItems(); | Enumerate all items in the list
end;

Inheritance

TNonFreePooledMemManager

Memory manager for fixed memory blocks which does not free any memory
|

TObject

Description

TNonFreePooledMemManager keeps a list of fixed-size memory blocks in memory. Each block has the same size, making it suitable for storing a lot of records of the same type. It does not free the items stored in it, except when the list is cleared as a whole.

It allocates memory for the blocks in a exponential way, i.e. each time a new block of memory must be allocated, it's size is the double of the last block. The first block will contain 8 items.


TNonFreePooledMemManager

ro

ItemSize


ro

ItemSize (TNonFreePooledMemManager)


TNonFreePooledMemManager
 | Clear
 | Create
 | Destroy
 | NewItem
 | EnumerateItems


Clear (TNonFreePooledMemManager)

Create (TNonFreePooledMemManager)

Destroy (TNonFreePooledMemManager)

EnumerateItems (TNonFreePooledMemManager)

NewItem (TNonFreePooledMemManager)


TNonFreePooledMemManager


TNonFreePooledMemManager.Clear

Clears the memory

Declaration

Source position: pooledmm.pp line 84

public procedure TNonFreePooledMemManager.Clear;

Description

Clear clears all blocks from memory, freeing the allocated memory blocks. None of the pointers returned by NewItem is valid after a call to Clear

See also

NewItem

Return a pointer to a new memory block


TNonFreePooledMemManager.ClearOnCreate

Determines whether newly allocated memory should be cleared

Declaration

Source position: pooledmm.pp line 82

public TNonFreePooledMemManager.ClearOnCreate: Boolean;

Description

ClearOnCreate is a public variable, it determines whether a newly allocated block of memory will be filled with zeroes (if set to True) or not (if set to False).

See also

TNonFreePooledMemManager.NewItem

Return a pointer to a new memory block


TNonFreePooledMemManager.Create

Creates a new instance of TNonFreePooledMemManager

Declaration

Source position: pooledmm.pp line 85

public constructor TNonFreePooledMemManager.Create(

  TheItemSize: Integer

);

Arguments

TheItemSize

Size of the items in the list

Description

Create creates a new instance of TNonFreePooledMemManager and sets the item size to TheItemSize.

Errors

If not enough memory is available, an exception may be raised.

See also

TNonFreePooledMemManager.ItemSize

Size of an item in the list


TNonFreePooledMemManager.Destroy

Removes the TNonFreePooledMemManager instance from memory

Declaration

Source position: pooledmm.pp line 86

public destructor TNonFreePooledMemManager.Destroy; override;

Description

Destroy clears the list, clears the internal structures, and then calls the inherited Destroy.

Destroy should never be called directly. Instead Free should be used, or FreeAndNil

See also

TNonFreePooledMemManager.Create | Creates a new instance of TNonFreePooledMemManager
TNonFreePooledMemManager.Clear | Clears the memory


TNonFreePooledMemManager.EnumerateItems

Enumerate all items in the list

Declaration

Source position: pooledmm.pp line 88

public procedure TNonFreePooledMemManager.EnumerateItems(

  const Method: TEnumItemsMethod

);

Arguments

Method

Callback to call

Description

EnumerateItems will enumerate over all items in the list, passing the items to Method. This can be used to execute certain operations on all items in the list. (for example, simply list them)


TNonFreePooledMemManager.ItemSize

Size of an item in the list

Declaration

Source position: pooledmm.pp line 83

public property TNonFreePooledMemManager.ItemSize: Integer
  read FItemSize;

Description

ItemSize is the size of a single block in the list. It's a fixed size determined when the list is created.

See also

TNonFreePooledMemManager.Create

Creates a new instance of TNonFreePooledMemManager


TNonFreePooledMemManager.NewItem

Return a pointer to a new memory block

Declaration

Source position: pooledmm.pp line 87

public function TNonFreePooledMemManager.NewItem: Pointer;

Function result

Pointer to a new memory block

Description

NewItem returns a pointer to an unused memory block of size ItemSize. It will allocate new memory on the heap if necessary.

Note that there is no way to mark the memory block as free, except by clearing the whole list.

Errors

If no more memory is available, an exception may be raised.

See also

TNonFreePooledMemManager.Clear

Clears the memory


TPooledMemManager

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Pooled memory manager

Declaration

Source position: pooledmm.pp line 40

type TPooledMemManager = class
protected
FFirstFree: PPooledMemManagerItem;
FFreeCount: Integer;
FCount: Integer;
FMinFree: Integer;
FMaxFreeRatio: Integer;
FAllocatedCount: Int64;
FFreedCount: Int64;
procedure DisposeItem();
function NewItem;
procedure FreeFirstItem; virtual;
public
property MinimumFreeCount: Integer; [rw] | Minimum count of free items in the list
property MaximumFreeCountRatio: Integer; [rw] | Maximum ratio of free items over total items
property Count: Integer; [r] | Number of items in the list
property FreeCount: Integer; [r] | Number of free items in the list
property AllocatedCount: Int64; [r] | Total number of allocated items in the list
property FreedCount: Int64; [r] | Total number of freed items in the list.
procedure Clear; | Clears the list
constructor Create; | Creates a new instance of the TPooledMemManager class
destructor Destroy; override; | Removes an instance of TPooledMemManager class from memory
end;

Inheritance

TPooledMemManager

Pooled memory manager
|

TObject

Description

TPooledMemManager is a class which maintains a linked list of blocks, represented by the TPooledMemManagerItem record. It should not be used directly, but should be descended from and the descendent should implement the actual memory manager.

See also

TPooledMemManagerItem

Item used in a linked list


TPooledMemManager
 |  | MinimumFreeCount
 |  | MaximumFreeCountRatio
 | ro | Count
 | ro | FreeCount
 | ro | AllocatedCount
 | ro | FreedCount


ro | AllocatedCount (TPooledMemManager)
ro | Count (TPooledMemManager)
ro | FreeCount (TPooledMemManager)
ro | FreedCount (TPooledMemManager)
 | MaximumFreeCountRatio (TPooledMemManager)
 | MinimumFreeCount (TPooledMemManager)


TPooledMemManager
pt | DisposeItem
pt | NewItem
pt | FreeFirstItem
 | Clear
 | Create
 | Destroy


pt | DisposeItem (TPooledMemManager)
pt | FreeFirstItem (TPooledMemManager)
pt | NewItem (TPooledMemManager)


TPooledMemManager


TPooledMemManager.AllocatedCount

Total number of allocated items in the list

Declaration

Source position: pooledmm.pp line 61

public property TPooledMemManager.AllocatedCount: Int64
  read FAllocatedCount;

Description

AllocatedCount is the total number of newly allocated items on the list.

See also

TPooledMemManager.Count | Number of items in the list
TPooledMemManager.FreeCount | Number of free items in the list
TPooledMemManager.FreedCount | Total number of freed items in the list.


TPooledMemManager.Clear

Clears the list

Declaration

Source position: pooledmm.pp line 63

public procedure TPooledMemManager.Clear;

Description

Clear clears the list, it disposes all items in the list.

See also

TPooledMemManager.FreedCount

Total number of freed items in the list.


TPooledMemManager.Count

Number of items in the list

Declaration

Source position: pooledmm.pp line 59

public property TPooledMemManager.Count: Integer
  read FCount;

Description

Count is the total number of items allocated from the list.

See also

TPooledMemManager.FreeCount | Number of free items in the list
TPooledMemManager.AllocatedCount | Total number of allocated items in the list
TPooledMemManager.FreedCount | Total number of freed items in the list.


TPooledMemManager.Create

Creates a new instance of the TPooledMemManager class

Declaration

Source position: pooledmm.pp line 64

public constructor TPooledMemManager.Create;

Description

Create initializes all necessary properties and then calls the inherited create.

See also

TPooledMemManager.Destroy

Removes an instance of TPooledMemManager class from memory


TPooledMemManager.Destroy

Removes an instance of TPooledMemManager class from memory

Declaration

Source position: pooledmm.pp line 65

public destructor TPooledMemManager.Destroy; override;

Description

Destroy calls Clear and then calls the inherited destroy.

Destroy should never be called directly. Instead Free should be used, or FreeAndNil

See also

TPooledMemManager.Create

Creates a new instance of the TPooledMemManager class


TPooledMemManager.DisposeItem

Declaration

Source position: pooledmm.pp line 52

protected procedure TPooledMemManager.DisposeItem(

  AnItem: PPooledMemManagerItem

);


TPooledMemManager.FAllocatedCount

Declaration

Source position: pooledmm.pp line 50

protected TPooledMemManager.FAllocatedCount: Int64;


TPooledMemManager.FCount

Declaration

Source position: pooledmm.pp line 47

protected TPooledMemManager.FCount: Integer;


TPooledMemManager.FFirstFree

Declaration

Source position: pooledmm.pp line 45

protected TPooledMemManager.FFirstFree: PPooledMemManagerItem;


TPooledMemManager.FFreeCount

Declaration

Source position: pooledmm.pp line 46

protected TPooledMemManager.FFreeCount: Integer;


TPooledMemManager.FFreedCount

Declaration

Source position: pooledmm.pp line 51

protected TPooledMemManager.FFreedCount: Int64;


TPooledMemManager.FMaxFreeRatio

Declaration

Source position: pooledmm.pp line 49

protected TPooledMemManager.FMaxFreeRatio: Integer;


TPooledMemManager.FMinFree

Declaration

Source position: pooledmm.pp line 48

protected TPooledMemManager.FMinFree: Integer;


TPooledMemManager.FreeCount

Number of free items in the list

Declaration

Source position: pooledmm.pp line 60

public property TPooledMemManager.FreeCount: Integer
  read FFreeCount;

Description

FreeCount is the current total number of free items in the list.

See also

TPooledMemManager.Count | Number of items in the list
TPooledMemManager.AllocatedCount | Total number of allocated items in the list
TPooledMemManager.FreedCount | Total number of freed items in the list.


TPooledMemManager.FreedCount

Total number of freed items in the list.

Declaration

Source position: pooledmm.pp line 62

public property TPooledMemManager.FreedCount: Int64
  read FFreedCount;

Description

FreedCount is the total number of elements actually freed in the list.

See also

TPooledMemManager.Count | Number of items in the list
TPooledMemManager.FreeCount | Number of free items in the list
TPooledMemManager.AllocatedCount | Total number of allocated items in the list


TPooledMemManager.FreeFirstItem

Declaration

Source position: pooledmm.pp line 54

protected procedure TPooledMemManager.FreeFirstItem; virtual;


TPooledMemManager.MaximumFreeCountRatio

Maximum ratio of free items over total items

Declaration

Source position: pooledmm.pp line 57

public property TPooledMemManager.MaximumFreeCountRatio: Integer
  read FMaxFreeRatio
  write SetMaxFreeRatio;

Description

MaximumFreeCountRatio is the maximum ratio (divided by 8) of free elements over the total amount of elements: When disposing an item in the list, if the number of free items is higher than this ratio, the item is freed.

The default value is 8.

See also

TPooledMemManager.MinimumFreeCount

Minimum count of free items in the list


TPooledMemManager.MinimumFreeCount

Minimum count of free items in the list

Declaration

Source position: pooledmm.pp line 56

public property TPooledMemManager.MinimumFreeCount: Integer
  read FMinFree
  write SetMinFree;

Description

MinimumFreeCount is the minimum number of free items in the linked list. When disposing an item in the list, the number of items is checked, and only if the required number of free items is present, the item is actually freed.

The default value is 100000

See also

TPooledMemManager.MaximumFreeCountRatio

Maximum ratio of free items over total items


TPooledMemManager.NewItem

Declaration

Source position: pooledmm.pp line 53

protected function TPooledMemManager.NewItem: PPooledMemManagerItem;


TPooledMemManagerItem

Item used in a linked list

Declaration

Source position: pooledmm.pp line 34

type TPooledMemManagerItem = record

  Next: PPooledMemManagerItem;

Pointer to the next memory block

end;

Description

TPooledMemManagerItem is used internally by the TPooledMemManager class to maintain the free list block. It simply points to the next free block.

See also

PPooledMemManagerItem | Pointer to TPooledMemManagerItem
TPooledMemManager | Pooled memory manager


EProcess

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs in a TProcess routine.

Declaration

Source position: process.pp line 138

type EProcess = class(Exception) end;

Inheritance

EProcess

Exception raised when an error occurs in a TProcess routine.
|

Exception
|

TObject

See also

TProcess

Class to start and control other processes.


EProcess
Exception
 | HelpContext
 | Message


EProcess
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EProcess

Exception


TProcess

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class to start and control other processes.

Declaration

Source position: process.pp line 44

type TProcess = class(TComponent)
protected
FRunning: Boolean;
FExitCode: Cardinal;
FInputStream: TOutputPipeStream;
FOutputStream: TInputPipeStream;
FStderrStream: TInputPipeStream;
procedure CloseProcessHandles; virtual;
procedure CreateStreams(); virtual;
procedure FreeStream();
public
constructor Create(); override; | Create a new instance of the TProcess class.
destructor Destroy; override; | Destroy this instance of TProcess
procedure Execute; virtual; | Execute the program with the given options
procedure CloseInput; virtual; | Close the input stream of the process
procedure CloseOutput; virtual; | Close the output stream of the process
procedure CloseStderr; virtual; | Close the error stream of the process
function Resume; virtual; | Resume execution of a suspended process
function Suspend; virtual; | Suspend a running process
function Terminate(); virtual; | Terminate a running process
function WaitOnExit; | Wait for the program to stop executing.
property WindowRect: Trect; [rw] | Positions for the main program window.
property Handle: THandle; [r] | Handle of the process
property ProcessHandle: THandle; [r] | Alias for Handle
property ThreadHandle: THandle; [r] | Main process thread handle
property ProcessID: Integer; [r] | ID of the process.
property ThreadID: Integer; [r] | ID of the main process thread
property Input: TOutputPipeStream; [r] | Stream connected to standard input of the process.
property Output: TInputPipeStream; [r] | Stream connected to standard output of the process.
property Stderr: TInputPipeStream; [r] | Stream connected to standard diagnostic output of the process.
property ExitStatus: Integer; [r] | Exit status of the process.
property InheritHandles: Boolean; [rw] | Should the created process inherit the open handles of the current process.
published
property Active: Boolean; [rw] | Start or stop the process.
property ApplicationName: String; [rw] | Name of the application to start
property CommandLine: String; [rw] | Command-line to execute
property ConsoleTitle: String; [rw] | Title of the console window
property CurrentDirectory: String; [rw] | Working directory of the process.
property Desktop: String; [rw] | Desktop on which to start the process.
property Environment: TStrings; [rw] | Environment variables for the new process
property Options: TProcessOptions; [rw] | Options to be used when starting the process.
property Priority: TProcessPriority; [rw] | Priority at which the process is running.
property StartupOptions: TStartupOptions; [rw] | Additional (Windows) startup options
property Running: Boolean; [r] | Determines wheter the process is still running.
property ShowWindow: TShowWindowOptions; [rw] | Determines how the process main window is shown (Windows only)
property WindowColumns: Cardinal; [rw] | Number of columns in console window (windows only)
property WindowHeight: Cardinal; [rw] | Height of the process main window
property WindowLeft: Cardinal; [rw] | X-coordinate of the initial window (Windows only)
property WindowRows: Cardinal; [rw] | Number of rows in console window (Windows only)
property WindowTop: Cardinal; [rw] | Y-coordinate of the initial window (Windows only)
property WindowWidth: Cardinal; [rw] | Height of the process main window (Windows only)
property FillAttribute: Cardinal; [rw] | Color attributes of the characters in the console window (Windows only)
end;

Inheritance

TProcess

Class to start and control other processes.
|

TComponent
|

TObject

Description

TProcess is a component that can be used to start and control other processes (programs/binaries). It contains a lot of options that control how the process is started. Many of these are Win32 specific, and have no effect on other platforms, so they should be used with care.

The simplest way to use this component is to create an instance, set the CommandLine property to the full pathname of the program that should be executed, and call Execute. To determine whether the process is still running (i.e. has not stopped executing), the Running property can be checked.

More advanced techniques can be used with the Options settings.

See also

Create | Create a new instance of the TProcess class.
Execute | Execute the program with the given options
Running | Determines wheter the process is still running.
CommandLin | Command-line to execute
Options | Options to be used when starting the process.


TProcess
 |  | WindowRect
 | ro | Handle
 | ro | ProcessHandle
 | ro | ThreadHandle
 | ro | ProcessID
 | ro | ThreadID
 | ro | Input
 | ro | Output
 | ro | Stderr
 | ro | ExitStatus
 |  | InheritHandles
pl |  | Active
pl |  | ApplicationName
pl |  | CommandLine
pl |  | ConsoleTitle
pl |  | CurrentDirectory
pl |  | Desktop
pl |  | Environment
pl |  | Options
pl |  | Priority
pl |  | StartupOptions
pl | ro | Running
pl |  | ShowWindow
pl |  | WindowColumns
pl |  | WindowHeight
pl |  | WindowLeft
pl |  | WindowRows
pl |  | WindowTop
pl |  | WindowWidth
pl |  | FillAttribute
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


pl |  | Active (TProcess)
pl |  | ApplicationName (TProcess)
pl |  | CommandLine (TProcess)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
pl |  | ConsoleTitle (TProcess)
pl |  | CurrentDirectory (TProcess)
 |  | DesignInfo (TComponent)
pl |  | Desktop (TProcess)
pl |  | Environment (TProcess)
 | ro | ExitStatus (TProcess)
pl |  | FillAttribute (TProcess)
 | ro | Handle (TProcess)
 |  | InheritHandles (TProcess)
 | ro | Input (TProcess)
 |  | Name (TComponent)
pl |  | Options (TProcess)
 | ro | Output (TProcess)
 | ro | Owner (TComponent)
pl |  | Priority (TProcess)
 | ro | ProcessHandle (TProcess)
 | ro | ProcessID (TProcess)
pl | ro | Running (TProcess)
pl |  | ShowWindow (TProcess)
pl |  | StartupOptions (TProcess)
 | ro | Stderr (TProcess)
 |  | Tag (TComponent)
 | ro | ThreadHandle (TProcess)
 | ro | ThreadID (TProcess)
 |  | VCLComObject (TComponent)
pl |  | WindowColumns (TProcess)
pl |  | WindowHeight (TProcess)
pl |  | WindowLeft (TProcess)
 |  | WindowRect (TProcess)
pl |  | WindowRows (TProcess)
pl |  | WindowTop (TProcess)
pl |  | WindowWidth (TProcess)


TProcess
pt | CloseProcessHandles
pt | CreateStreams
pt | FreeStream
 | Create
 | Destroy
 | Execute
 | CloseInput
 | CloseOutput
 | CloseStderr
 | Resume
 | Suspend
 | Terminate
 | WaitOnExit
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
 | CloseInput (TProcess)
 | CloseOutput (TProcess)
pt | CloseProcessHandles (TProcess)
 | CloseStderr (TProcess)
 | Create (TComponent)
 | Create (TProcess)
pt | CreateStreams (TProcess)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TProcess)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | Execute (TProcess)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
pt | FreeStream (TProcess)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | Resume (TProcess)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | Suspend (TProcess)
 | Terminate (TProcess)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WaitOnExit (TProcess)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TProcess

TComponent


TProcess.Active

Start or stop the process.

Declaration

Source position: process.pp line 117

published property TProcess.Active: Boolean
  read GetRunning
  write SetActive;

Description

Active starts the process if it is set to True, or terminates the process if set to False. It's mostly intended for use in an IDE.

See also

TProcess.Execute | Execute the program with the given options
TProcess.Terminate | Terminate a running process


TProcess.ApplicationName

Name of the application to start

Declaration

Source position: process.pp line 118

published property TProcess.ApplicationName: String
  read FApplicationName
  write SetApplicationName;

Description

ApplicationName is an alias for TProcess.CommandLine. It's mostly foruse in the Windows CreateProcess call. If CommandLine is not set, then ApplicationName will be used instead.

Note that either CommandLine or ApplicationName must be set prior to calling Execute.

See also

TProcess.CommandLine

Command-line to execute


TProcess.CloseInput

Close the input stream of the process

Declaration

Source position: process.pp line 98

public procedure TProcess.CloseInput; virtual;

Description

CloseInput closes the input file descriptor of the process, that is, it closes the handle of the pipe to standard input of the process.

See also

Input | Stream connected to standard input of the process.
StdErr | Stream connected to standard diagnostic output of the process.
Output | Stream connected to standard output of the process.
CloseOutput | Close the output stream of the process
CloseStdErr | Close the error stream of the process


TProcess.CloseOutput

Close the output stream of the process

Declaration

Source position: process.pp line 99

public procedure TProcess.CloseOutput; virtual;

Description

CloseOutput closes the output file descriptor of the process, that is, it closes the handle of the pipe to standard output of the process.

See also

Output | Stream connected to standard output of the process.
Input | Stream connected to standard input of the process.
StdErr | Stream connected to standard diagnostic output of the process.
CloseInput | Close the input stream of the process
CloseStdErr | Close the error stream of the process


TProcess.CloseProcessHandles

Declaration

Source position: process.pp line 91

protected procedure TProcess.CloseProcessHandles; virtual;


TProcess.CloseStderr

Close the error stream of the process

Declaration

Source position: process.pp line 100

public procedure TProcess.CloseStderr; virtual;

Description

CloseStdErr closes the standard error file descriptor of the process, that is, it closes the handle of the pipe to standard error output of the process.

See also

Output | Stream connected to standard output of the process.
Input | Stream connected to standard input of the process.
StdErr | Stream connected to standard diagnostic output of the process.
CloseInput | Close the input stream of the process
CloseStdErr | Close the error stream of the process


TProcess.CommandLine

Command-line to execute

Declaration

Source position: process.pp line 119

published property TProcess.CommandLine: String
  read FCommandLine
  write FCommandLine;

Description

CommandLine is the command-line to be executed: this is the name of the program to be executed, followed by any options it should be passed.

If the command to be executed or any of the arguments contains whitespace (space, tab character, linefeed character) it should be enclosed in single or double quotes.

If no absolute pathname is given for the command to be executed, it is searched for in the PATH environment variable. On Windows, the current directory always will be searched first. On other platforms, this is not so.

Note that either CommandLine or ApplicationName must be set prior to calling Execute.

See also

TProcess.ApplicationName

Name of the application to start


TProcess.ConsoleTitle

Title of the console window

Declaration

Source position: process.pp line 120

published property TProcess.ConsoleTitle: String
  read FConsoleTitle
  write FConsoleTitle;

Description

ConsoleTitle is used on Windows when executing a console application: it specifies the title caption of the console window. On other platforms, this property is currently ignored.

Changing this property after the process was started has no effect.

See also

TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)


TProcess.Create

Create a new instance of the TProcess class.

Declaration

Source position: process.pp line 95

public constructor TProcess.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner of the instance.

Description

Create creates a new instance of the TProcess class. After calling the inherited constructor, it simply sets some default values.


TProcess.CreateStreams

Declaration

Source position: process.pp line 92

protected procedure TProcess.CreateStreams(

  InHandle: LongInt;

  OutHandle: LongInt;

  ErrHandle: LongInt

); virtual;


TProcess.CurrentDirectory

Working directory of the process.

Declaration

Source position: process.pp line 121

published property TProcess.CurrentDirectory: String
  read FCurrentDirectory
  write FCurrentDirectory;

Description

CurrentDirectory specifies the working directory of the newly started process.

Changing this property after the process was started has no effect.

See also

TProcess.Environment

Environment variables for the new process


TProcess.Desktop

Desktop on which to start the process.

Declaration

Source position: process.pp line 122

published property TProcess.Desktop: String
  read FDesktop
  write FDesktop;

Description

DeskTop is used on Windows to determine on which desktop the process' main window should be shown. Leaving this empty means the process is started on the same desktop as the currently running process.

Changing this property after the process was started has no effect.

On unix, this parameter is ignored.

See also

TProcess.Input | Stream connected to standard input of the process.
TProcess.Output | Stream connected to standard output of the process.
TProcess.StdErr | Stream connected to standard diagnostic output of the process.


TProcess.Destroy

Destroy this instance of TProcess

Declaration

Source position: process.pp line 96

public destructor TProcess.Destroy; override;

Description

Destroy cleans up this instance of TProcess. Prior to calling the inherited destructor, it cleans up any streams that may have been created. If a process was started and is still executed, it is not stopped, but the standard input/output/stderr streams are no longer available, because they have been destroyed.

Errors

None.

See also

Create

Create a new instance of the TProcess class.


TProcess.Environment

Environment variables for the new process

Declaration

Source position: process.pp line 123

published property TProcess.Environment: TStrings
  read FEnvironment
  write SetEnvironment;

Description

Environment contains the environment for the new process; it's a list of Name=Value pairs, one per line.

If it is empty, the environment of the current process is passed on to the new process.

See also

TProcess.Options

Options to be used when starting the process.


TProcess.Execute

Execute the program with the given options

Declaration

Source position: process.pp line 97

public procedure TProcess.Execute; virtual;

Description

Execute actually executes the program as specified in CommandLine, applying as much as of the specified options as supported on the current platform.

If the poWaitOnExit option is specified in Options, then the call will only return when the program has finished executing (or if an error occured). If this option is not given, the call returns immediatly, but the WaitOnExit call can be used to wait for it to close, or the Running call can be used to check whether it is still running.

The TProcess.Terminate call can be used to terminate the program if it is still running, or the Suspend call can be used to temporarily stop the program's execution.

The ExitStatus function can be used to check the program's exit status, after it has stopped executing.

Errors

On error a EProcess exception is raised.

See also

TProcess.Running | Determines wheter the process is still running.
TProcess.WaitOnExit | Wait for the program to stop executing.
TProcess.Terminate | Terminate a running process
TProcess.Suspend | Suspend a running process
TProcess.Resume | Resume execution of a suspended process
TProcess.ExitStatus | Exit status of the process.


TProcess.ExitStatus

Exit status of the process.

Declaration

Source position: process.pp line 114

public property TProcess.ExitStatus: Integer
  read GetExitStatus;

Description

ExitStatus contains the exit status as reported by the process when it stopped executing. The value of this property is only meaningful when the process is no longer running. If it is not running then the value is zero.

See also

TProcess.Running | Determines wheter the process is still running.
TProcess.Terminate | Terminate a running process


TProcess.FExitCode

Declaration

Source position: process.pp line 87

protected TProcess.FExitCode: Cardinal;


TProcess.FillAttribute

Color attributes of the characters in the console window (Windows only)

Declaration

Source position: process.pp line 135

published property TProcess.FillAttribute: Cardinal
  read FFillAttribute
  write FFillAttribute;

Description

FillAttribute is a WORD value which specifies the background and foreground colors of the console window.

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.FInputStream

Declaration

Source position: process.pp line 88

protected TProcess.FInputStream: TOutputPipeStream;


TProcess.FOutputStream

Declaration

Source position: process.pp line 89

protected TProcess.FOutputStream: TInputPipeStream;


TProcess.FreeStream

Declaration

Source position: process.pp line 93

protected procedure TProcess.FreeStream(

  var AStream: THandleStream

);


TProcess.FRunning

Declaration

Source position: process.pp line 86

protected TProcess.FRunning: Boolean;


TProcess.FStderrStream

Declaration

Source position: process.pp line 90

protected TProcess.FStderrStream: TInputPipeStream;


TProcess.Handle

Handle of the process

Declaration

Source position: process.pp line 106

public property TProcess.Handle: THandle
  read FProcessHandle;

Description

Handle identifies the process. In Unix systems, this is the process ID. On windows, this is the process handle. It can be used to signal the process.

The handle is only valid after TProcess.Execute has been called. It is not reset after the process stopped.

See also

TProcess.ThreadHandle | Main process thread handle
TProcess.ProcessID | ID of the process.
TProcess.ThreadID | ID of the main process thread


TProcess.InheritHandles

Should the created process inherit the open handles of the current process.

Declaration

Source position: process.pp line 115

public property TProcess.InheritHandles: Boolean
  read FInheritHandles
  write FInheritHandles;

Description

InheritHandles determines whether the created process inherits the open handles of the current process (value True) or not (False).

On Unix, setting this variable has no effect.

See also

TProcess.InPut | Stream connected to standard input of the process.
TProcess.Output | Stream connected to standard output of the process.
TProcess.StdErr | Stream connected to standard diagnostic output of the process.


TProcess.Input

Stream connected to standard input of the process.

Declaration

Source position: process.pp line 111

public property TProcess.Input: TOutputPipeStream
  read FInputStream;

Description

Input is a stream which is connected to the process' standard input file handle. Anything written to this stream can be read by the process.

The Input stream is only instantiated when the poUsePipes flag is used in Options.

Note that writing to the stream may cause the calling process to be suspended when the created process is not reading from it's input, or to cause errors when the process has terminated.

See also

TProcess.OutPut | Stream connected to standard output of the process.
TProcess.StdErr | Stream connected to standard diagnostic output of the process.
TProcess.Options | Options to be used when starting the process.
TProcessOption | Options to be used when a process is started.


TProcess.Options

Options to be used when starting the process.

Declaration

Source position: process.pp line 124

published property TProcess.Options: TProcessOptions
  read FProcessOptions
  write SetProcessOptions;

Description

Options determine how the process is started. They should be set before the Execute call is made.

option | Meaning
poRunSuspended | Start the process in suspended state.
poWaitOnExit | Wait for the process to terminate before returning.
poUsePipes | Use pipes to redirect standard input and output.
poStderrToOutPut | Redirect standard error to the standard output stream.
poNoConsole | Do not allow access to the console window for the process (Win32 only)
poNewConsole | Start a new console window for the process (Win32 only)
poDefaultErrorMode | Use default error handling.
poNewProcessGroup | Start the process in a new process group (Win32 only)
poDebugProcess | Allow debugging of the process (Win32 only)
poDebugOnlyThisProcess | Do not follow processes started by this process (Win32 only)

See also

TProcessOption | Options to be used when a process is started.
TProcessOptions | Set of TProcessOption.
TProcess.Priority | Priority at which the process is running.
TProcess.StartUpOptions | Additional (Windows) startup options


TProcess.Output

Stream connected to standard output of the process.

Declaration

Source position: process.pp line 112

public property TProcess.Output: TInputPipeStream
  read FOutputStream;

Description

Output is a stream which is connected to the process' standard output file handle. Anything written to standard output by the created process can be read from this stream.

The Output stream is only instantiated when the poUsePipes flag is used in Options.

The Output stream also contains any data written to standard diagnostic output (stderr) when the poStdErrToOutPut flag is used in Options.

Note that reading from the stream may cause the calling process to be suspended when the created process is not writing anything to standard output, or to cause errors when the process has terminated.

See also

TProcess.InPut | Stream connected to standard input of the process.
TProcess.StdErr | Stream connected to standard diagnostic output of the process.
TProcess.Options | Options to be used when starting the process.
TProcessOption | Options to be used when a process is started.


TProcess.Priority

Priority at which the process is running.

Declaration

Source position: process.pp line 125

published property TProcess.Priority: TProcessPriority
  read FProcessPriority
  write FProcessPriority;

Description

Priority determines the priority at which the process is running.

Priority | Meaning
ppHigh | The process runs at higher than normal priority.
ppIdle | The process only runs when the system is idle (i.e. has nothing else to do)
ppNormal | The process runs at normal priority.
ppRealTime | The process runs at real-time priority.

Note that not all priorities can be set by any user. Usually, only users witha dministrative rights (the root user on Unix) can set a higher process priority.

On unix, the process priority is mapped on Nice values as follows:

Priority | Nice value
ppHigh | 20
ppIdle | 20
ppNormal | 0
ppRealTime | -20

See also

TProcessPriority

type determining the priority of the newly started process.


TProcess.ProcessHandle

Alias for Handle

Declaration

Source position: process.pp line 107

public property TProcess.ProcessHandle: THandle
  read FProcessHandle;

Description

ProcessHandle equals Handle and is provided for completeness only.

See also

TProcess.Handle | Handle of the process
TProcess.ThreadHandle | Main process thread handle
TProcess.ProcessID | ID of the process.
TProcess.ThreadID | ID of the main process thread


TProcess.ProcessID

ID of the process.

Declaration

Source position: process.pp line 109

public property TProcess.ProcessID: Integer
  read FProcessID;

Description

ProcessID is the ID of the process. It is the same as the handle of the process on Unix systems, but on Windows it is different from the process Handle.

The ID is only valid after TProcess.Execute has been called. It is not reset after the process stopped.

See also

TProcess.Handle | Handle of the process
TProcess.ThreadHandle | Main process thread handle
TProcess.ThreadID | ID of the main process thread


TProcess.Resume

Resume execution of a suspended process

Declaration

Source position: process.pp line 101

public function TProcess.Resume: Integer; virtual;

Function result

0 on success, nonzero otherwise.

Description

Resume should be used to let a suspended process resume it's execution. It should be called in particular when the poRunSuspended flag is set in Options.

Errors

None.

See also

TProcess.Suspend | Suspend a running process
TProcess.Options | Options to be used when starting the process.
TProcess.Execute | Execute the program with the given options
TProcess.Terminate | Terminate a running process


TProcess.Running

Determines wheter the process is still running.

Declaration

Source position: process.pp line 127

published property TProcess.Running: Boolean
  read GetRunning;

Description

Running can be read to determine whether the process is still running.

See also

TProcess.Terminate | Terminate a running process
TProcess.Active | Start or stop the process.
TProcess.ExitStatus | Exit status of the process.


TProcess.ShowWindow

Determines how the process main window is shown (Windows only)

Declaration

Source position: process.pp line 128

published property TProcess.ShowWindow: TShowWindowOptions
  read FShowWindow
  write SetShowWindow;

Description

ShowWindow determines how the process' main window is shown. It is useful only on Windows.

Option | Meaning
swoNone | Allow system to position the window.
swoHIDE | The main window is hidden.
swoMaximize | The main window is maximized.
swoMinimize | The main window is minimized.
swoRestore | Restore the previous position.
swoShow | Show the main window.
swoShowDefault | When showing Show the main window on a default position
swoShowMaximized | The main window is shown maximized
swoShowMinimized | The main window is shown minimized
swoshowMinNOActive | The main window is shown minimized but not activated
swoShowNA | The main window is shown but not activated
swoShowNoActivate | The main window is shown but not activated
swoShowNormal | The main window is shown normally


TProcess.StartupOptions

Additional (Windows) startup options

Declaration

Source position: process.pp line 126

published property TProcess.StartupOptions: TStartupOptions
  read FStartupOptions
  write FStartupOptions;

Description

StartUpOptions contains additional startup options, used mostly on Windows system. They determine which other window layout properties are taken into account when starting the new process.

Priority | Meaning
suoUseShowWindow | Use the Show Window options specified in ShowWindow
suoUseSize | Use the specified window sizes
suoUsePosition | Use the specified window sizes.
suoUseCountChars | Use the specified console character width.
suoUseFillAttribute | Use the console fill attribute specified in FillAttribute.

See also

TProcess.ShowWindow | Determines how the process main window is shown (Windows only)
TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)


TProcess.Stderr

Stream connected to standard diagnostic output of the process.

Declaration

Source position: process.pp line 113

public property TProcess.Stderr: TInputPipeStream
  read FStderrStream;

Description

StdErr is a stream which is connected to the process' standard diagnostic output file handle (StdErr). Anything written to standard diagnostic output by the created process can be read from this stream.

The StdErr stream is only instantiated when the poUsePipes flag is used in Options.

The Output stream equals the Output when the poStdErrToOutPut flag is used in Options.

Note that reading from the stream may cause the calling process to be suspended when the created process is not writing anything to standard output, or to cause errors when the process has terminated.

See also

TProcess.InPut | Stream connected to standard input of the process.
TProcess.Output | Stream connected to standard output of the process.
TProcess.Options | Options to be used when starting the process.
TProcessOption | Options to be used when a process is started.


TProcess.Suspend

Suspend a running process

Declaration

Source position: process.pp line 102

public function TProcess.Suspend: Integer; virtual;

Function result

0 on success, nonzero otherwise.

Description

Suspend suspends a running process. If the call is successful, the process is suspended: it stops running, but can be made to execute again using the Resume call.

Suspend is fundamentally different from TProcess.Terminate which actually stops the process.

Errors

On error, a nonzero result is returned.

See also

TProcess.Options | Options to be used when starting the process.
TProcess.Resume | Resume execution of a suspended process
TProcess.Terminate | Terminate a running process
TProcess.Execute | Execute the program with the given options


TProcess.Terminate

Terminate a running process

Declaration

Source position: process.pp line 103

public function TProcess.Terminate(

  AExitCode: Integer

):Boolean; virtual;

Arguments

AExitCode

Exit status to report (Windows only)

Function result

0 on succes, nonzero for failure.

Description

Terminate stops the execution of the running program. It effectively stops the program.

On Windows, the program will report an exit code of AExitCode, on other systems, this value is ignored.

Errors

On error, a nonzero value is returned.

See also

TProcess.ExitStatus | Exit status of the process.
TProcess.Suspend | Suspend a running process
TProcess.Execute | Execute the program with the given options
TProcess.WaitOnExit | Wait for the program to stop executing.


TProcess.ThreadHandle

Main process thread handle

Declaration

Source position: process.pp line 108

public property TProcess.ThreadHandle: THandle
  read FThreadHandle;

Description

ThreadHandle is the main process thread handle. On Unix, this is the same as the process ID, on Windows, this may be a different handle than the process handle.

The handle is only valid after TProcess.Execute has been called. It is not reset after the process stopped.

See also

TProcess.Handle | Handle of the process
TProcess.ProcessID | ID of the process.
TProcess.ThreadID | ID of the main process thread


TProcess.ThreadID

ID of the main process thread

Declaration

Source position: process.pp line 110

public property TProcess.ThreadID: Integer
  read FThreadID;

Description

ProcessID is the ID of the main process thread. It is the same as the handle of the main proces thread (or the process itself) on Unix systems, but on Windows it is different from the thread Handle.

The ID is only valid after TProcess.Execute has been called. It is not reset after the process stopped.

See also

TProcess.ProcessID | ID of the process.
TProcess.Handle | Handle of the process
TProcess.ThreadHandle | Main process thread handle


TProcess.WaitOnExit

Wait for the program to stop executing.

Declaration

Source position: process.pp line 104

public function TProcess.WaitOnExit: Boolean;

Function result

True means the process was successfully waited on, False indicates some error occurred.

Description

WaitOnExit waits for the running program to exit. It returns True if the wait was succesful, or False if there was some error waiting for the program to exit.

Note that the return value of this function has changed. The old return value was a DWord with a platform dependent error code. To make things consistent and cross-platform, a boolean return type was used.

Errors

On error, False is returned. No extended error information is available, as it is highly system dependent.

See also

TProcess.ExitStatus | Exit status of the process.
TProcess.Terminate | Terminate a running process
TProcess.Running | Determines wheter the process is still running.


TProcess.WindowColumns

Number of columns in console window (windows only)

Declaration

Source position: process.pp line 129

published property TProcess.WindowColumns: Cardinal
  read dwXCountChars
  write SetWindowColumns;

Description

WindowColumns is the number of columns in the console window, used to run the command in. This property is only effective if suoUseCountChars is specified in StartupOptions

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.WindowHeight

Height of the process main window

Declaration

Source position: process.pp line 130

published property TProcess.WindowHeight: Cardinal
  read dwYSize
  write SetWindowHeight;

Description

WindowHeight is the initial height (in pixels) of the process' main window. This property is only effective if suoUseSize is specified in StartupOptions

See also

TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.WindowLeft

X-coordinate of the initial window (Windows only)

Declaration

Source position: process.pp line 131

published property TProcess.WindowLeft: Cardinal
  read dwX
  write SetWindowLeft;

Description

WindowLeft is the initial X coordinate (in pixels) of the process' main window, relative to the left border of the desktop. This property is only effective if suoUsePosition is specified in StartupOptions

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.WindowRect

Positions for the main program window.

Declaration

Source position: process.pp line 105

public property TProcess.WindowRect: Trect
  read GetWindowRect
  write SetWindowRect;

Description

WindowRect can be used to specify the position of


TProcess.WindowRows

Number of rows in console window (Windows only)

Declaration

Source position: process.pp line 132

published property TProcess.WindowRows: Cardinal
  read dwYCountChars
  write SetWindowRows;

Description

WindowRows is the number of rows in the console window, used to run the command in. This property is only effective if suoUseCountChars is specified in StartupOptions

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.WindowTop

Y-coordinate of the initial window (Windows only)

Declaration

Source position: process.pp line 133

published property TProcess.WindowTop: Cardinal
  read dwY
  write SetWindowTop;

Description

WindowTop is the initial Y coordinate (in pixels) of the process' main window, relative to the top border of the desktop. This property is only effective if suoUsePosition is specified in StartupOptions

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowWidth | Height of the process main window (Windows only)
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcess.WindowWidth

Height of the process main window (Windows only)

Declaration

Source position: process.pp line 134

published property TProcess.WindowWidth: Cardinal
  read dwXSize
  write SetWindowWidth;

Description

WindowWidth is the initial width (in pixels) of the process' main window. This property is only effective if suoUseSize is specified in StartupOptions

See also

TProcess.WindowHeight | Height of the process main window
TProcess.WindowLeft | X-coordinate of the initial window (Windows only)
TProcess.WindowTop | Y-coordinate of the initial window (Windows only)
TProcess.WindowColumns | Number of columns in console window (windows only)
TProcess.WindowRows | Number of rows in console window (Windows only)
TProcess.FillAttribute | Color attributes of the characters in the console window (Windows only)
TProcess.StartupOptions | Additional (Windows) startup options


TProcessOption

Options to be used when a process is started.

Declaration

Source position: process.pp line 24

type TProcessOption = (
poRunSuspended, | Start the process in suspended state.
poWaitOnExit, | Wait for the process to terminate before returning.
poUsePipes, | Use pipes to redirect standard input and output.
poStderrToOutPut, | Redirect standard error to the standard output stream.
poNoConsole, | Do not allow access to the console window for the process (Win32 only)
poNewConsole, | Start a new console window for the process (Win32 only)
poDefaultErrorMode, | Use default error handling.
poNewProcessGroup, | Start the process in a new process group (Win32 only)
poDebugProcess, | Allow debugging of the process (Win32 only)
poDebugOnlyThisProcess | Do not follow processes started by this process (Win32 only)
);

Description

When a new process is started using TProcess.Execute, these options control the way the process is started. Note that not all options are supported on all platforms.

See also

TProcessOptions | Set of TProcessOption.
TShowWindowOptions | Description of the main window of the new process.


TProcessOptions

Set of TProcessOption.

Declaration

Source position: process.pp line 39

type TProcessOptions = set of (
poRunSuspended, | Start the process in suspended state.
poWaitOnExit, | Wait for the process to terminate before returning.
poUsePipes, | Use pipes to redirect standard input and output.
poStderrToOutPut, | Redirect standard error to the standard output stream.
poNoConsole, | Do not allow access to the console window for the process (Win32 only)
poNewConsole, | Start a new console window for the process (Win32 only)
poDefaultErrorMode, | Use default error handling.
poNewProcessGroup, | Start the process in a new process group (Win32 only)
poDebugProcess, | Allow debugging of the process (Win32 only)
poDebugOnlyThisProcess | Do not follow processes started by this process (Win32 only)
);


TProcessPriority

type determining the priority of the newly started process.

Declaration

Source position: process.pp line 37

type TProcessPriority = (
ppHigh, | The process runs at higher than normal priority.
ppIdle, | The process only runs when the system is idle (i.e. has nothing else to do)
ppNormal, | The process runs at normal priority.
ppRealTime | The process runs at real-time priority.
);

Description

This enumerated type determines the priority of the newly started process. It translates to default platform specific constants. If finer control is needed, then platform-dependent mechanism need to be used to set the priority.


TPropInfoList

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class for keeping property information

Declaration

Source position: rttiutils.pp line 43

type TPropInfoList = class(TObject)
public
constructor Create(); | Create a new instance of TPropInfoList
destructor Destroy; override; | Remove the TPropInfoList instance from memory
function Contains(); | Check whether a certain property is included
function Find(); | Retrieve property information based on name
procedure Delete(); | Delete property information from the list
procedure Intersect(); | Intersect 2 property lists
property Count: Integer; [r] | Number of items in the list
property Items: PPropInfo; default; [r] | Indexed access to the property type pointers
end;

Inheritance

TPropInfoList

Class for keeping property information
|

TObject

Description

TPropInfoList is a class which can be used to maintain a list with information about published properties of a class (or an instance). It is used internally by TPropsStorage

See also

TPropsStorage

Property storage mechanism


TPropInfoList
 | ro | Count
 | ro | Items


ro | Count (TPropInfoList)
ro | Items (TPropInfoList)


TPropInfoList
 | Create
 | Destroy
 | Contains
 | Find
 | Delete
 | Intersect


Contains (TPropInfoList)

Create (TPropInfoList)

Delete (TPropInfoList)

Destroy (TPropInfoList)

Find (TPropInfoList)

Intersect (TPropInfoList)


TPropInfoList


TPropInfoList.Contains

Check whether a certain property is included

Declaration

Source position: rttiutils.pp line 52

public function TPropInfoList.Contains(

  P: PPropInfo

):Boolean;

Arguments

P

Property info to check for

Function result

True if P is in the list of properties

Description

Contains checks whether P is included in the list of properties, and returns True if it does. If P cannot be found, False is returned.

See also

Find | Retrieve property information based on name
Intersect | Intersect 2 property lists


TPropInfoList.Count

Number of items in the list

Declaration

Source position: rttiutils.pp line 56

public property TPropInfoList.Count: Integer
  read FCount;

Description

Count is the number of property type pointers in the list.

See also

Items

Indexed access to the property type pointers


TPropInfoList.Create

Create a new instance of TPropInfoList

Declaration

Source position: rttiutils.pp line 50

public constructor TPropInfoList.Create(

  AObject: TObject;

  Filter: TTypeKinds

);

Arguments

AObject | Object whose properties should be listed
Filter | Filter on the kind of properties to retrieve

Description

Create allocates and initializes a new instance of TPropInfoList on the heap. It retrieves a list of published properties from AObject: if Filter is empty, then all properties are retrieved. If it is not empty, then only properties of the kind specified in the set are retrieved. Instance should not be Nil

See also

Destroy

Remove the TPropInfoList instance from memory


TPropInfoList.Delete

Delete property information from the list

Declaration

Source position: rttiutils.pp line 54

public procedure TPropInfoList.Delete(

  Index: Integer

);

Arguments

Index

Index of item to delete.

Description

Delete deletes the property information at position Index from the list. It's mainly of use in the Intersect call.

Errors

No checking on the validity of Index is performed.

See also

Intersect

Intersect 2 property lists


TPropInfoList.Destroy

Remove the TPropInfoList instance from memory

Declaration

Source position: rttiutils.pp line 51

public destructor TPropInfoList.Destroy; override;

Description

Destroy cleans up the internal structures maintained by TPropInfoList and then calls the inherited Destroy.

See also

Create

Create a new instance of TPropInfoList


TPropInfoList.Find

Retrieve property information based on name

Declaration

Source position: rttiutils.pp line 53

public function TPropInfoList.Find(

  const AName: String

):PPropInfo;

Arguments

AName

Name of property

Function result

Pointer to property type information for AName, or Nil

Description

Find returns a pointer to the type information of the property AName. If no such information is available, the function returns Nil. The search is performed case insensitive.

See also

Intersect | Intersect 2 property lists
Contains | Check whether a certain property is included


TPropInfoList.Intersect

Intersect 2 property lists

Declaration

Source position: rttiutils.pp line 55

public procedure TPropInfoList.Intersect(

  List: TPropInfoList

);

Arguments

List

List to intersect with

Description

Intersect reduces the list of properties to the ones also contained in List, i.e. all properties which are not also present in List are removed.

See also

Delete | Delete property information from the list
Contains | Check whether a certain property is included


TPropInfoList.Items

Indexed access to the property type pointers

Declaration

Source position: rttiutils.pp line 57

public property TPropInfoList.Items: PPropInfo
  read Get;
  default;

Description

Items provides access to the property type pointers stored in the list. Index runs from 0 to Count-1.

See also

Count

Number of items in the list


TPropsStorage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Property storage mechanism

Declaration

Source position: rttiutils.pp line 66

type TPropsStorage = class(TObject)
protected
function ReadString(); virtual;
procedure WriteString(); virtual;
procedure EraseSection(); virtual;
function GetItemName(); virtual;
function CreateStorage; virtual;
public
procedure StoreAnyProperty(); | Store a property value
procedure LoadAnyProperty(); | Load a property value
procedure StoreProperties(); | Store a list of properties
procedure LoadProperties(); | Load a list of properties
procedure LoadObjectsProps(); | Load a list of component properties
procedure StoreObjectsProps(); | Store a list of component properties
property AObject: TObject; [rw] | Object to load or store properties from
property Prefix: String; [rw] | Prefix to use in storage
property Section: String; [rw] | Section name for storage
property OnReadString: TReadStrEvent; [rw] | Read a string value from storage
property OnWriteString: TWriteStrEvent; [rw] | Write a string value to storage
property OnEraseSection: TEraseSectEvent; [rw] | Erase a section in storage
end;

Inheritance

TPropsStorage

Property storage mechanism
|

TObject

Description

TPropsStorage provides a mechanism to store properties from any class which has published properties (usually a TPersistent descendent) in a storage mechanism.

TPropsStorage does not handle the storage by itself, instead, the storage is handled through a series of callbacks to read and/or write strings. Conversion of property types to string is handled by TPropsStorage itself: all that needs to be done is set the 3 handlers. The storage mechanism is assumed to have the structure of an .ini file : sections with key/value pairs. The three callbacks should take this into account, but they do not need to create an actual .ini file.

See also

TPropInfoList

Class for keeping property information


TPropsStorage
 | AObject
 | Prefix
 | Section


TPropsStorage
pt | ReadString
pt | WriteString
pt | EraseSection
pt | GetItemName
pt | CreateStorage
 | StoreAnyProperty
 | LoadAnyProperty
 | StoreProperties
 | LoadProperties
 | LoadObjectsProps
 | StoreObjectsProps


pt | CreateStorage (TPropsStorage)
pt | EraseSection (TPropsStorage)
pt | GetItemName (TPropsStorage)
 | LoadAnyProperty (TPropsStorage)
 | LoadObjectsProps (TPropsStorage)
 | LoadProperties (TPropsStorage)
pt | ReadString (TPropsStorage)
 | StoreAnyProperty (TPropsStorage)
 | StoreObjectsProps (TPropsStorage)
 | StoreProperties (TPropsStorage)
pt | WriteString (TPropsStorage)


TPropsStorage
 | OnReadString
 | OnWriteString
 | OnEraseSection


TPropsStorage.AObject

Object to load or store properties from

Declaration

Source position: rttiutils.pp line 116

public property TPropsStorage.AObject: TObject
  read FObject
  write FObject;

Description

AObject is the object instance whose properties will be loaded or stored with any of the methods in the TPropsStorage class. Note that a call to StoreObjectProps or LoadObjectProps will destroy any value that this property might have.

See also

LoadProperties | Load a list of properties
LoadAnyProperty | Load a property value
StoreProperties | Store a list of properties
StoreAnyProperty | Store a property value
StoreObjectProps | Store a list of component properties
LoadObjectProps | Load a list of component properties


TPropsStorage.CreateStorage

Declaration

Source position: rttiutils.pp line 108

protected function TPropsStorage.CreateStorage: TPropsStorage; virtual;


TPropsStorage.EraseSection

Declaration

Source position: rttiutils.pp line 106

protected procedure TPropsStorage.EraseSection(

  const ASection: String

); virtual;


TPropsStorage.GetItemName

Declaration

Source position: rttiutils.pp line 107

protected function TPropsStorage.GetItemName(

  const APropName: String

):String; virtual;


TPropsStorage.LoadAnyProperty

Load a property value

Declaration

Source position: rttiutils.pp line 111

public procedure TPropsStorage.LoadAnyProperty(

  PropInfo: PPropInfo

);

Arguments

PropInfo

Information about property to load

Description

LoadAnyProperty loads the property with information specified in PropInfo from the storage mechanism. The value is then applied to the object instance specified in the AObject property of TPropsStorage.

Errors

If the property pointer is invalid or AObject is invalid, an exception will be raised.

See also

AObject | Object to load or store properties from
StoreAnyProperty | Store a property value
LoadProperties | Load a list of properties
StoreProperties | Store a list of properties


TPropsStorage.LoadObjectsProps

Load a list of component properties

Declaration

Source position: rttiutils.pp line 114

public procedure TPropsStorage.LoadObjectsProps(

  AComponent: TComponent;

  StoredList: TStrings

);

Arguments

AComponent | Owner component of the components.
StoredList | List of components and their properties to load

Description

LoadObjectsProps loads a list of component properties, relative to AComponent: the names of the component properties to load are specified as follows:

ComponentName1.PropertyName
ComponentName2.Subcomponent1.PropertyName

The component instances will be located relative to AComponent, and must therefore be names of components owned by AComponent, followed by a valid property of these components. If the componentname is missing, the property name will be assumed to be a property of AComponent itself.

The Objects property of the stringlist should be filled with the instances of the components the property references refer to: they can be filled with the UpdateStoredList call.

For example, to load the checked state of a checkbox named 'CBCheckMe' and the caption of a button named 'BPressMe', both owned by a form, the following strings should be passed:

CBCheckMe.Checked
BPressMe.Caption

and the ACompontent should be the form component that owns the button and checkbox.

Note that this call removes the value of the AObject property.

Errors

If an invalid component is specified, an exception will be raised.

See also

UpdateStoredList | Update a stringlist with object references
StoreObjectsProps | Store a list of component properties
LoadProperties | Load a list of properties
LoadAnyProperty | Load a property value


TPropsStorage.LoadProperties

Load a list of properties

Declaration

Source position: rttiutils.pp line 113

public procedure TPropsStorage.LoadProperties(

  PropList: TStrings

);

Arguments

PropList

List with names of properties whose value should be loaded

Description

LoadProperties loads the values of all properties in PropList from the storage mechanism. The list should contain names of published properties of the AObject object.

Errors

If an invalid property name is specified, an exception will be raised.

See also

AObject | Object to load or store properties from
StoreAnyProperty | Store a property value
StoreProperties | Store a list of properties
LoadAnyProperty | Load a property value


TPropsStorage.OnEraseSection

Erase a section in storage

Declaration

Source position: rttiutils.pp line 121

public property TPropsStorage.OnEraseSection: TEraseSectEvent
  read FOnEraseSection
  write FOnEraseSection;

Description

OnEraseSection is the event handler called whenever TPropsStorage needs to clear a complete storage section. It should be set whenever stringlist properties need to be stored, or an exception will be raised.

See also

OnReadString | Read a string value from storage
OnWriteString | Write a string value to storage
TEraseSectEvent | Clear a storage section


TPropsStorage.OnReadString

Read a string value from storage

Declaration

Source position: rttiutils.pp line 119

public property TPropsStorage.OnReadString: TReadStrEvent
  read FOnReadString
  write FOnReadString;

Description

OnReadString is the event handler called whenever TPropsStorage needs to read a string from storage. It should be set whenever properties need to be loaded, or an exception will be raised.

See also

OnWriteString | Write a string value to storage
OnEraseSection | Erase a section in storage
TReadStrEvent | Callback to read strings from storage


TPropsStorage.OnWriteString

Write a string value to storage

Declaration

Source position: rttiutils.pp line 120

public property TPropsStorage.OnWriteString: TWriteStrEvent
  read FOnWriteString
  write FOnWriteString;

Description

OnWriteString is the event handler called whenever TPropsStorage needs to write a string to storage. It should be set whenever properties need to be stored, or an exception will be raised.

See also

OnReadString | Read a string value from storage
OnEraseSection | Erase a section in storage
TWriteStrEvent | Write a string to storage


TPropsStorage.Prefix

Prefix to use in storage

Declaration

Source position: rttiutils.pp line 117

public property TPropsStorage.Prefix: String
  read FPrefix
  write FPrefix;

Description

Prefix is prepended to all property names to form the key name when writing a property to storage, or when reading a value from storage. This is useful when storing properties of multiple forms in a single section.

See also

TPropsStorage.Section

Section name for storage


TPropsStorage.ReadString

Declaration

Source position: rttiutils.pp line 104

protected function TPropsStorage.ReadString(

  const ASection: String;

  const Item: String;

  const Default: String

):String; virtual;


TPropsStorage.Section

Section name for storage

Declaration

Source position: rttiutils.pp line 118

public property TPropsStorage.Section: String
  read FSection
  write FSection;

Description

Section is used as the section name when writing values to storage. Note that when writing properties of subcomponents, their names will be appended to the value specified here.

See also

TPropsStorage.Section

Section name for storage


TPropsStorage.StoreAnyProperty

Store a property value

Declaration

Source position: rttiutils.pp line 110

public procedure TPropsStorage.StoreAnyProperty(

  PropInfo: PPropInfo

);

Arguments

PropInfo

Information about property to store

Description

StoreAnyProperty stores the property with information specified in PropInfo in the storage mechanism. The property value is retrieved from the object instance specified in the AObject property of TPropsStorage.

Errors

If the property pointer is invalid or AObject is invalid, an exception will be raised.

See also

AObject | Object to load or store properties from
LoadAnyProperty | Load a property value
LoadProperties | Load a list of properties
StoreProperties | Store a list of properties


TPropsStorage.StoreObjectsProps

Store a list of component properties

Declaration

Source position: rttiutils.pp line 115

public procedure TPropsStorage.StoreObjectsProps(

  AComponent: TComponent;

  StoredList: TStrings

);

Arguments

AComponent | Owner component of the components
StoredList | List of components and their properties to load

Description

StoreObjectsProps stores a list of component properties, relative to AComponent: the names of the component properties to store are specified as follows:

ComponentName1.PropertyName
ComponentName2.Subcomponent1.PropertyName

The component instances will be located relative to AComponent, and must therefore be names of components owned by AComponent, followed by a valid property of these components. If the componentname is missing, the property name will be assumed to be a property of AComponent itself.

The Objects property of the stringlist should be filled with the instances of the components the property references refer to: they can be filled with the UpdateStoredList call.

For example, to store the checked state of a checkbox named 'CBCheckMe' and the caption of a button named 'BPressMe', both owned by a form, the following strings should be passed:

CBCheckMe.Checked
BPressMe.Caption

and the ACompontent should be the form component that owns the button and checkbox.

Note that this call removes the value of the AObject property.

See also

UpdateStoredList | Update a stringlist with object references
LoadObjectsProps | Load a list of component properties
LoadProperties | Load a list of properties
LoadAnyProperty | Load a property value


TPropsStorage.StoreProperties

Store a list of properties

Declaration

Source position: rttiutils.pp line 112

public procedure TPropsStorage.StoreProperties(

  PropList: TStrings

);

Arguments

PropList

List with names of properties to store

Description

StoreProperties stores the values of all properties in PropList in the storage mechanism. The list should contain names of published properties of the AObject object.

Errors

If an invalid property name is specified, an exception will be raised.

See also

AObject | Object to load or store properties from
StoreAnyProperty | Store a property value
LoadProperties | Load a list of properties
LoadAnyProperty | Load a property value


TPropsStorage.WriteString

Declaration

Source position: rttiutils.pp line 105

protected procedure TPropsStorage.WriteString(

  const ASection: String;

  const Item: String;

  const Value: String

); virtual;


EIPCError

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Error reporting exception

Declaration

Source position: simpleipc.pp line 155

type EIPCError = class(Exception) end;

Inheritance

EIPCError

Error reporting exception
|

Exception
|

TObject

Description

EIPCError is the exception used by the various classes in the SimpleIPC unit to report errors.


EIPCError
Exception
 | HelpContext
 | Message


EIPCError
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EIPCError

Exception


TIPCClientComm

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Internal client-side communication protocol

Declaration

Source position: simpleipc.pp line 117

type TIPCClientComm = class(TObject)
public
constructor Create(); virtual; | Create a new instance of the TIPCClientComm
property Owner: TSimpleIPCClient; [r] | TSimpleIPCClient instance for which communication must be handled.
procedure Connect; virtual; abstract; | Connect to the server
procedure Disconnect; virtual; abstract; | Disconnect from the server
function ServerRunning; virtual; abstract; | Check if the server is running.
procedure SendMessage(); virtual; abstract; | Send a message
end;

Inheritance

TIPCClientComm

Internal client-side communication protocol
|

TObject

Description

TIPCClientComm is an abstract component which implements the client-side communication protocol. The behaviour expected of this class must be implemented in a platform-dependent descendent class.

The TSimpleIPCClient class does not implement the messaging protocol by itself. Instead, it creates an instance of a (platform dependent) descendent of TIPCClientComm which handles the internals of the commnication protocol.

The server side of the messaging protocol is handled by the TIPCServerComm component. The descenent components must always be implemented in pairs.

See also

TSimpleIPCClient | Simple IPC client component
TIPCServerComm | Internal message communication component
TSimpleIPCServer | Simple IPC server component


TIPCClientComm

ro

Owner


ro

Owner (TIPCClientComm)


TIPCClientComm
 | Create
 | Connect
 | Disconnect
 | ServerRunning
 | SendMessage


Connect (TIPCClientComm)

Create (TIPCClientComm)

Disconnect (TIPCClientComm)

SendMessage (TIPCClientComm)

ServerRunning (TIPCClientComm)


TIPCClientComm


TIPCClientComm.Connect

Connect to the server

Declaration

Source position: simpleipc.pp line 123

public procedure TIPCClientComm.Connect; virtual; abstract;

Description

Connect must establish a communication channel with the server. The server endpoint must be constructed from the ServerID and ServerInstance properties of the owning TSimpleIPCClient instance.

Connect is called by the TSimpleIPCClient.Connect call or when the Active property is set to True

Messages can be sent only after Connect was called succesfully.

Errors

If the connection setup fails, or the connection was already set up , then an exception may be raised.

See also

TSimpleIPCClient.Connect | Connect to the server
Active | Communication channel active
Disconnect | Disconnect from the server


TIPCClientComm.Create

Create a new instance of the TIPCClientComm

Declaration

Source position: simpleipc.pp line 121

public constructor TIPCClientComm.Create(

  AOwner: TSimpleIPCClient

); virtual;

Arguments

AOwner

TSimpleIPCClient instance for which communication must be handled.

Description

Create instantiates a new instance of the TIPCClientComm class, and stores the AOwner reference to the TSimpleIPCClient instance for which it will handle communitation. It can be retrieved later using the Owner property.

See also

Owner | TSimpleIPCClient instance for which communication must be handled.
TSimpleIPCClient | Simple IPC client component


TIPCClientComm.Disconnect

Disconnect from the server

Declaration

Source position: simpleipc.pp line 124

public procedure TIPCClientComm.Disconnect; virtual; abstract;

Description

Disconnect closes the communication channel with the server. Any calls to SendMessage are invalid after Disconnect was called.

Disconnect is called by the TSimpleIPCClient.Disconnect call or when the Active property is set to False.

Messages can no longer be sent after Disconnect was called.

Errors

If the connection shutdown fails, or the connection was already shut down, then an exception may be raised.

See also

TSimpleIPCClient.Disconnect | Disconnect from the server
Active | Communication channel active
Connect | Connect to the server


TIPCClientComm.Owner

TSimpleIPCClient instance for which communication must be handled.

Declaration

Source position: simpleipc.pp line 122

public property TIPCClientComm.Owner: TSimpleIPCClient
  read FOwner;

Description

Owner is the TSimpleIPCClient instance for which the communication must be handled. It cannot be changed, and must be specified when the TIPCClientComm instance is created.

See also

TSimpleIPCClient | Simple IPC client component
TIPCClientComm.Create | Create a new instance of the TIPCClientComm


TIPCClientComm.SendMessage

Send a message

Declaration

Source position: simpleipc.pp line 126

public procedure TIPCClientComm.SendMessage(

  MsgType: TMessageType;

  Stream: TStream

); virtual; abstract;

Arguments

MsgType | Type of message
Stream | Message data

Description

SendMessage should deliver the message with type MsgType and data in Stream to the server. It should not return until the message was delivered.

Errors

If the delivery of the message fails, an exception will be raised.


TIPCClientComm.ServerRunning

Check if the server is running.

Declaration

Source position: simpleipc.pp line 125

public function TIPCClientComm.ServerRunning: Boolean; virtual; abstract;

Function result

True if the server communication channel endpoint can be reached.

Description

ServerRunning returns True if the server endpoint of the communication channel can be found, or False if not. The server endpoint should be obtained from the ServerID and InstanceID properties of the owning TSimpleIPCClient component.

See also

TSimpleIPCClient.InstanceID

TSimpleIPCClient.ServerID


TIPCClientCommClass

Class reference for TIPCClientComm

Declaration

Source position: simpleipc.pp line 128

type TIPCClientCommClass = class of TIPCClientComm;

Description

TIPCClientCommClass is used by TSimpleIPCClient to decide which kind of communication channel to set up.

See also

TSimpleIPCClient | Simple IPC client component
TIPCClientComm | Internal client-side communication protocol


TIPCServerComm

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Internal message communication component

Declaration

Source position: simpleipc.pp line 46

type TIPCServerComm = class(TObject)
protected
function GetInstanceID; virtual; abstract;
public
constructor Create(); virtual; | Create a new instance of the communication handler
property Owner: TSimpleIPCServer; [r] | TSimpleIPCServer instance for which to handle transport
procedure StartServer; virtual; abstract; | Start the server-side of the communication channel
procedure StopServer; virtual; abstract; | Stop the server side of the communication channel.
function PeekMessage(); virtual; abstract; | See if a message is available.
procedure ReadMessage; virtual; abstract; | Read message from the channel.
property InstanceID: String; [r] | Unique identifier for the communication channel.
end;

Inheritance

TIPCServerComm

Internal message communication component

|

TObject

Description

TIPCServerComm is an abstract component which implements the server-side communication protocol. The behaviour expected of this class must be implemented in a platform-dependent descendent class.

The TSimpleIPCServer class does not implement the messaging protocol by itself. Instead, it creates an instance of a (platform dependent) descendent of TIPCServerComm which handles the internals of the commnication protocol.

The client side of the messaging protocol is handled by the TIPCClientComm component. The descenent components must always be implemented in pairs.

See also

TSimpleIPCServer | Simple IPC server component
TIPCClientComm | Internal client-side communication protocol


TIPCServerComm
 | ro | Owner
 | ro | InstanceID


ro | InstanceID (TIPCServerComm)
ro | Owner (TIPCServerComm)


TIPCServerComm
pt | GetInstanceID
 | Create
 | StartServer
 | StopServer
 | PeekMessage
 | ReadMessage


pt | GetInstanceID (TIPCServerComm)
 | PeekMessage (TIPCServerComm)
 | ReadMessage (TIPCServerComm)
 | StartServer (TIPCServerComm)
 | StopServer (TIPCServerComm)


TIPCServerComm


TIPCServerComm.Create

Create a new instance of the communication handler

Declaration

Source position: simpleipc.pp line 52

public constructor TIPCServerComm.Create(

  AOwner: TSimpleIPCServer

); virtual;

Arguments

AOwner

TSimpleIPCServer instance for which to handle transport

Description

Create initializes a new instance of the communication handler. It simply saves the AOwner parameter in the Owner property.

See also

Owner

TSimpleIPCServer instance for which to handle transport


TIPCServerComm.GetInstanceID

Declaration

Source position: simpleipc.pp line 50

protected function TIPCServerComm.GetInstanceID: String; virtual; abstract;

Function result

Unique identification of the channel


TIPCServerComm.InstanceID

Unique identifier for the communication channel.

Declaration

Source position: simpleipc.pp line 58

public property TIPCServerComm.InstanceID: String
  read GetInstanceID;

Description

InstanceID returns a textual representation which uniquely identifies the communication channel on the server. The value is system dependent, and should be usable by the client-side to establish a communication channel with this instance.


TIPCServerComm.Owner

TSimpleIPCServer instance for which to handle transport

Declaration

Source position: simpleipc.pp line 53

public property TIPCServerComm.Owner: TSimpleIPCServer
  read FOwner;

Description

Owner refers to the TSimpleIPCServer instance for which this instance of TSimpleIPCServer handles the transport. It is specified when the TIPCServerComm is created.

See also

TSimpleIPCServer

Simple IPC server component


TIPCServerComm.PeekMessage

See if a message is available.

Declaration

Source position: simpleipc.pp line 56

public function TIPCServerComm.PeekMessage(

  TimeOut: Integer

):Boolean; virtual; abstract;

Arguments

TimeOut

Number of milliseconds to wait for a message.

Function result

True if a message was available.

Description

PeekMessage can be used to see if a message is available: it returns True if a message is available. It will wait maximum TimeOut milliseconds for a message to arrive. If no message was available after this time, it will return False.

If a message was available, it can be read with the ReadMessage call.

See also

ReadMessage

Read message from the channel.


TIPCServerComm.ReadMessage

Read message from the channel.

Declaration

Source position: simpleipc.pp line 57

public procedure TIPCServerComm.ReadMessage; virtual; abstract;

Description

ReadMessage reads the message for the channel, and stores the information in the data structures in the Owner class.

ReadMessage is a blocking call: if no message is available, the program will wait till a message arrives. Use PeekMessage to see if a message is available.

See also

TSimpleIPCServer

Simple IPC server component


TIPCServerComm.StartServer

Start the server-side of the communication channel

Declaration

Source position: simpleipc.pp line 54

public procedure TIPCServerComm.StartServer; virtual; abstract;

Description

StartServer sets up the server-side of the communication channel. After StartServer was called, a client can connect to the communication channel, and send messages to the server.

It is called when the TSimpleIPC.Active property of the TSimpleIPCServer instance is set to True.

Errors

In case of an error, an EIPCError exception is raised.

See also

TSimpleIPCServer | Simple IPC server component
TSimpleIPC.Active | Communication channel active


TIPCServerComm.StopServer

Stop the server side of the communication channel.

Declaration

Source position: simpleipc.pp line 55

public procedure TIPCServerComm.StopServer; virtual; abstract;

Description

StartServer closes down the server-side of the communication channel. After StartServer was called, a client can no longer connect to the communication channel, or even send messages to the server if it was previously connected (i.e. it will be disconnected).

It is called when the TSimpleIPC.Active property of the TSimpleIPCServer instance is set to False.

Errors

In case of an error, an EIPCError exception is raised.

See also

TSimpleIPCServer | Simple IPC server component
TSimpleIPC.Active | Communication channel active


TIPCServerCommClass

Class reference for TIPCServerComm

Declaration

Source position: simpleipc.pp line 60

type TIPCServerCommClass = class of TIPCServerComm;

Description

TIPCServerCommClass is used by TSimpleIPCServer to decide which kind of communication channel to set up.

See also

TSimpleIPCServer | Simple IPC server component
TIPCServerComm | Internal message communication component


TSimpleIPC

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ancestor for client/server simple IPC classes

Declaration

Source position: simpleipc.pp line 63

type TSimpleIPC = class(TComponent)
protected
FBusy: Boolean;
FActive: Boolean;
FServerID: String;
procedure DoError();
procedure CheckInactive;
procedure CheckActive;
procedure Activate; virtual; abstract;
procedure Deactivate; virtual; abstract;
property Busy: Boolean; [r]
published
property Active: Boolean; [rw] | Communication channel active
property ServerID: String; [rw] | Unique server identification
end;

Inheritance

TSimpleIPC

Ancestor for client/server simple IPC classes
|

TComponent
|

TObject

Description

TSimpleIPC is the common ancestor for the TSimpleIPCServer and TSimpleIPCClient classes. It implements some common properties between client and server.

See also

TSimpleIPCServer | Simple IPC server component
TSimpleIPCClient | Simple IPC client component


TSimpleIPC
pt | ro | Busy
pl |  | Active
pl |  | ServerID
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


pl |  | Active (TSimpleIPC)
pt | ro | Busy (TSimpleIPC)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 |  | DesignInfo (TComponent)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
pl |  | ServerID (TSimpleIPC)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TSimpleIPC
pt | DoError
pt | CheckInactive
pt | CheckActive
pt | Activate
pt | Deactivate
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


pt | Activate (TSimpleIPC)
 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
pt | CheckActive (TSimpleIPC)
pt | CheckInactive (TSimpleIPC)
 | Create (TComponent)
pt | Deactivate (TSimpleIPC)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoError (TSimpleIPC)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TSimpleIPC

TComponent


TSimpleIPC.Activate

Declaration

Source position: simpleipc.pp line 74

protected procedure TSimpleIPC.Activate; virtual; abstract;


TSimpleIPC.Active

Communication channel active

Declaration

Source position: simpleipc.pp line 78

published property TSimpleIPC.Active: Boolean
  read FActive
  write SetActive;

Description

Active can be set to True to set up the client or server end of the communication channel. For the server this means that the server end is set up, for the client it means that the client tries to connect to the server with ServerID identification.

See also

ServerID

Unique server identification


TSimpleIPC.Busy

Declaration

Source position: simpleipc.pp line 76

protected property TSimpleIPC.Busy: Boolean
  read FBusy;


TSimpleIPC.CheckActive

Declaration

Source position: simpleipc.pp line 73

protected procedure TSimpleIPC.CheckActive;


TSimpleIPC.CheckInactive

Declaration

Source position: simpleipc.pp line 72

protected procedure TSimpleIPC.CheckInactive;


TSimpleIPC.Deactivate

Declaration

Source position: simpleipc.pp line 75

protected procedure TSimpleIPC.Deactivate; virtual; abstract;


TSimpleIPC.DoError

Declaration

Source position: simpleipc.pp line 71

protected procedure TSimpleIPC.DoError(

  Msg: String;

  Args: array of Const

);


TSimpleIPC.FActive

Declaration

Source position: simpleipc.pp line 69

protected TSimpleIPC.FActive: Boolean;


TSimpleIPC.FBusy

Declaration

Source position: simpleipc.pp line 68

protected TSimpleIPC.FBusy: Boolean;


TSimpleIPC.FServerID

Declaration

Source position: simpleipc.pp line 70

protected TSimpleIPC.FServerID: String;


TSimpleIPC.ServerID

Unique server identification

Declaration

Source position: simpleipc.pp line 79

published property TSimpleIPC.ServerID: String
  read FServerID
  write SetServerID;

Description

ServerID is the unique server identification: on the server, it determines how the server channel is set up, on the client it determines the server with which to connect.

See also

Active

Communication channel active


TSimpleIPCClient

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Simple IPC client component

Declaration

Source position: simpleipc.pp line 131

type TSimpleIPCClient = class(TSimpleIPC)
protected
FIPCComm: TIPCClientComm;
procedure Activate; override;
procedure Deactivate; override;
function CommClass; virtual;
public
constructor Create(); override; | Create a new instance of TSimpleIPCClient
destructor Destroy; override; | Remove the TSimpleIPCClient instance from memory
procedure Connect; | Connect to the server
procedure Disconnect; | Disconnect from the server
function ServerRunning; | Check if the server is running.
procedure SendMessage(); | Send a message to the server
procedure SendStringMessage(); | Send a string message to the server
procedure SendStringMessageFmt(); | Send a formatted string message
property ServerInstance: String; [rw] | Server instance identification
end;

Inheritance

TSimpleIPCClient | Simple IPC client component
|
TSimpleIPC | Ancestor for client/server simple IPC classes
|
TComponent
|
TObject

Description

TSimpleIPCClient is the client side of the simple IPC communication protocol. The client program should create a TSimpleIPCClient instance, set its ServerID property to the unique name for the server it wants to send messages to, and then set the Active property to True (or call Connect).

After the connection with the server was established, messages can be sent to the server with the SendMessage or SendStringMessage calls.

See also

TSimpleIPCServer | Simple IPC server component
TSimpleIPC | Ancestor for client/server simple IPC classes
TIPCClientComm | Internal client-side communication protocol


TSimpleIPCClient
 |  | ServerInstance
TSimpleIPC
pt | ro | Busy
pl |  | Active
pl |  | ServerID
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


pl |  | Active (TSimpleIPC)
pt | ro | Busy (TSimpleIPC)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 |  | DesignInfo (TComponent)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
pl |  | ServerID (TSimpleIPC)
 |  | ServerInstance (TSimpleIPCClient)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TSimpleIPCClient
pt | Activate
pt | Deactivate
pt | CommClass
 | Create
 | Destroy
 | Connect
 | Disconnect
 | ServerRunning
 | SendMessage
 | SendStringMessage
 | SendStringMessageFmt
TSimpleIPC
pt | DoError
pt | CheckInactive
pt | CheckActive
pt | Activate
pt | Deactivate
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


pt | Activate (TSimpleIPC)
pt | Activate (TSimpleIPCClient)
 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
pt | CheckActive (TSimpleIPC)
pt | CheckInactive (TSimpleIPC)
pt | CommClass (TSimpleIPCClient)
 | Connect (TSimpleIPCClient)
 | Create (TComponent)
 | Create (TSimpleIPCClient)
pt | Deactivate (TSimpleIPC)
pt | Deactivate (TSimpleIPCClient)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TSimpleIPCClient)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
 | Disconnect (TSimpleIPCClient)
pt | DoError (TSimpleIPC)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SendMessage (TSimpleIPCClient)
 | SendStringMessage (TSimpleIPCClient)
 | SendStringMessageFmt (TSimpleIPCClient)
 | ServerRunning (TSimpleIPCClient)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TSimpleIPCClient

TSimpleIPC

TComponent


TSimpleIPCClient.Activate

Declaration

Source position: simpleipc.pp line 137

protected procedure TSimpleIPCClient.Activate; override;


TSimpleIPCClient.CommClass

Declaration

Source position: simpleipc.pp line 139

protected function TSimpleIPCClient.CommClass: TIPCClientCommClass; virtual;


TSimpleIPCClient.Connect

Connect to the server

Declaration

Source position: simpleipc.pp line 143

public procedure TSimpleIPCClient.Connect;

Description

Connect connects to the server indicated in the ServerID and InstanceID properties. Connect is called automatically if the Active property is set to True.

After a successful call to Connect, messages can be sent to the server using SendMessage or SendStringMessage.

Calling Connect if the connection is already open has no effect.

Errors

If creating the connection fails, an EIPCError exception may be raised.

See also

ServerID | Unique server identification
InstanceID
Active | Communication channel active
SendMessage | Send a message to the server
SendStringMessage | Send a string message to the server
Disconnect | Disconnect from the server


TSimpleIPCClient.Create

Create a new instance of TSimpleIPCClient

Declaration

Source position: simpleipc.pp line 141

public constructor TSimpleIPCClient.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner of the instance

Description

Create instantiates a new instance of the TSimpleIPCClient class. It initializes the data structures needed to handle the client side of the communication.

See also

Destroy

Remove the TSimpleIPCClient instance from memory


TSimpleIPCClient.Deactivate

Declaration

Source position: simpleipc.pp line 138

protected procedure TSimpleIPCClient.Deactivate; override;


TSimpleIPCClient.Destroy

Remove the TSimpleIPCClient instance from memory

Declaration

Source position: simpleipc.pp line 142

public destructor TSimpleIPCClient.Destroy; override;

Description

Destroy disconnects the client from the server if need be, and cleans up the internal data structures maintained by TSimpleIPCClient and then calls the inherited Destroy, which will remove the instance from memory.

Never call Destroy directly, use the Free method instead or the FreeAndNil procedure in SysUtils.

See also

Create

Create a new instance of TSimpleIPCClient


TSimpleIPCClient.Disconnect

Disconnect from the server

Declaration

Source position: simpleipc.pp line 144

public procedure TSimpleIPCClient.Disconnect;

Description

Disconnect shuts down the connection with the server as previously set up with Connect. Disconnect is called automatically if the Active property is set to False.

After a successful call to Disconnect, messages can no longer be sent to the server. Attempting to do so will result in an exception.

Calling Disconnect if there is no connection has no effect.

Errors

If creating the connection fails, an EIPCError exception may be raised.

See also

Active | Communication channel active
Connect | Connect to the server


TSimpleIPCClient.FIPCComm

Declaration

Source position: simpleipc.pp line 136

protected TSimpleIPCClient.FIPCComm: TIPCClientComm;


TSimpleIPCClient.SendMessage

Send a message to the server

Declaration

Source position: simpleipc.pp line 146

public procedure TSimpleIPCClient.SendMessage(

  MsgType: TMessageType;

  Stream: TStream

);

Arguments

MsgType | Message type
Stream | Message data.

Description

SendMessage sends a message of type MsgType and data from stream to the server. The client must be connected for this call to work.

Errors

In case an error occurs, or there is no connection to the server, an EIPCError exception is raised.

See also

Connect | Connect to the server
SendStringMessage | Send a string message to the server


TSimpleIPCClient.SendStringMessage

Send a string message to the server

Declaration

Source position: line 0

public procedure TSimpleIPCClient.SendStringMessage(

  const Msg: String

);

procedure TSimpleIPCClient.SendStringMessage(

  MsgType: TMessageType;

  const Msg: String

);

Arguments

Msg

String message

Arguments

MsgType | Message type
Msg | String message

Description

SendStringMessage sends a string message with type MsgTyp and data Msg to the server. This is a convenience function: a small wrapper around the SendMessage method

Errors

Same as for SendMessage.

See also

SendMessage | Send a message to the server
Connect | Connect to the server
SendStringMessageFmt | Send a formatted string message


TSimpleIPCClient.SendStringMessageFmt

Send a formatted string message

Declaration

Source position: line 0

public procedure TSimpleIPCClient.SendStringMessageFmt(

  const Msg: String;

  Args: array of Const

);

procedure TSimpleIPCClient.SendStringMessageFmt(

  MsgType: TMessageType;

  const Msg: String;

  Args: array of Const

);

Arguments

Msg | Format string for message
Args | Arguments to format string with

Arguments

MsgType | Message type.
Msg | Format string for message
Args | Arguments to format string with

Description

SendStringMessageFmt sends a string message with type MsgTyp and message formatted from Msg and Args to the server. This is a convenience function: a small wrapper around the SendStringMessage method

Errors

Same as for SendMessage.

See also

SendMessage | Send a message to the server
Connect | Connect to the server
SendStringMessage | Send a string message to the server


TSimpleIPCClient.ServerInstance

Server instance identification

Declaration

Source position: simpleipc.pp line 151

public property TSimpleIPCClient.ServerInstance: String
  read FServerInstance
  write SetServerInstance;

Description

ServerInstance should be used in case a particular instance of the server identified with ServerID should be contacted. This must be used if the server has its GLobal property set to False, and should match the server's InstanceID property.

See also

ServerID | Unique server identification
GLobal | Is the server reachable to all users or not
InstanceID | Instance ID


TSimpleIPCClient.ServerRunning

Check if the server is running.

Declaration

Source position: simpleipc.pp line 145

public function TSimpleIPCClient.ServerRunning: Boolean;

Function result

True if the server can be reached

Description

ServerRunning verifies if the server indicated in the ServerID and InstanceID properties is running. It returns True if the server communication endpoint can be reached, False otherwise. This function can be called before a connection is made.

See also

Connect

Connect to the server


TSimpleIPCServer

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Simple IPC server component

Declaration

Source position: simpleipc.pp line 84

type TSimpleIPCServer = class(TSimpleIPC)
protected
FIPCComm: TIPCServerComm;
function CommClass; virtual;
procedure Activate; override;
procedure Deactivate; override;
procedure ReadMessage;
public
constructor Create(); override; | Create a new instance of TSimpleIPCServer
destructor Destroy; override; | Remove the TSimpleIPCServer instance from memory
procedure StartServer; | Start the server
procedure StopServer; | Stop the server
function PeekMessage(); | Check if a client message is available.
property StringMessage: String; [r] | Last message as a string.
procedure GetMessageData(); | Read the data of the last message in a stream
property MsgType: TMessageType; [r] | Last message type
property MsgData: TStream; [r] | Last message data
property InstanceID: String; [r] | Instance ID
published
property Global: Boolean; [rw] | Is the server reachable to all users or not
property OnMessage: TNotifyEvent; [rw] | Event triggered when a pessage arrives
end;

Inheritance

TSimpleIPCServer | Simple IPC server component
|
TSimpleIPC | Ancestor for client/server simple IPC classes
|
TComponent
|
TObject

Description

TSimpleIPCServer is the server side of the simple IPC communication protocol. The server program should create a TSimpleIPCServer instance, set its ServerID property to a unique name for the system, and then set the Active property to True (or call StartServer).

After the server was started, it can check for availability of messages with the PeekMessage call, and read the message with ReadMessage.

See also

TSimpleIPCClient | Simple IPC client component
TSimpleIPC | Ancestor for client/server simple IPC classes
TIPCServerComm | Internal message communication component


TSimpleIPCServer
 | ro | StringMessage
 | ro | MsgType
 | ro | MsgData
 | ro | InstanceID
pl |  | Global
TSimpleIPC
pt | ro | Busy
pl |  | Active
pl |  | ServerID
TComponent
 | ro | Components
 | ro | ComponentCount
 |  | ComponentIndex
 | ro | ComponentState
 | ro | ComponentStyle
 |  | DesignInfo
 | ro | Owner
 |  | VCLComObject
 |  | Name
 |  | Tag


pl |  | Active (TSimpleIPC)
pt | ro | Busy (TSimpleIPC)
 | ro | ComponentCount (TComponent)
 |  | ComponentIndex (TComponent)
 | ro | Components (TComponent)
 | ro | ComponentState (TComponent)
 | ro | ComponentStyle (TComponent)
 |  | DesignInfo (TComponent)
pl |  | Global (TSimpleIPCServer)
 | ro | InstanceID (TSimpleIPCServer)
 | ro | MsgData (TSimpleIPCServer)
 | ro | MsgType (TSimpleIPCServer)
 |  | Name (TComponent)
 | ro | Owner (TComponent)
pl |  | ServerID (TSimpleIPC)
 | ro | StringMessage (TSimpleIPCServer)
 |  | Tag (TComponent)
 |  | VCLComObject (TComponent)


TSimpleIPCServer
pt | CommClass
pt | Activate
pt | Deactivate
pt | ReadMessage
 | Create
 | Destroy
 | StartServer
 | StopServer
 | PeekMessage
 | GetMessageData
TSimpleIPC
pt | DoError
pt | CheckInactive
pt | CheckActive
pt | Activate
pt | Deactivate
TComponent
 | GetComponent
 | GetComponentCount
 | GetComponentIndex
 | Insert
 | ReadLeft
 | ReadTop
 | Remove
 | RemoveNotification
 | SetComponentIndex
 | SetReference
 | WriteLeft
 | WriteTop
 | ChangeName
 | DefineProperties
 | GetChildren
 | GetChildOwner
 | GetChildParent
 | GetOwner
 | Loaded
 | Loading
 | Notification
 | PaletteCreated
 | ReadState
 | SetAncestor
 | SetDesigning
 | SetDesignInstance
 | SetInline
 | SetName
 | SetChildOrder
 | SetParentComponent
 | Updating
 | Updated
 | UpdateRegistry
 | ValidateRename
 | ValidateContainer
 | ValidateInsert
 | QueryInterface
 | _AddRef
 | _Release
 | iicrGetComponent
 | WriteState
 | Create
 | BeforeDestruction
 | Destroy
 | DestroyComponents
 | Destroying
 | ExecuteAction
 | FindComponent
 | FreeNotification
 | RemoveFreeNotification
 | FreeOnRelease
 | GetNamePath
 | GetParentComponent
 | HasParent
 | InsertComponent
 | RemoveComponent
 | SafeCallException
 | SetSubComponent
 | UpdateAction
 | IsImplementorOf
 | ReferenceInterface


pt | Activate (TSimpleIPC)
pt | Activate (TSimpleIPCServer)
 | BeforeDestruction (TComponent)
 | ChangeName (TComponent)
pt | CheckActive (TSimpleIPC)
pt | CheckInactive (TSimpleIPC)
pt | CommClass (TSimpleIPCServer)
 | Create (TComponent)
 | Create (TSimpleIPCServer)
pt | Deactivate (TSimpleIPC)
pt | Deactivate (TSimpleIPCServer)
 | DefineProperties (TComponent)
 | Destroy (TComponent)
 | Destroy (TSimpleIPCServer)
 | DestroyComponents (TComponent)
 | Destroying (TComponent)
pt | DoError (TSimpleIPC)
 | ExecuteAction (TComponent)
 | FindComponent (TComponent)
 | FreeNotification (TComponent)
 | FreeOnRelease (TComponent)
 | GetChildOwner (TComponent)
 | GetChildParent (TComponent)
 | GetChildren (TComponent)
 | GetComponent (TComponent)
 | GetComponentCount (TComponent)
 | GetComponentIndex (TComponent)
 | GetMessageData (TSimpleIPCServer)
 | GetNamePath (TComponent)
 | GetOwner (TComponent)
 | GetParentComponent (TComponent)
 | HasParent (TComponent)
 | iicrGetComponent (TComponent)
 | Insert (TComponent)
 | InsertComponent (TComponent)
 | IsImplementorOf (TComponent)
 | Loaded (TComponent)
 | Loading (TComponent)
 | Notification (TComponent)
 | PaletteCreated (TComponent)
 | PeekMessage (TSimpleIPCServer)
 | QueryInterface (TComponent)
 | ReadLeft (TComponent)
pt | ReadMessage (TSimpleIPCServer)
 | ReadState (TComponent)
 | ReadTop (TComponent)
 | ReferenceInterface (TComponent)
 | Remove (TComponent)
 | RemoveComponent (TComponent)
 | RemoveFreeNotification (TComponent)
 | RemoveNotification (TComponent)
 | SafeCallException (TComponent)
 | SetAncestor (TComponent)
 | SetChildOrder (TComponent)
 | SetComponentIndex (TComponent)
 | SetDesigning (TComponent)
 | SetDesignInstance (TComponent)
 | SetInline (TComponent)
 | SetName (TComponent)
 | SetParentComponent (TComponent)
 | SetReference (TComponent)
 | SetSubComponent (TComponent)
 | StartServer (TSimpleIPCServer)
 | StopServer (TSimpleIPCServer)
 | UpdateAction (TComponent)
 | Updated (TComponent)
 | UpdateRegistry (TComponent)
 | Updating (TComponent)
 | ValidateContainer (TComponent)
 | ValidateInsert (TComponent)
 | ValidateRename (TComponent)
 | WriteLeft (TComponent)
 | WriteState (TComponent)
 | WriteTop (TComponent)
 | _AddRef (TComponent)
 | _Release (TComponent)


TSimpleIPCServer

pl

OnMessage

TSimpleIPC

TComponent


pl

OnMessage (TSimpleIPCServer)


TSimpleIPCServer.Activate

Declaration

Source position: simpleipc.pp line 96

protected procedure TSimpleIPCServer.Activate; override;


TSimpleIPCServer.CommClass

Declaration

Source position: simpleipc.pp line 95

protected function TSimpleIPCServer.CommClass: TIPCServerCommClass; virtual;


TSimpleIPCServer.Create

Create a new instance of TSimpleIPCServer

Declaration

Source position: simpleipc.pp line 100

public constructor TSimpleIPCServer.Create(

  AOwner: TComponent

); override;

Arguments

AOwner

Owner of the TSimpleIPCServer instance.

Description

Create instantiates a new instance of the TSimpleIPCServer class. It initializes the data structures needed to handle the server side of the communication.

See also

Destroy

Remove the TSimpleIPCServer instance from memory


TSimpleIPCServer.Deactivate

Declaration

Source position: simpleipc.pp line 97

protected procedure TSimpleIPCServer.Deactivate; override;


TSimpleIPCServer.Destroy

Remove the TSimpleIPCServer instance from memory

Declaration

Source position: simpleipc.pp line 101

public destructor TSimpleIPCServer.Destroy; override;

Description

Destroy stops the server, cleans up the internal data structures maintained by TSimpleIPCServer and then calls the inherited Destroy, which will remove the instance from memory.

Never call Destroy directly, use the Free method instead or the FreeAndNil procedure in SysUtils.

See also

Create

Create a new instance of TSimpleIPCServer


TSimpleIPCServer.FIPCComm

Declaration

Source position: simpleipc.pp line 94

protected TSimpleIPCServer.FIPCComm: TIPCServerComm;


TSimpleIPCServer.GetMessageData

Read the data of the last message in a stream

Declaration

Source position: simpleipc.pp line 106

public procedure TSimpleIPCServer.GetMessageData(

  Stream: TStream

);

Arguments

Stream

Stream to store message data in

Description

GetMessageData reads the data of the last message from TSimpleIPCServer.MsgData and stores it in stream Stream. If no data was available, the stream will be cleared.

This function will return valid data only after a succesful call to ReadMessage. It will also not clear the data buffer.

See also

StringMessage | Last message as a string.
MsgData | Last message data
MsgType | Last message type


TSimpleIPCServer.Global

Is the server reachable to all users or not

Declaration

Source position: simpleipc.pp line 111

published property TSimpleIPCServer.Global: Boolean
  read FGlobal
  write SetGlobal;

Description

Global indicates whether the server is reachable to all users (True) or if it is private to the current process (False). In the latter case, the unique channel endpoint identification may change: a unique identification of the current process is appended to the ServerID name.

See also

ServerID

InstanceID

Instance ID


TSimpleIPCServer.InstanceID

Instance ID

Declaration

Source position: simpleipc.pp line 109

public property TSimpleIPCServer.InstanceID: String
  read GetInstanceID;

Description

InstanceID is the unique identifier for this server communication channel endpoint, and will be appended to the ServerID property to form the unique server endpoint which a client should use.

See also

ServerID

Global


TSimpleIPCServer.MsgData

Last message data

Declaration

Source position: simpleipc.pp line 108

public property TSimpleIPCServer.MsgData: TStream
  read FMsgData;

Description

MsgData contains the actual data from the last read message. If the data is a string, then StringMessage is better suited to read the data.

This property will contain valid data only after a succesful call to ReadMessage.

See also

StringMessage

Last message as a string.

ReadMessage


TSimpleIPCServer.MsgType

Last message type

Declaration

Source position: simpleipc.pp line 107

public property TSimpleIPCServer.MsgType: TMessageType
  read FMsgType;

Description

MsgType contains the message type of the last message.

This property will contain valid data only after a succesful call to ReadMessage.

See also

ReadMessage


TSimpleIPCServer.OnMessage

Event triggered when a pessage arrives

Declaration

Source position: simpleipc.pp line 112

published property TSimpleIPCServer.OnMessage: TNotifyEvent
  read FOnMessage
  write FOnMessage;

Description

OnMessage is called by ReadMessage when a message has been read. The actual message data can be retrieved with one of the StringMessage, MsgData or MsgType properties.

See also

StringMessage | Last message as a string.
MsgData | Last message data
MsgType | Last message type


TSimpleIPCServer.PeekMessage

Check if a client message is available.

Declaration

Source position: simpleipc.pp line 104

public function TSimpleIPCServer.PeekMessage(

  TimeOut: Integer;

  DoReadMessage: Boolean

):Boolean;

Arguments

TimeOut | Number of milliseconds to wait for a message.
DoReadMessage | Should the message be read or not ?

Function result

True if a client message is available.

Description

PeekMessage checks if a message from a client is available. It will return True if a message is available. The call will wait for TimeOut milliseconds for a message to arrive: if after TimeOut milliseconds, no message is available, the function will return False.

If DoReadMessage is True then PeekMessage will read the message. If it is False, it does not read the message. The message should then be read manually with ReadMessage.

See also

ReadMessage


TSimpleIPCServer.ReadMessage

Declaration

Source position: simpleipc.pp line 98

protected procedure TSimpleIPCServer.ReadMessage;


TSimpleIPCServer.StartServer

Start the server

Declaration

Source position: simpleipc.pp line 102

public procedure TSimpleIPCServer.StartServer;

Description

StartServer starts the server side of the communication channel. It is called automatically when the Active property is set to True. It creates the internal communication object (a TIPCServerComm descendent) and activates the communication channel.

After this method was called, clients can connect and send messages.

Prior to calling this method, the ServerID property must be set.

Errors

If an error occurs a EIPCError exception may be raised.

See also

TIPCServerComm | Internal message communication component
Active | Communication channel active
ServerID | Unique server identification
StopServer | Stop the server


TSimpleIPCServer.StopServer

Stop the server

Declaration

Source position: simpleipc.pp line 103

public procedure TSimpleIPCServer.StopServer;

Description

StopServer stops the server side of the communication channel. It is called automatically when the Active property is set to False. It deactivates the communication channel and frees the internal communication object (a TIPCServerComm descendent).

See also

TIPCServerComm | Internal message communication component
Active | Communication channel active
ServerID | Unique server identification
StartServer | Start the server


TSimpleIPCServer.StringMessage

Last message as a string.

Declaration

Source position: simpleipc.pp line 105

public property TSimpleIPCServer.StringMessage: String
  read GetStringMessage;

Description

StringMessage is the content of the last message as a string.

This property will contain valid data only after a succesful call to ReadMessage.

See also

GetMessageData

Read the data of the last message in a stream


EStreamColl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception raised when an error occurs when streaming the collection.

Declaration

Source position: streamcoll.pp line 67

type EStreamColl = class(Exception) end;

Inheritance

EStreamColl

Exception raised when an error occurs when streaming the collection.
|

Exception
|

TObject


EStreamColl
Exception
 | HelpContext
 | Message


EStreamColl
Exception
 | Create
 | CreateFmt
 | CreateRes
 | CreateResFmt
 | CreateHelp
 | CreateFmtHelp
 | CreateResHelp
 | CreateResFmtHelp


EStreamColl

Exception


TStreamCollection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection with stream support

Declaration

Source position: streamcoll.pp line 41

type TStreamCollection = class(TCollection)
protected
procedure WriteInteger();
procedure WriteBoolean();
procedure WriteString();
procedure WriteCurrency();
procedure WriteDateTime();
procedure WriteFloat();
function ReadInteger();
function ReadBoolean();
function ReadString();
function ReadCurrency();
function ReadDateTime();
function ReadFloat();
procedure DoSaveToStream(); virtual;
function CurrentStreamVersion; virtual;
procedure DoLoadFromStream(); virtual;
public
procedure LoadFromStream(); | Load the collection from a stream
procedure SaveToStream(); | Load the collection from the stream.
property Streaming: Boolean; [r] | Indicates whether the collection is currently being written to stream
end;

Inheritance

TStreamCollection

Collection with stream support
|

TCollection
|

TObject

Description

TStreamCollection is a TCollection descendent which implements 2 calls LoadFromStream and SaveToStream which load and save the contents of the collection to a stream.

The collection items must be descendents of the TStreamCollectionItem class for the streaming to work correctly.

Note that the stream must be used to load collections of the same type.

See also

TStreamCollectionItem

Collection item with streaming support


TStreamCollection
 | ro | Streaming
TCollection
 |  | PropName
 | ro | UpdateCount
 | ro | Count
 | ro | ItemClass
 |  | Items


ro | Count (TCollection)
ro | ItemClass (TCollection)
 | Items (TCollection)
 | PropName (TCollection)
ro | Streaming (TStreamCollection)
ro | UpdateCount (TCollection)


TStreamCollection
pt | WriteInteger
pt | WriteBoolean
pt | WriteString
pt | WriteCurrency
pt | WriteDateTime
pt | WriteFloat
pt | ReadInteger
pt | ReadBoolean
pt | ReadString
pt | ReadCurrency
pt | ReadDateTime
pt | ReadFloat
pt | DoSaveToStream
pt | CurrentStreamVersion
pt | DoLoadFromStream
 | LoadFromStream
 | SaveToStream
TCollection
 | GetCount
 | GetPropName
 | InsertItem
 | RemoveItem
 | GetAttrCount
 | GetAttr
 | GetItemAttr
 | Changed
 | GetItem
 | SetItem
 | SetItemName
 | SetPropName
 | Update
 | Notify
 | Create
 | Destroy
 | Owner
 | Add
 | Assign
 | BeginUpdate
 | Clear
 | EndUpdate
 | Delete
 | GetNamePath
 | Insert
 | FindItemID
 | Sort


 | Add (TCollection)
 | Assign (TCollection)
 | BeginUpdate (TCollection)
 | Changed (TCollection)
 | Clear (TCollection)
 | Create (TCollection)
pt | CurrentStreamVersion (TStreamCollection)
 | Delete (TCollection)
 | Destroy (TCollection)
pt | DoLoadFromStream (TStreamCollection)
pt | DoSaveToStream (TStreamCollection)
 | EndUpdate (TCollection)
 | FindItemID (TCollection)
 | GetAttr (TCollection)
 | GetAttrCount (TCollection)
 | GetCount (TCollection)
 | GetItem (TCollection)
 | GetItemAttr (TCollection)
 | GetNamePath (TCollection)
 | GetPropName (TCollection)
 | Insert (TCollection)
 | InsertItem (TCollection)
 | LoadFromStream (TStreamCollection)
 | Notify (TCollection)
 | Owner (TCollection)
pt | ReadBoolean (TStreamCollection)
pt | ReadCurrency (TStreamCollection)
pt | ReadDateTime (TStreamCollection)
pt | ReadFloat (TStreamCollection)
pt | ReadInteger (TStreamCollection)
pt | ReadString (TStreamCollection)
 | RemoveItem (TCollection)
 | SaveToStream (TStreamCollection)
 | SetItem (TCollection)
 | SetItemName (TCollection)
 | SetPropName (TCollection)
 | Sort (TCollection)
 | Update (TCollection)
pt | WriteBoolean (TStreamCollection)
pt | WriteCurrency (TStreamCollection)
pt | WriteDateTime (TStreamCollection)
pt | WriteFloat (TStreamCollection)
pt | WriteInteger (TStreamCollection)
pt | WriteString (TStreamCollection)


TStreamCollection

TCollection


TStreamCollection.CurrentStreamVersion

Declaration

Source position: streamcoll.pp line 58

protected function TStreamCollection.CurrentStreamVersion: Integer; virtual;


TStreamCollection.DoLoadFromStream

Declaration

Source position: streamcoll.pp line 59

protected procedure TStreamCollection.DoLoadFromStream(

  S: TStream;

  Streamversion: Integer

); virtual;


TStreamCollection.DoSaveToStream

Declaration

Source position: streamcoll.pp line 57

protected procedure TStreamCollection.DoSaveToStream(

  S: TStream

); virtual;


TStreamCollection.LoadFromStream

Load the collection from a stream

Declaration

Source position: streamcoll.pp line 61

public procedure TStreamCollection.LoadFromStream(

  S: TStream

);

Arguments

S

Stream to load collection from.

Description

LoadFromStream loads the collection from the stream S, if the collection was saved using SaveToStream. It reads the number of items in the collection, and then creates and loads the items one by one from the stream.

Errors

An exception may be raised if the stream contains invalid data.

See also

TStreamCollection.SaveToStream

Load the collection from the stream.


TStreamCollection.ReadBoolean

Declaration

Source position: streamcoll.pp line 52

protected function TStreamCollection.ReadBoolean(

  S: TStream

):Boolean;


TStreamCollection.ReadCurrency

Declaration

Source position: streamcoll.pp line 54

protected function TStreamCollection.ReadCurrency(

  S: TStream

):Currency;


TStreamCollection.ReadDateTime

Declaration

Source position: streamcoll.pp line 55

protected function TStreamCollection.ReadDateTime(

  S: TStream

):TDateTime;


TStreamCollection.ReadFloat

Declaration

Source position: streamcoll.pp line 56

protected function TStreamCollection.ReadFloat(

  S: TStream

):Double;


TStreamCollection.ReadInteger

Declaration

Source position: streamcoll.pp line 51

protected function TStreamCollection.ReadInteger(

  S: TStream

):Integer;


TStreamCollection.ReadString

Declaration

Source position: streamcoll.pp line 53

protected function TStreamCollection.ReadString(

  S: TStream

):String;


TStreamCollection.SaveToStream

Load the collection from the stream.

Declaration

Source position: streamcoll.pp line 62

public procedure TStreamCollection.SaveToStream(

  S: TStream

);

Arguments

S

Stream to save collection to

Description

SaveToStream saves the collection to the stream S so it can be read from the stream with LoadFromStream. It does this by writing the number of collection items to the stream, and then streaming all items in the collection by calling their SaveToStream method.

Errors

None.

See also

TStreamCollection.LoadFromStream

Load the collection from a stream


TStreamCollection.Streaming

Indicates whether the collection is currently being written to stream

Declaration

Source position: streamcoll.pp line 63

public property TStreamCollection.Streaming: Boolean
  read FStreaming;

Description

Streaming is set to True if the collection is written to or loaded from stream, and is set again to False if the streaming process is finished.

See also

TStreamCollection.LoadFromStream | Load the collection from a stream
TStreamCollection.SaveToStream | Load the collection from the stream.


TStreamCollection.WriteBoolean

Declaration

Source position: streamcoll.pp line 46

protected procedure TStreamCollection.WriteBoolean(

  S: TStream;

  AValue: Boolean

);


TStreamCollection.WriteCurrency

Declaration

Source position: streamcoll.pp line 48

protected procedure TStreamCollection.WriteCurrency(

  S: TStream;

  AValue: Currency

);


TStreamCollection.WriteDateTime

Declaration

Source position: streamcoll.pp line 49

protected procedure TStreamCollection.WriteDateTime(

  S: TStream;

  AValue: TDateTime

);


TStreamCollection.WriteFloat

Declaration

Source position: streamcoll.pp line 50

protected procedure TStreamCollection.WriteFloat(

  S: TStream;

  AValue: Double

);


TStreamCollection.WriteInteger

Declaration

Source position: streamcoll.pp line 45

protected procedure TStreamCollection.WriteInteger(

  S: TStream;

  AValue: Integer

);


TStreamCollection.WriteString

Declaration

Source position: streamcoll.pp line 47

protected procedure TStreamCollection.WriteString(

  S: TStream;

  AValue: String

);


TStreamCollectionItem

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection item with streaming support

Declaration

Source position: streamcoll.pp line 23

type TStreamCollectionItem = class(TCollectionItem)

protected

  procedure WriteInteger();

  procedure WriteBoolean();

  procedure WriteString();

  procedure WriteCurrency();

  procedure WriteDateTime();

  procedure WriteFloat();

  function ReadInteger();

  function ReadBoolean();

  function ReadString();

  function ReadCurrency();

  function ReadDateTime();

  function ReadFloat();

  procedure LoadFromStream(); virtual; abstract;

  procedure SaveToStream(); virtual; abstract;

end;

Inheritance

TStreamCollectionItem

Collection item with streaming support
|

TCollectionItem
|

TObject

Description

TStreamCollectionItem is a TCollectionItem descendent which implements 2 abstract routines: LoadFromStream and SaveToStream which must be overridden in a descendent class.

These 2 routines will be called by the TStreamCollection to save or load the item from the stream.

See also

TStreamCollection

Collection with stream support


TStreamCollectionItem
TCollectionItem
 | ro | UpdateCount
 |  | Collection
 | ro | ID
 |  | Index
 |  | DisplayName


ro | ID (TCollectionItem)
 | Index (TCollectionItem)
ro | UpdateCount (TCollectionItem)


TStreamCollectionItem
pt | WriteInteger
pt | WriteBoolean
pt | WriteString
pt | WriteCurrency
pt | WriteDateTime
pt | WriteFloat
pt | ReadInteger
pt | ReadBoolean
pt | ReadString
pt | ReadCurrency
pt | ReadDateTime
pt | ReadFloat
pt | LoadFromStream
pt | SaveToStream
TCollectionItem
 | GetIndex
 | SetCollection
 | Changed
 | GetOwner
 | GetDisplayName
 | SetIndex
 | SetDisplayName
 | Create
 | Destroy
 | GetNamePath


 | Changed (TCollectionItem)
 | Create (TCollectionItem)
 | Destroy (TCollectionItem)
 | GetDisplayName (TCollectionItem)
 | GetIndex (TCollectionItem)
 | GetNamePath (TCollectionItem)
 | GetOwner (TCollectionItem)
pt | LoadFromStream (TStreamCollectionItem)
pt | ReadBoolean (TStreamCollectionItem)
pt | ReadCurrency (TStreamCollectionItem)
pt | ReadDateTime (TStreamCollectionItem)
pt | ReadFloat (TStreamCollectionItem)
pt | ReadInteger (TStreamCollectionItem)
pt | ReadString (TStreamCollectionItem)
pt | SaveToStream (TStreamCollectionItem)
 | SetCollection (TCollectionItem)
 | SetDisplayName (TCollectionItem)
 | SetIndex (TCollectionItem)
pt | WriteBoolean (TStreamCollectionItem)
pt | WriteCurrency (TStreamCollectionItem)
pt | WriteDateTime (TStreamCollectionItem)
pt | WriteFloat (TStreamCollectionItem)
pt | WriteInteger (TStreamCollectionItem)
pt | WriteString (TStreamCollectionItem)


TStreamCollectionItem

TCollectionItem


TStreamCollectionItem.LoadFromStream

Declaration

Source position: streamcoll.pp line 37

protected procedure TStreamCollectionItem.LoadFromStream(

  S: TStream;

  Streamversion: Integer

); virtual; abstract;


TStreamCollectionItem.ReadBoolean

Declaration

Source position: streamcoll.pp line 32

protected function TStreamCollectionItem.ReadBoolean(

  S: TStream

):Boolean;


TStreamCollectionItem.ReadCurrency

Declaration

Source position: streamcoll.pp line 34

protected function TStreamCollectionItem.ReadCurrency(

  S: TStream

):Currency;


TStreamCollectionItem.ReadDateTime

Declaration

Source position: streamcoll.pp line 35

protected function TStreamCollectionItem.ReadDateTime(

  S: TStream

):TDateTime;


TStreamCollectionItem.ReadFloat

Declaration

Source position: streamcoll.pp line 36

protected function TStreamCollectionItem.ReadFloat(

  S: TStream

):Double;


TStreamCollectionItem.ReadInteger

Declaration

Source position: streamcoll.pp line 31

protected function TStreamCollectionItem.ReadInteger(

  S: TStream

):Integer;


TStreamCollectionItem.ReadString

Declaration

Source position: streamcoll.pp line 33

protected function TStreamCollectionItem.ReadString(

  S: TStream

):String;


TStreamCollectionItem.SaveToStream

Declaration

Source position: streamcoll.pp line 38

protected procedure TStreamCollectionItem.SaveToStream(

  S: TStream

); virtual; abstract;


TStreamCollectionItem.WriteBoolean

Declaration

Source position: streamcoll.pp line 26

protected procedure TStreamCollectionItem.WriteBoolean(

  S: TStream;

  AValue: Boolean

);


TStreamCollectionItem.WriteCurrency

Declaration

Source position: streamcoll.pp line 28

protected procedure TStreamCollectionItem.WriteCurrency(

  S: TStream;

  AValue: Currency

);


TStreamCollectionItem.WriteDateTime

Declaration

Source position: streamcoll.pp line 29

protected procedure TStreamCollectionItem.WriteDateTime(

  S: TStream;

  AValue: TDateTime

);


TStreamCollectionItem.WriteFloat

Declaration

Source position: streamcoll.pp line 30

protected procedure TStreamCollectionItem.WriteFloat(

  S: TStream;

  AValue: Double

);


TStreamCollectionItem.WriteInteger

Declaration

Source position: streamcoll.pp line 25

protected procedure TStreamCollectionItem.WriteInteger(

  S: TStream;

  AValue: Integer

);


TStreamCollectionItem.WriteString

Declaration

Source position: streamcoll.pp line 27

protected procedure TStreamCollectionItem.WriteString(

  S: TStream;

  AValue: String

);


TBidirBinaryObjectReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Binary component stream reader with BiDi support

Declaration

Source position: streamex.pp line 13

type TBidirBinaryObjectReader = class(TBinaryObjectReader)

protected

  function GetPosition;

  procedure SetPosition();

public

  property Position: LongInt; [rw]

Position in the stream

end;

Inheritance

TBidirBinaryObjectReader

Binary component stream reader with BiDi support
|

TBinaryObjectReader
|

TObject

Description

TBidirBinaryObjectReader is a class descendent from TBinaryObjectReader, which implements the necessary support for BiDi data: the position in the stream (not available in the standard streaming) is emulated.

See also

TBidirBinaryObjectWriter | Binary component stream writer with BiDi support
TDelphiReader | Stream reader with BiDi Support


TBidirBinaryObjectReader

Position

TBinaryObjectReader


TBidirBinaryObjectReader
pt | GetPosition
pt | SetPosition
TBinaryObjectReader
 | ReadWord
 | ReadDWord
 | ReadQWord
 | ReadExtended
 | SkipProperty
 | SkipSetBody
 | Create
 | Destroy
 | NextValue
 | ReadValue
 | BeginRootComponent
 | BeginComponent
 | BeginProperty
 | Read
 | ReadBinary
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInt8
 | ReadInt16
 | ReadInt32
 | ReadInt64
 | ReadSet
 | ReadStr
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | SkipComponent
 | SkipValue


 | BeginComponent (TBinaryObjectReader)
 | BeginProperty (TBinaryObjectReader)
 | BeginRootComponent (TBinaryObjectReader)
 | Create (TBinaryObjectReader)
 | Destroy (TBinaryObjectReader)
pt | GetPosition (TBidirBinaryObjectReader)
 | NextValue (TBinaryObjectReader)
 | Read (TBinaryObjectReader)
 | ReadBinary (TBinaryObjectReader)
 | ReadCurrency (TBinaryObjectReader)
 | ReadDate (TBinaryObjectReader)
 | ReadDWord (TBinaryObjectReader)
 | ReadExtended (TBinaryObjectReader)
 | ReadFloat (TBinaryObjectReader)
 | ReadIdent (TBinaryObjectReader)
 | ReadInt16 (TBinaryObjectReader)
 | ReadInt32 (TBinaryObjectReader)
 | ReadInt64 (TBinaryObjectReader)
 | ReadInt8 (TBinaryObjectReader)
 | ReadQWord (TBinaryObjectReader)
 | ReadSet (TBinaryObjectReader)
 | ReadSingle (TBinaryObjectReader)
 | ReadStr (TBinaryObjectReader)
 | ReadString (TBinaryObjectReader)
 | ReadUnicodeString (TBinaryObjectReader)
 | ReadValue (TBinaryObjectReader)
 | ReadWideString (TBinaryObjectReader)
 | ReadWord (TBinaryObjectReader)
pt | SetPosition (TBidirBinaryObjectReader)
 | SkipComponent (TBinaryObjectReader)
 | SkipProperty (TBinaryObjectReader)
 | SkipSetBody (TBinaryObjectReader)
 | SkipValue (TBinaryObjectReader)


TBidirBinaryObjectReader

TBinaryObjectReader


TBidirBinaryObjectReader.GetPosition

Declaration

Source position: streamex.pp line 15

protected function TBidirBinaryObjectReader.GetPosition: LongInt;


TBidirBinaryObjectReader.Position

Position in the stream

Declaration

Source position: streamex.pp line 18

public property TBidirBinaryObjectReader.Position: LongInt
  read GetPosition
  write SetPosition;

Description

Position exposes the position of the stream in the reader for use in the TDelphiReader class.

See also

TDelphiReader

Stream reader with BiDi Support


TBidirBinaryObjectReader.SetPosition

Declaration

Source position: streamex.pp line 16

protected procedure TBidirBinaryObjectReader.SetPosition(

  const AValue: LongInt

);


TBidirBinaryObjectWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Binary component stream writer with BiDi support

Declaration

Source position: streamex.pp line 23

type TBidirBinaryObjectWriter = class(TBinaryObjectWriter)

protected

  function GetPosition;

  procedure SetPosition();

public

  property Position: LongInt; [rw]

Position in the stream

end;

Inheritance

TBidirBinaryObjectWriter

Binary component stream writer with BiDi support
|

TBinaryObjectWriter
|

TObject

Description

TBidirBinaryObjectReader is a class descendent from TBinaryObjectWriter, which implements the necessary support for BiDi data.

See also

TBidirBinaryObjectWriter | Binary component stream writer with BiDi support
TDelphiWriter | Stream writer with BiDi Support


TBidirBinaryObjectWriter

Position

TBinaryObjectWriter


TBidirBinaryObjectWriter
pt | GetPosition
pt | SetPosition
TBinaryObjectWriter
 | WriteWord
 | WriteDWord
 | WriteQWord
 | WriteExtended
 | FlushBuffer
 | WriteValue
 | WriteStr
 | Create
 | Destroy
 | BeginCollection
 | BeginComponent
 | BeginList
 | EndList
 | BeginProperty
 | EndProperty
 | Write
 | WriteBinary
 | WriteBoolean
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteUInt64
 | WriteMethodName
 | WriteSet
 | WriteString
 | WriteWideString
 | WriteUnicodeString
 | WriteVariant


 | BeginCollection (TBinaryObjectWriter)
 | BeginComponent (TBinaryObjectWriter)
 | BeginList (TBinaryObjectWriter)
 | BeginProperty (TBinaryObjectWriter)
 | Create (TBinaryObjectWriter)
 | Destroy (TBinaryObjectWriter)
 | EndList (TBinaryObjectWriter)
 | EndProperty (TBinaryObjectWriter)
 | FlushBuffer (TBinaryObjectWriter)
pt | GetPosition (TBidirBinaryObjectWriter)
pt | SetPosition (TBidirBinaryObjectWriter)
 | Write (TBinaryObjectWriter)
 | WriteBinary (TBinaryObjectWriter)
 | WriteBoolean (TBinaryObjectWriter)
 | WriteCurrency (TBinaryObjectWriter)
 | WriteDate (TBinaryObjectWriter)
 | WriteDWord (TBinaryObjectWriter)
 | WriteExtended (TBinaryObjectWriter)
 | WriteFloat (TBinaryObjectWriter)
 | WriteIdent (TBinaryObjectWriter)
 | WriteInteger (TBinaryObjectWriter)
 | WriteMethodName (TBinaryObjectWriter)
 | WriteQWord (TBinaryObjectWriter)
 | WriteSet (TBinaryObjectWriter)
 | WriteSingle (TBinaryObjectWriter)
 | WriteStr (TBinaryObjectWriter)
 | WriteString (TBinaryObjectWriter)
 | WriteUInt64 (TBinaryObjectWriter)
 | WriteUnicodeString (TBinaryObjectWriter)
 | WriteValue (TBinaryObjectWriter)
 | WriteVariant (TBinaryObjectWriter)
 | WriteWideString (TBinaryObjectWriter)
 | WriteWord (TBinaryObjectWriter)


TBidirBinaryObjectWriter

TBinaryObjectWriter


TBidirBinaryObjectWriter.GetPosition

Declaration

Source position: streamex.pp line 25

protected function TBidirBinaryObjectWriter.GetPosition: LongInt;


TBidirBinaryObjectWriter.Position

Position in the stream

Declaration

Source position: streamex.pp line 28

public property TBidirBinaryObjectWriter.Position: LongInt
  read GetPosition
  write SetPosition;

Description

Position exposes the position of the stream in the writer for use in the TDelphiWriter class.

See also

TDelphiWriter

Stream writer with BiDi Support


TBidirBinaryObjectWriter.SetPosition

Declaration

Source position: streamex.pp line 26

protected procedure TBidirBinaryObjectWriter.SetPosition(

  const AValue: LongInt

);


TDelphiReader

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream reader with BiDi Support

Declaration

Source position: streamex.pp line 33

type TDelphiReader = class(TReader)
protected
function GetPosition;
procedure SetPosition();
function CreateDriver(); override;
public
function GetDriver; | Return the driver class as a TBidirBinaryObjectReader class
function ReadStr; | Overrides the standard ReadStr method
procedure Read(); override; | Read data from stream
property Position: LongInt; [rw] | Position in the stream
end;

Inheritance

TDelphiReader

Stream reader with BiDi Support
|

TReader
|

TObject

Description

TDelphiReader is a descendent of TReader which has support for BiDi Streaming. It overrides the stream reading methods for strings, and makes sure the stream can be positioned in the case of strings. For this purpose, it makes use of the TBidirBinaryObjectReader driver class.

See also

TDelphiWriter | Stream writer with BiDi Support
TBidirBinaryObjectReader | Binary component stream reader with BiDi support


TDelphiReader
 |  | Position
TReader
 | ro | PropName
 | ro | CanHandleExceptions
 | ro | Driver
 |  | Owner
 |  | Parent


ro | CanHandleExceptions (TReader)
ro | Driver (TReader)
 | Owner (TReader)
 | Parent (TReader)
 | Position (TDelphiReader)
ro | PropName (TReader)


TDelphiReader
pt | GetPosition
pt | SetPosition
pt | CreateDriver
 | GetDriver
 | ReadStr
 | Read
TReader
 | DoFixupReferences
 | FindComponentClass
 | Error
 | FindMethod
 | ReadProperty
 | ReadPropValue
 | PropertyError
 | ReadData
 | CreateDriver
 | Create
 | Destroy
 | BeginReferences
 | CheckValue
 | DefineProperty
 | DefineBinaryProperty
 | EndOfList
 | EndReferences
 | FixupReferences
 | NextValue
 | Read
 | ReadBoolean
 | ReadChar
 | ReadWideChar
 | ReadUnicodeChar
 | ReadCollection
 | ReadComponent
 | ReadComponents
 | ReadFloat
 | ReadSingle
 | ReadDate
 | ReadCurrency
 | ReadIdent
 | ReadInteger
 | ReadInt64
 | ReadListBegin
 | ReadListEnd
 | ReadRootComponent
 | ReadVariant
 | ReadString
 | ReadWideString
 | ReadUnicodeString
 | ReadValue
 | CopyValue


 | BeginReferences (TReader)
 | CheckValue (TReader)
 | CopyValue (TReader)
 | Create (TReader)
 | CreateDriver (TReader)
pt | CreateDriver (TDelphiReader)
 | DefineBinaryProperty (TReader)
 | DefineProperty (TReader)
 | Destroy (TReader)
 | DoFixupReferences (TReader)
 | EndOfList (TReader)
 | EndReferences (TReader)
 | Error (TReader)
 | FindComponentClass (TReader)
 | FindMethod (TReader)
 | FixupReferences (TReader)
 | GetDriver (TDelphiReader)
pt | GetPosition (TDelphiReader)
 | NextValue (TReader)
 | PropertyError (TReader)
 | Read (TReader)
 | Read (TDelphiReader)
 | ReadBoolean (TReader)
 | ReadChar (TReader)
 | ReadCollection (TReader)
 | ReadComponent (TReader)
 | ReadComponents (TReader)
 | ReadCurrency (TReader)
 | ReadData (TReader)
 | ReadDate (TReader)
 | ReadFloat (TReader)
 | ReadIdent (TReader)
 | ReadInt64 (TReader)
 | ReadInteger (TReader)
 | ReadListBegin (TReader)
 | ReadListEnd (TReader)
 | ReadProperty (TReader)
 | ReadPropValue (TReader)
 | ReadRootComponent (TReader)
 | ReadSingle (TReader)
 | ReadStr (TDelphiReader)
 | ReadString (TReader)
 | ReadUnicodeChar (TReader)
 | ReadUnicodeString (TReader)
 | ReadValue (TReader)
 | ReadVariant (TReader)
 | ReadWideChar (TReader)
 | ReadWideString (TReader)
pt | SetPosition (TDelphiReader)


TDelphiReader
TReader
 | OnError
 | OnPropertyNotFound
 | OnFindMethod
 | OnSetMethodProperty
 | OnSetName
 | OnReferenceName
 | OnAncestorNotFound
 | OnCreateComponent
 | OnFindComponentClass
 | OnReadStringProperty


OnAncestorNotFound (TReader)

OnCreateComponent (TReader)

OnError (TReader)

OnFindComponentClass (TReader)

OnFindMethod (TReader)

OnPropertyNotFound (TReader)

OnReadStringProperty (TReader)

OnReferenceName (TReader)

OnSetMethodProperty (TReader)

OnSetName (TReader)


TDelphiReader.CreateDriver

Declaration

Source position: streamex.pp line 37

protected function TDelphiReader.CreateDriver(

  Stream: TStream;

  BufSize: Integer

):TAbstractObjectReader; override;


TDelphiReader.GetDriver

Return the driver class as a TBidirBinaryObjectReader class

Declaration

Source position: streamex.pp line 39

public function TDelphiReader.GetDriver: TBidirBinaryObjectReader;

Function result

The driver instance.

Description

GetDriver simply returns the used driver and typecasts it as TBidirBinaryObjectReader class.

See also

TBidirBinaryObjectReader

Binary component stream reader with BiDi support


TDelphiReader.GetPosition

Declaration

Source position: streamex.pp line 35

protected function TDelphiReader.GetPosition: LongInt;


TDelphiReader.Position

Position in the stream

Declaration

Source position: streamex.pp line 42

public property TDelphiReader.Position: LongInt
  read GetPosition
  write SetPosition;

Description

Position in the stream.

See also

TDelphiReader.Read

Read data from stream


TDelphiReader.Read

Read data from stream

Declaration

Source position: streamex.pp line 41

public procedure TDelphiReader.Read(

  var Buf;

  Count: LongInt

); override;

Arguments

Buf | Buffer to contain the data
Count | Number of bytes to read from the stream

Description

Read reads raw data from the stream. It reads Count bytes from the stream and places them in Buf. It forces the use of the TBidirBinaryObjectReader class when reading.

See also

TBidirBinaryObjectReader | Binary component stream reader with BiDi support
TDelphiReader.Position | Position in the stream


TDelphiReader.ReadStr

Overrides the standard ReadStr method

Declaration

Source position: streamex.pp line 40

public function TDelphiReader.ReadStr: String;

Function result

String read from stream

Description

ReadStr makes sure the TBidirBinaryObjectReader methods are used, to store additional information about the stream position when reading the strings.

See also

TBidirBinaryObjectReader

Binary component stream reader with BiDi support


TDelphiReader.SetPosition

Declaration

Source position: streamex.pp line 36

protected procedure TDelphiReader.SetPosition(

  const AValue: LongInt

);


TDelphiWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream writer with BiDi Support

Declaration

Source position: streamex.pp line 47

type TDelphiWriter = class(TWriter)
protected
function GetPosition;
procedure SetPosition();
function CreateDriver(); override;
public
function GetDriver; | Return the driver class as a TBidirBinaryObjectWriter class
procedure FlushBuffer; | Flushes the stream buffer
procedure Write(); override; | Write raw data to the stream
procedure WriteStr(); | Write a string to the stream
procedure WriteValue(); | Write value type
property Position: LongInt; [rw] | Position in the stream
end;

Inheritance

TDelphiWriter

Stream writer with BiDi Support
|

TWriter
|

TObject

Description

TDelphiWriter is a descendent of TWriter which has support for BiDi Streaming. It overrides the stream writing methods for strings, and makes sure the stream can be positioned in the case of strings. For this purpose, it makes use of the TBidirBinaryObjectWriter driver class.

See also

TDelphiReader | Stream reader with BiDi Support
TBidirBinaryObjectWriter | Binary component stream writer with BiDi support


TDelphiWriter
 |  | Position
TWriter
 |  | RootAncestor
 | ro | Driver
 | ro | PropertyPath


ro | Driver (TWriter)
 | Position (TDelphiWriter)
ro | PropertyPath (TWriter)
 | RootAncestor (TWriter)


TDelphiWriter
pt | GetPosition
pt | SetPosition
pt | CreateDriver
 | GetDriver
 | FlushBuffer
 | Write
 | WriteStr
 | WriteValue
TWriter
 | AddToAncestorList
 | WriteComponentData
 | DetermineAncestor
 | DoFindAncestor
 | SetRoot
 | WriteBinary
 | WriteProperty
 | WriteProperties
 | WriteChildren
 | CreateDriver
 | Create
 | Destroy
 | DefineProperty
 | DefineBinaryProperty
 | Write
 | WriteBoolean
 | WriteCollection
 | WriteComponent
 | WriteChar
 | WriteWideChar
 | WriteDescendent
 | WriteFloat
 | WriteSingle
 | WriteDate
 | WriteCurrency
 | WriteIdent
 | WriteInteger
 | WriteListBegin
 | WriteListEnd
 | WriteRootComponent
 | WriteString
 | WriteWideString
 | WriteUnicodeString
 | WriteVariant


 | AddToAncestorList (TWriter)
 | Create (TWriter)
 | CreateDriver (TWriter)
pt | CreateDriver (TDelphiWriter)
 | DefineBinaryProperty (TWriter)
 | DefineProperty (TWriter)
 | Destroy (TWriter)
 | DetermineAncestor (TWriter)
 | DoFindAncestor (TWriter)
 | FlushBuffer (TDelphiWriter)
 | GetDriver (TDelphiWriter)
pt | GetPosition (TDelphiWriter)
pt | SetPosition (TDelphiWriter)
 | SetRoot (TWriter)
 | Write (TWriter)
 | Write (TDelphiWriter)
 | WriteBinary (TWriter)
 | WriteBoolean (TWriter)
 | WriteChar (TWriter)
 | WriteChildren (TWriter)
 | WriteCollection (TWriter)
 | WriteComponent (TWriter)
 | WriteComponentData (TWriter)
 | WriteCurrency (TWriter)
 | WriteDate (TWriter)
 | WriteDescendent (TWriter)
 | WriteFloat (TWriter)
 | WriteIdent (TWriter)
 | WriteInteger (TWriter)
 | WriteListBegin (TWriter)
 | WriteListEnd (TWriter)
 | WriteProperties (TWriter)
 | WriteProperty (TWriter)
 | WriteRootComponent (TWriter)
 | WriteSingle (TWriter)
 | WriteStr (TDelphiWriter)
 | WriteString (TWriter)
 | WriteUnicodeString (TWriter)
 | WriteValue (TDelphiWriter)
 | WriteVariant (TWriter)
 | WriteWideChar (TWriter)
 | WriteWideString (TWriter)


TDelphiWriter
TWriter
 | OnFindAncestor
 | OnWriteMethodProperty
 | OnWriteStringProperty


TDelphiWriter.CreateDriver

Declaration

Source position: streamex.pp line 51

protected function TDelphiWriter.CreateDriver(

  Stream: TStream;

  BufSize: Integer

):TAbstractObjectWriter; override;


TDelphiWriter.FlushBuffer

Flushes the stream buffer

Declaration

Source position: streamex.pp line 54

public procedure TDelphiWriter.FlushBuffer;

Description

FlushBuffer flushes the internal buffer of the writer. It simply calls the FlushBuffer method of the driver class.


TDelphiWriter.GetDriver

Return the driver class as a TBidirBinaryObjectWriter class

Declaration

Source position: streamex.pp line 53

public function TDelphiWriter.GetDriver: TBidirBinaryObjectWriter;

Function result

The driver instance

Description

GetDriver simply returns the used driver and typecasts it as TBidirBinaryObjectWriter class.

See also

TBidirBinaryObjectWriter

Binary component stream writer with BiDi support


TDelphiWriter.GetPosition

Declaration

Source position: streamex.pp line 49

protected function TDelphiWriter.GetPosition: LongInt;


TDelphiWriter.Position

Position in the stream

Declaration

Source position: streamex.pp line 58

public property TDelphiWriter.Position: LongInt
  read GetPosition
  write SetPosition;

Description

Position exposes the position in the stream as exposed by the TBidirBinaryObjectWriter instance used when streaming.

See also

TBidirBinaryObjectWriter

Binary component stream writer with BiDi support


TDelphiWriter.SetPosition

Declaration

Source position: streamex.pp line 50

protected procedure TDelphiWriter.SetPosition(

  const AValue: LongInt

);


TDelphiWriter.Write

Write raw data to the stream

Declaration

Source position: streamex.pp line 55

public procedure TDelphiWriter.Write(

  const Buf;

  Count: LongInt

); override;

Arguments

Buf | Buffer containing data to write
Count | Number of bytes to write

Description

Write writes Count bytes from Buf to the buffer, updating the position as needed.


TDelphiWriter.WriteStr

Write a string to the stream

Declaration

Source position: streamex.pp line 56

public procedure TDelphiWriter.WriteStr(

  const Value: String

);

Arguments

Value

String to write

Description

WriteStr writes a string to the stream, forcing the use of the TBidirBinaryObjectWriter class methods, which update the position of the stream.

See also

TBidirBinaryObjectWriter

Binary component stream writer with BiDi support


TDelphiWriter.WriteValue

Write value type

Declaration

Source position: streamex.pp line 57

public procedure TDelphiWriter.WriteValue(

  Value: TValueType

);

Arguments

Value

Value to write to stream

Description

WriteValue overrides the same method in TWriter to force the use of the TBidirBinaryObjectWriter methods, which update the position of the stream.

See also

TBidirBinaryObjectWriter

Binary component stream writer with BiDi support


TCriticalSection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Critical section

Declaration

Source position: syncobjs.pp line 38

type TCriticalSection = class(TSynchroObject)
public
procedure Acquire; override; | Enter the critical section
procedure Release; override; | Leave the critical section
procedure Enter; | Alias for Acquire
procedure Leave; | Alias for Release
constructor Create; | Create a new critical section.
destructor Destroy; override; | Destroy the criticalsection instance
end;

Inheritance

TCriticalSection | Critical section
|
TSynchroObject | Abstract synchronization object
|
TObject

Description

TCriticalSection is a class wrapper around the low-level TRTLCriticalSection routines. It simply calls the RTL routines in the system unit for critical section support.

A critical section is a resource which can be owned by only 1 caller: it can be used to make sure that in a multithreaded application only 1 thread enters pieces of code protected by the critical section.

Typical usage is to protect a piece of code with the following code (MySection is a TCriticalSection instance):

// Previous code
  MySection.Acquire;
  Try
    // Protected code
  Finally
    MySection.Release;
  end;
  // Other code.

The protected code can be executed by only 1 thread at a time. This is useful for instance for list operations in multithreaded environments.

See also

Acquire | Enter the critical section
Release | Leave the critical section


TCriticalSection

TSynchroObject


TCriticalSection
 | Acquire
 | Release
 | Enter
 | Leave
 | Create
 | Destroy
TSynchroObject
 | Acquire
 | Release


Acquire (TSynchroObject)

Acquire (TCriticalSection)

Create (TCriticalSection)

Destroy (TCriticalSection)

Enter (TCriticalSection)

Leave (TCriticalSection)

Release (TSynchroObject)

Release (TCriticalSection)


TCriticalSection.Acquire

Enter the critical section

Declaration

Source position: syncobjs.pp line 42

public procedure TCriticalSection.Acquire; override;

Description

Acquire attempts to enter the critical section. It will suspend the calling thread if the critical section is in use by another thread, and will resume as soon as the other thread has released the critical section.

See also

Release

Leave the critical section


TCriticalSection.Create

Create a new critical section.

Declaration

Source position: syncobjs.pp line 46

public constructor TCriticalSection.Create;

Description

Create initializes a new critical section, and initializes the system objects for the critical section. It should be created only once for all threads, all threads should use the same critical section instance.

See also

Destroy

Destroy the criticalsection instance


TCriticalSection.Destroy

Destroy the criticalsection instance

Declaration

Source position: syncobjs.pp line 47

public destructor TCriticalSection.Destroy; override;

Description

Destroy releases the system critical section resources, and removes the TCriticalSection instance from memory.

Errors

Any threads trying to enter the critical section when it is destroyed, will start running with an error (an exception should be raised).

See also

Create | Create a new critical section.
Acquire | Enter the critical section


TCriticalSection.Enter

Alias for Acquire

Declaration

Source position: syncobjs.pp line 44

public procedure TCriticalSection.Enter;

Description

Enter just calls Acquire.

See also

Leave | Alias for Release
Acquire | Enter the critical section


TCriticalSection.Leave

Alias for Release

Declaration

Source position: syncobjs.pp line 45

public procedure TCriticalSection.Leave;

Description

Leave just calls Release

See also

Release | Leave the critical section
Enter | Alias for Acquire


TCriticalSection.Release

Leave the critical section

Declaration

Source position: syncobjs.pp line 43

public procedure TCriticalSection.Release; override;

Description

Release leaves the critical section. It will free the critical section so another thread waiting to enter the critical section will be awakened, and will enter the critical section. This call always returns immediatly.

See also

Acquire

Enter the critical section


TEventObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Event propagation object

Declaration

Source position: syncobjs.pp line 60

type TEventObject = class(THandleObject)
public
constructor Create(); | Create a new event object
destructor destroy; override; | Clean up the event and release from memory
procedure ResetEvent; | Reset the event
procedure SetEvent; | Set the event
function WaitFor(); | Wait for the event to be set.
property ManualReset: Boolean; [r] | Should the event be reset manually
end;

Inheritance

TEventObject | Event propagation object
|
THandleObject | Class encapsulating an operating system handle
|
TSynchroObject | Abstract synchronization object
|
TObject

Description

TEventObject encapsulates the BasicEvent implementation of the system unit in a class. The event can be used to notify other threads of a change in conditions. (in POSIX terms, this is a conditional variable). A thread that wishes to notify other threads creates an instance of TEventObject with a certain name, and posts events to it. Other threads that wish to be notified of these events should create their own instances of TEventObject with the same name, and wait for events to arrive.

See also

TCriticalSection

Critical section


TEventObject
 | ro | ManualReset
THandleObject
 | ro | Handle
 | ro | LastError
TSynchroObject


ro | Handle (THandleObject)
ro | LastError (THandleObject)
ro | ManualReset (TEventObject)


TEventObject
 | Create
 | destroy
 | ResetEvent
 | SetEvent
 | WaitFor
THandleObject
 | destroy
TSynchroObject
 | Acquire
 | Release


Acquire (TSynchroObject)

Create (TEventObject)

destroy (THandleObject)

destroy (TEventObject)

Release (TSynchroObject)

ResetEvent (TEventObject)

SetEvent (TEventObject)

WaitFor (TEventObject)


TEventObject

THandleObject

TSynchroObject


TEventObject.Create

Create a new event object

Declaration

Source position: syncobjs.pp line 64

public constructor TEventObject.Create(

  EventAttributes: PSecurityAttributes;

  AManualReset: Boolean;

  InitialState: Boolean;

  const Name: String

);

Arguments

EventAttributes | Security attributes (only used on Windows)
AManualReset | Manual reset allowed
InitialState | Initial event state
Name | Name uniquely identifying the event in this process.

Description

Create creates a new event object with unique name AName. The object will be created security attributes EventAttributes (windows only).

The AManualReset indicates whether the event must be reset manually (if it is False, the event is reset immediatly after the first thread waiting for it is notified). InitialState determines whether the event is initially set or not.

See also

ManualReset | Should the event be reset manually
ResetEvent | Reset the event


TEventObject.destroy

Clean up the event and release from memory

Declaration

Source position: syncobjs.pp line 66

public destructor TEventObject.destroy; override;

Description

Destroy cleans up the low-level resources allocated for this event and releases the event instance from memory.

See also

Create

Create a new event object


TEventObject.ManualReset

Should the event be reset manually

Declaration

Source position: syncobjs.pp line 70

public property TEventObject.ManualReset: Boolean
  read FManualReset;


TEventObject.ResetEvent

Reset the event

Declaration

Source position: syncobjs.pp line 67

public procedure TEventObject.ResetEvent;

Description

ResetEvent turns off the event. Any WaitFor operation will suspend the calling thread.

See also

SetEvent | Set the event
WaitFor | Wait for the event to be set.


TEventObject.SetEvent

Set the event

Declaration

Source position: syncobjs.pp line 68

public procedure TEventObject.SetEvent;

Description

SetEvent sets the event. If the ManualReset is True any thread that was waiting for the event to be set (using WaitFor) will resume it's operation. After the event was set, any thread that executes WaitFor will return at once. If ManualReset is False, only one thread will be notified that the event was set, and the event will be immediatly reset after that.

See also

WaitFor | Wait for the event to be set.
ManualReset | Should the event be reset manually


TEventObject.WaitFor

Wait for the event to be set.

Declaration

Source position: syncobjs.pp line 69

public function TEventObject.WaitFor(

  Timeout: Cardinal

):TWaitResult;

Arguments

Timeout

Maximum time to wait for the event to be set

Function result

Reason for returning

Description

WaitFor should be used in threads that should be notified when the event is set. When WaitFor is called, and the event is not set, the thread will be suspended. As soon as the event is set by some other thread (using SetEvent) or the timeout period (TimeOut) has expired, the WaitFor function returns. The return value depends on the condition that caused the WaitFor function to return.

The calling thread will wait indefinitely when the constant INFINITE is specified for the TimeOut parameter.

See also

TEventObject.SetEvent

Set the event


THandleObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class encapsulating an operating system handle

Declaration

Source position: syncobjs.pp line 50

type THandleObject = class(TSynchroObject)
protected
FHandle: TEventHandle;
FLastError: Integer;
public
destructor destroy; override; | Free the instance
property Handle: TEventHandle; [r] | Handle for this object
property LastError: Integer; [r] | Last operating system error
end;

Inheritance

THandleObject | Class encapsulating an operating system handle
|
TSynchroObject | Abstract synchronization object
|
TObject

Description

THandleObject is a parent class for synchronization classes that need to store an operating system handle. It introduces a property Handle which can be used to store the operating system handle. The handle is in no way manipulated by THandleObject, only storage is provided.

See also

Handle

Handle for this object


THandleObject
 | ro | Handle
 | ro | LastError
TSynchroObject


ro | Handle (THandleObject)
ro | LastError (THandleObject)


THandleObject
 | destroy
TSynchroObject
 | Acquire
 | Release


THandleObject

TSynchroObject


THandleObject.destroy

Free the instance

Declaration

Source position: syncobjs.pp line 55

public destructor THandleObject.destroy; override;

Description

Destroy does nothing in the Free Pascal implementation of THandleObject.


THandleObject.FHandle

Declaration

Source position: syncobjs.pp line 52

protected THandleObject.FHandle: TEventHandle;


THandleObject.FLastError

Declaration

Source position: syncobjs.pp line 53

protected THandleObject.FLastError: Integer;


THandleObject.Handle

Handle for this object

Declaration

Source position: syncobjs.pp line 56

public property THandleObject.Handle: TEventHandle
  read FHandle;

Description

Handle provides read-only access to the operating system handle of this instance. The public access is read-only, descendent classes should set the handle by accessing it's protected field FHandle directly.


THandleObject.LastError

Last operating system error

Declaration

Source position: syncobjs.pp line 57

public property THandleObject.LastError: Integer
  read FLastError;

Description

LastError provides read-only access to the last operating system error code for operations on Handle.

See also

Handle

Handle for this object


TSimpleEvent

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Simple, anonymous event

Declaration

Source position: syncobjs.pp line 75

type TSimpleEvent = class(TEventObject)

  constructor Create;

Creates a new TSimpleEvent instance

end;

Inheritance

TSimpleEvent | Simple, anonymous event
|
TEventObject | Event propagation object
|
THandleObject | Class encapsulating an operating system handle
|
TSynchroObject | Abstract synchronization object
|
TObject

Description

TSimpleEvent is a simple descendent of the TEventObject class. It creates an event with no name, which must be reset manually, and which is initially not set.

See also

TEventObject | Event propagation object
TSimpleEvent.Create | Creates a new TSimpleEvent instance


TSimpleEvent
TEventObject
 | ro | ManualReset
THandleObject
 | ro | Handle
 | ro | LastError
TSynchroObject


TSimpleEvent
 | Create
TEventObject
 | Create
 | destroy
 | ResetEvent
 | SetEvent
 | WaitFor
THandleObject
 | destroy
TSynchroObject
 | Acquire
 | Release


Acquire (TSynchroObject)

Create (TEventObject)

Create (TSimpleEvent)

destroy (THandleObject)

destroy (TEventObject)

Release (TSynchroObject)

ResetEvent (TEventObject)

SetEvent (TEventObject)

WaitFor (TEventObject)


TSimpleEvent

TEventObject

THandleObject

TSynchroObject


TSimpleEvent.Create

Creates a new TSimpleEvent instance

Declaration

Source position: syncobjs.pp line 76

constructor TSimpleEvent.Create;

Description

Create instantiates a new TSimpleEvent instance. It simply calls the inherited Create with Nil for the security attributes, an empty name, AManualReset set to True, and InitialState to False.

See also

TEventObject.Create

Create a new event object


TSynchroObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Abstract synchronization object

Declaration

Source position: syncobjs.pp line 33

type TSynchroObject = class(TObject)
procedure Acquire; virtual; | Acquire synchronization resource
procedure Release; virtual; | Release previously acquired synchronization resource
end;

Inheritance

TSynchroObject

Abstract synchronization object
|

TObject

Description

TSynchroObject is an abstract synchronization resource object. It implements 2 virtual methods Acquire which can be used to acquire the resource, and Release to release the resource.

See also

Acquire | Acquire synchronization resource
Release | Release previously acquired synchronization resource


TSynchroObject


TSynchroObject
 | Acquire
 | Release


TSynchroObject.Acquire

Acquire synchronization resource

Declaration

Source position: syncobjs.pp line 34

procedure TSynchroObject.Acquire; virtual;

Description

Acquire does nothing in TSynchroObject. Descendent classes must override this method to acquire the resource they manage.

See also

Release

Release previously acquired synchronization resource


TSynchroObject.Release

Release previously acquired synchronization resource

Declaration

Source position: syncobjs.pp line 35

procedure TSynchroObject.Release; virtual;

Description

Release does nothing in TSynchroObject. Descendent classes must override this method to release the resource they acquired through the Acquire call.

See also

Acquire

Acquire synchronization resource


Ecompressionerror

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Errors in the TCompressionStream class are signaled with this exception

Declaration

Source position: zstream.pp line 100

type Ecompressionerror = class(Ezliberror) end;

Inheritance

Ecompressionerror | Errors in the TCompressionStream class are signaled with this exception
|
Ezliberror | Base exception for exceptions in the ZStream unit
|
EStreamError
|
TObject

Description

ECompressionError is the exception class used by the TCompressionStream class.


Ecompressionerror

Ezliberror

EStreamError


Edecompressionerror

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Errors in the TDeCompressionStream class are signaled with this exception

Declaration

Source position: zstream.pp line 103

type Edecompressionerror = class(Ezliberror) end;

Inheritance

Edecompressionerror | Errors in the TDeCompressionStream class are signaled with this exception
|
Ezliberror | Base exception for exceptions in the ZStream unit
|
EStreamError
|
TObject

Description

EDecompressionError is the exception class used by the TDeCompressionStream class.


Edecompressionerror

Ezliberror

EStreamError


Egzfileerror

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Exception class used in Tgzfilestream class

Declaration

Source position: zstream.pp line 97

type Egzfileerror = class(Ezliberror) end;

Inheritance

Egzfileerror | Exception class used in Tgzfilestream class
|
Ezliberror | Base exception for exceptions in the ZStream unit
|
EStreamError
|
TObject

Description

Egzfileerror is the exception class used to report errors by the Tgzfilestream class.

See also

Tgzfilestream

Stream to read/write from a gzip file.


Egzfileerror

Ezliberror

EStreamError


Ezliberror

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Base exception for exceptions in the ZStream unit

Declaration

Source position: zstream.pp line 94

type Ezliberror = class(EStreamError) end;

Inheritance

Ezliberror

Base exception for exceptions in the ZStream unit
|

EStreamError
|

TObject

Description

Errors which occur in the zstream unit are signaled by raising an EZLibError exception descendent.


Ezliberror

EStreamError


Tcompressionstream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Write-only stream class which compresses data written to it.

Declaration

Source position: zstream.pp line 55

type Tcompressionstream = class(Tcustomzlibstream)
protected
raw_written: LongInt;
compressed_written: LongInt;
public
constructor create(); | Create a new instance of the compression stream.
destructor destroy; override; | Flushe data to the output stream and destroys the compression stream.
function write(); override; | Write data to the stream
procedure flush; | Flush remaining data to the target stream
function get_compressionrate; | Get the current compression rate
end;

Inheritance

Tcompressionstream | Write-only stream class which compresses data written to it.
|
Tcustomzlibstream | Ancestor for compression and decompression classes
|
TOwnerStream
|
TObject

Description

TCompressionStream

The latest version of this document can be found at lazarus-ccr.sourceforge.net .


Tcompressionstream
Tcustomzlibstream
pt |  | onprogress
TOwnerStream
 | ro | Source
 |  | SourceOwner


pt |  | onprogress (Tcustomzlibstream)
 | ro | Source (TOwnerStream)
 |  | SourceOwner (TOwnerStream)


Tcompressionstream
 | create
 | destroy
 | write
 | flush
 | get_compressionrate
Tcustomzlibstream
pt | progress
 | create
 | destroy
TOwnerStream
 | Create
 | Destroy


 | Create (TOwnerStream)
 | create (Tcustomzlibstream)
 | create (Tcompressionstream)
 | Destroy (TOwnerStream)
 | destroy (Tcustomzlibstream)
 | destroy (Tcompressionstream)
 | flush (Tcompressionstream)
 | get_compressionrate (Tcompressionstream)
pt | progress (Tcustomzlibstream)
 | write (Tcompressionstream)


Tcompressionstream

Tcustomzlibstream

TOwnerStream


Tcompressionstream.compressed_written

Declaration

Source position: zstream.pp line 57

protected Tcompressionstream.compressed_written: LongInt;


Tcompressionstream.create

Create a new instance of the compression stream.

Declaration

Source position: zstream.pp line 59

public constructor Tcompressionstream.create(

  level: Tcompressionlevel;

  dest: TStream;

  Askipheader: Boolean = false

);

Arguments

level | Compression level for compression stream
dest | Output stream to which compressed data is written.
Askipheader | If set, the deflated data block header is not written to stream

Description

Create creates a new instance of the compression stream. It merely calls the inherited constructor with the destination stream Dest and stores the compression level.

If ASkipHeader is set to True, the method will not write the block header to the stream. This is required for deflated data in a zip file.

Note that the compressed data is only completely written after the compression stream is destroyed.

See also

Destroy

Flushe data to the output stream and destroys the compression stream.


Tcompressionstream.destroy

Flushe data to the output stream and destroys the compression stream.

Declaration

Source position: zstream.pp line 62

public destructor Tcompressionstream.destroy; override;

Description

Destroy flushes the output stream: any compressed data not yet written to the output stream are written, and the deflate structures are cleaned up.

Errors

None.

See also

Create

Create a new instance of the compression stream.


Tcompressionstream.flush

Flush remaining data to the target stream

Declaration

Source position: zstream.pp line 64

public procedure Tcompressionstream.flush;

Description

flush writes any remaining data in the memory buffers to the target stream, and clears the memory buffer.


Tcompressionstream.get_compressionrate

Get the current compression rate

Declaration

Source position: zstream.pp line 65

public function Tcompressionstream.get_compressionrate: single;

Function result

Percentage of compression

Description

get_compressionrate returns the percentage of the number of written compressed bytes relative to the number of written bytes.

Errors

If no bytes were written, an exception is raised.


Tcompressionstream.raw_written

Declaration

Source position: zstream.pp line 57

protected Tcompressionstream.raw_written: LongInt;


Tcompressionstream.write

Write data to the stream

Declaration

Source position: zstream.pp line 63

public function Tcompressionstream.write(

  const buffer;

  count: LongInt

):LongInt; override;

Arguments

buffer | Buffer to take data from.
count | Number of bytes to take from the buffer.

Function result

Number of (uncompressed) bytes actually written

Description

Write takes Count bytes from Buffer and comresseses (deflates) them. The compressed result is written to the output stream.

Errors

If an error occurs, an ECompressionError exception is raised.

See also

Read | Overridden to raise an exception.
Seek | Overrides seek to raise an exception.


Tcustomzlibstream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Ancestor for compression and decompression classes

Declaration

Source position: zstream.pp line 43

type Tcustomzlibstream = class(TOwnerStream)
protected
Fstream: z_stream;
Fbuffer: pointer;
Fonprogress: Tnotifyevent;
procedure progress();
property onprogress: Tnotifyevent; [rw]
public
constructor create(); | Create a new instance of TCustomZlibStream
destructor destroy; override; | Clear up instance
end;

Inheritance

Tcustomzlibstream

Ancestor for compression and decompression classes
|

TOwnerStream
|

TObject

Description

TCustomZlibStream serves as the ancestor class for the TCompressionStream and TDeCompressionStream classes.

It introduces support for a progess handler, and stores the input or output stream.


Tcustomzlibstream
pt |  | onprogress
TOwnerStream
 | ro | Source
 |  | SourceOwner


Tcustomzlibstream
pt | progress
 | create
 | destroy
TOwnerStream
 | Create
 | Destroy


 | Create (TOwnerStream)
 | create (Tcustomzlibstream)
 | Destroy (TOwnerStream)
 | destroy (Tcustomzlibstream)
pt | progress (Tcustomzlibstream)


Tcustomzlibstream

TOwnerStream


Tcustomzlibstream.create

Create a new instance of TCustomZlibStream

Declaration

Source position: zstream.pp line 51

public constructor Tcustomzlibstream.create(

  stream: TStream

);

Arguments

stream

Source or target stream

Description

Create creates a new instance of TCustomZlibStream. It stores a reference to the input/output stream, and initializes the deflate compression mechanism so they can be used by the descendents.

See also

TCompressionStream | Write-only stream class which compresses data written to it.
TDecompressionStream | Reads and decompresses data from a compressed data stream.


Tcustomzlibstream.destroy

Clear up instance

Declaration

Source position: zstream.pp line 52

public destructor Tcustomzlibstream.destroy; override;

Description

Destroy cleans up the internal memory buffer and calls the inherited destroy.

See also

Tcustomzlibstream.create

Create a new instance of TCustomZlibStream


Tcustomzlibstream.Fbuffer

Declaration

Source position: zstream.pp line 46

protected Tcustomzlibstream.Fbuffer: pointer;


Tcustomzlibstream.Fonprogress

Declaration

Source position: zstream.pp line 47

protected Tcustomzlibstream.Fonprogress: Tnotifyevent;


Tcustomzlibstream.Fstream

Declaration

Source position: zstream.pp line 45

protected Tcustomzlibstream.Fstream: z_stream;


Tcustomzlibstream.onprogress

Declaration

Source position: zstream.pp line 49

protected property Tcustomzlibstream.onprogress: Tnotifyevent
  read Fonprogress
  write Fonprogress;


Tcustomzlibstream.progress

Declaration

Source position: zstream.pp line 48

protected procedure Tcustomzlibstream.progress(

  sender: Tobject

);


Tdecompressionstream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Reads and decompresses data from a compressed data stream.

Declaration

Source position: zstream.pp line 68

type Tdecompressionstream = class(Tcustomzlibstream)
protected
raw_read: LongInt;
compressed_read: LongInt;
skipheader: Boolean;
procedure reset;
function GetPosition; override;
public
constructor create(); | Creates a new instance of the TDecompressionStream stream
destructor destroy; override; | Destroys the TDecompressionStream instance
function read(); override; | Read data from the compressed stream
function seek(); override; | Move stream position to a certain location in the stream.
function get_compressionrate; | Get the current compression rate
end;

Inheritance

Tdecompressionstream | Reads and decompresses data from a compressed data stream.
|
Tcustomzlibstream | Ancestor for compression and decompression classes
|
TOwnerStream
|
TObject

Description

TDecompressionStream performs the inverse operation of TCompressionStream. A read operation reads data from an input stream and decompresses (inflates) the data it as it goes along.

The decompression stream reads it's compressed data from a stream with deflated data. This data can be created e.g. with a TCompressionStream compression stream.

See also

TCompressionStream

Write-only stream class which compresses data written to it.


Tdecompressionstream
Tcustomzlibstream
pt |  | onprogress
TOwnerStream
 | ro | Source
 |  | SourceOwner


Tdecompressionstream
pt | reset
pt | GetPosition
 | create
 | destroy
 | read
 | seek
 | get_compressionrate
Tcustomzlibstream
pt | progress
 | create
 | destroy
TOwnerStream
 | Create
 | Destroy


 | Create (TOwnerStream)
 | create (Tcustomzlibstream)
 | create (Tdecompressionstream)
 | Destroy (TOwnerStream)
 | destroy (Tcustomzlibstream)
 | destroy (Tdecompressionstream)
pt | GetPosition (Tdecompressionstream)
 | get_compressionrate (Tdecompressionstream)
pt | progress (Tcustomzlibstream)
 | read (Tdecompressionstream)
pt | reset (Tdecompressionstream)
 | seek (Tdecompressionstream)


Tdecompressionstream

Tcustomzlibstream

TOwnerStream


Tdecompressionstream.compressed_read

Declaration

Source position: zstream.pp line 70

protected Tdecompressionstream.compressed_read: LongInt;


Tdecompressionstream.create

Creates a new instance of the TDecompressionStream stream

Declaration

Source position: zstream.pp line 75

public constructor Tdecompressionstream.create(

  Asource: TStream;

  Askipheader: Boolean = false

);

Arguments

Asource | Stream with compressed data
Askipheader | Should the header data be skipped.

Description

Create creates and initializes a new instance of the TDecompressionStream class. It calls the inherited Create and passes it the Source stream. The source stream is the stream from which the compressed (deflated) data is read.

If ASkipHeader is true, then the gzip data header is skipped, allowing TDecompressionStream to read deflated data in a .zip file. (this data does not have the gzip header record prepended to it).

Note that the source stream is by default not owned by the decompression stream, and is not freed when the decompression stream is destroyed.

See also

Destroy

Destroys the TDecompressionStream instance


Tdecompressionstream.destroy

Destroys the TDecompressionStream instance

Declaration

Source position: zstream.pp line 76

public destructor Tdecompressionstream.destroy; override;

Description

Destroy cleans up the inflate structure, and then simply calls the inherited destroy.

By default the source stream is not freed when calling Destroy.

See also

Create

Creates a new instance of the TDecompressionStream stream


Tdecompressionstream.get_compressionrate

Get the current compression rate

Declaration

Source position: zstream.pp line 79

public function Tdecompressionstream.get_compressionrate: single;

Function result

Percentage of compression

Description

get_compressionrate returns the percentage of the number of read compressed bytes relative to the total number of read bytes.

Errors

If no bytes were written, an exception is raised.


Tdecompressionstream.GetPosition

Declaration

Source position: zstream.pp line 73

protected function Tdecompressionstream.GetPosition: Int64; override;


Tdecompressionstream.raw_read

Declaration

Source position: zstream.pp line 70

protected Tdecompressionstream.raw_read: LongInt;


Tdecompressionstream.read

Read data from the compressed stream

Declaration

Source position: zstream.pp line 77

public function Tdecompressionstream.read(

  var buffer;

  count: LongInt

):LongInt; override;

Arguments

buffer | Buffer in which to store the read data
count | Maximum number of bytes to read.

Function result

Number of decompressed bytes that were actually read

Description

Read will read data from the compressed stream until the decompressed data size is Count or there is no more compressed data available. The decompressed data is written in Buffer. The function returns the number of bytes written in the buffer.

Errors

If an error occurs, an EDeCompressionError exception is raised.

See also

Write

Write data to the stream


Tdecompressionstream.reset

Declaration

Source position: zstream.pp line 72

protected procedure Tdecompressionstream.reset;


Tdecompressionstream.seek

Move stream position to a certain location in the stream.

Declaration

Source position: zstream.pp line 78

public function Tdecompressionstream.seek(

  offset: LongInt;

  origin: Word

):LongInt; override;

Arguments

offset | Offset to apply to the position in the stream
origin | Origin from where Offset should be counted.

Function result

New position in the stream

Description

Seek overrides the standard Seek implementation. There are a few differences between the implementation of Seek in Free Pascal compared to Delphi:

  • In Free Pascal, you can perform any seek. In case of a forward seek, the Free Pascal implementation will read some bytes until the desired position is reached, in case of a backward seek it will seek the source stream backwards to the position it had at the creation time of the TDecompressionStream and then again read some bytes until the desired position has been reached.
  • In Free Pascal, a seek with soFromBeginning will reset the source stream to the position it had when the TDecompressionStream was created. In Delphi, the source stream is reset to position 0. This means that at creation time the source stream must always be at the start of the zstream, you cannot use TDecompressionStream.Seek to reset the source stream to the begin of the file.

Errors

An EDecompressionError exception is raised if the stream does not allow the requested seek operation.

See also

Read

Read data from the compressed stream


Tdecompressionstream.skipheader

Declaration

Source position: zstream.pp line 71

protected Tdecompressionstream.skipheader: Boolean;


TGZFileStream

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Stream to read/write from a gzip file.

Declaration

Source position: zstream.pp line 82

type TGZFileStream = class(TStream)
protected
Fgzfile: gzfile;
Ffilemode: Tgzopenmode;
public
constructor create(); | Create a new instance of TGZFileStream
function read(); override; | Read data from the compressed file
function write(); override; | Write data to be compressed
function seek(); override; | Set the position in the compressed stream.
destructor destroy; override; | Removes TGZFileStream instance
end;

Inheritance

TGZFileStream

Stream to read/write from a gzip file.
|

TStream
|

TObject

Description

TGZFileStream can be used to read data from a gzip file, or to write data to a gzip file.

See also

TCompressionStream | Write-only stream class which compresses data written to it.
TDeCompressionStream | Reads and decompresses data from a compressed data stream.


TGZFileStream
TStream
 | Position
 | Size


TGZFileStream
 | create
 | read
 | write
 | seek
 | destroy
TStream
 | GetPosition
 | SetPosition
 | GetSize
 | SetSize64
 | SetSize
 | ReadNotImplemented
 | WriteNotImplemented
 | Read
 | Write
 | Seek
 | ReadBuffer
 | WriteBuffer
 | CopyFrom
 | ReadComponent
 | ReadComponentRes
 | WriteComponent
 | WriteComponentRes
 | WriteDescendent
 | WriteDescendentRes
 | WriteResourceHeader
 | FixupResourceHeader
 | ReadResHeader
 | ReadByte
 | ReadWord
 | ReadDWord
 | ReadAnsiString
 | WriteByte
 | WriteWord
 | WriteDWord
 | WriteAnsiString


CopyFrom (TStream)

create (TGZFileStream)

destroy (TGZFileStream)

FixupResourceHeader (TStream)

GetPosition (TStream)

GetSize (TStream)

Read (TStream)

read (TGZFileStream)

ReadAnsiString (TStream)

ReadBuffer (TStream)

ReadByte (TStream)

ReadComponent (TStream)

ReadComponentRes (TStream)

ReadDWord (TStream)

ReadNotImplemented (TStream)

ReadResHeader (TStream)

ReadWord (TStream)

Seek (TStream)

seek (TGZFileStream)

SetPosition (TStream)

SetSize (TStream)

SetSize64 (TStream)

Write (TStream)

write (TGZFileStream)

WriteAnsiString (TStream)

WriteBuffer (TStream)

WriteByte (TStream)

WriteComponent (TStream)

WriteComponentRes (TStream)

WriteDescendent (TStream)

WriteDescendentRes (TStream)

WriteDWord (TStream)

WriteNotImplemented (TStream)

WriteResourceHeader (TStream)

WriteWord (TStream)


TGZFileStream

TStream


TGZFileStream.create

Create a new instance of TGZFileStream

Declaration

Source position: zstream.pp line 87

public constructor TGZFileStream.create(

  filename: ansistring;

  filemode: Tgzopenmode

);

Arguments

filename | Name of the gzip file
filemode | Open mode for the file.

Description

Create creates a new instance of the TGZFileStream class. It opens FileName for reading or writing, depending on the FileMode parameter. It is not possible to open the file read-write. If the file is opened for reading, it must exist.

If the file is opened for reading, the TGZFileStream.Read method can be used for reading the data in uncompressed form.

If the file is opened for writing, any data written using the TGZFileStream.Write method will be stored in the file in compressed (deflated) form.

Errors

If the file is not found, an EZlibError exception is raised.

See also

Destroy | Removes TGZFileStream instance
TGZOpenMode | Open mode for gzip file.


TGZFileStream.destroy

Removes TGZFileStream instance

Declaration

Source position: zstream.pp line 91

public destructor TGZFileStream.destroy; override;

Description

Destroy closes the file and releases the TGZFileStream instance from memory.

See also

Create

Create a new instance of TGZFileStream


TGZFileStream.Ffilemode

Declaration

Source position: zstream.pp line 85

protected TGZFileStream.Ffilemode: Tgzopenmode;


TGZFileStream.Fgzfile

Declaration

Source position: zstream.pp line 84

protected TGZFileStream.Fgzfile: gzfile;


TGZFileStream.read

Read data from the compressed file

Declaration

Source position: zstream.pp line 88

public function TGZFileStream.read(

  var buffer;

  count: LongInt

):LongInt; override;

Arguments

buffer | Memory buffer to store the data in
count | Number of (uncompressed) bytes to read.

Function result

Number of bytes (uncompressed) actually read

Description

Read overrides the Read method of TStream to read the data from the compressed file. The Buffer parameter indicates where the read data should be stored. The Count parameter specifies the number of bytes (uncompressed) that should be read from the compressed file. Note that it is not possible to read from the stream if it was opened in write mode.

The function returns the number of uncompressed bytes actually read.

Errors

If Buffer points to an invalid location, or does not have enough room for Count bytes, an exception will be raised.

See also

Create | Create a new instance of TGZFileStream
Write | Write data to be compressed
Seek | Set the position in the compressed stream.


TGZFileStream.seek

Set the position in the compressed stream.

Declaration

Source position: zstream.pp line 90

public function TGZFileStream.seek(

  offset: LongInt;

  origin: Word

):LongInt; override;

Arguments

offset | Number of bytes to position on
origin | Where to start positioning

Function result

New position in the stream

Description

Seek sets the position to Offset bytes, starting from Origin. Not all combinations are possible, see TDecompressionStream.Seek for a list of possibilities.

Errors

In case an impossible combination is asked, an EZlibError exception is raised.

See also

TDecompressionStream.Seek

Move stream position to a certain location in the stream.


TGZFileStream.write

Write data to be compressed

Declaration

Source position: zstream.pp line 89

public function TGZFileStream.write(

  const buffer;

  count: LongInt

):LongInt; override;

Arguments

buffer | Memory location containing the data to be written.
count | Number of bytes to write.

Function result

Number of uncompressed bytes written

Description

Write writes Count bytes from Buffer to the compressed file. The data is compressed as it is written, so ideally, less than Count bytes end up in the compressed file. Note that it is not possible to write to the stream if it was opened in read mode.

The function returns the number of (uncompressed) bytes that were actually written.

Errors

In case of an error, an EZlibError exception is raised.

See also

Create | Create a new instance of TGZFileStream
Read | Read data from the compressed file
Seek | Set the position in the compressed stream.


RSHash

Standard hash value calculating function.

Declaration

Source position: contnrs.pp line 479

function RSHash(

  const S: String;

  const TableSize: LongWord

):LongWord;

Arguments

S | String to calculate hash value from
TableSize | Hash table size

Function result

Hash value

Description

RSHash is the standard hash calculating function used in the TFPCustomHashTable hash class. It's Robert Sedgwick's "Algorithms in C" hash function.

Errors

None.

See also

TFPCustomHashTable

Hash class


Application

Application instance

Declaration

Source position: daemonapp.pp line 384

function Application: TCustomDaemonApplication;

Function result

TCustomDaemonApplication instance used by application

Description

Application is the TCustomDaemonApplication instance used by this application. The instance is created at the first invocation of this function, so it is possible to use RegisterDaemonApplicationClass to register an alternative TCustomDaemonApplication class to run the application.

See also

TCustomDaemonApplication | Custom daemon application class
RegisterDaemonApplicationClass | Register alternative TCustomDaemonApplication class.


DaemonError

Raise an EDaemon exception

Declaration

Source position: line 0

procedure DaemonError(

  Msg: String

);

procedure DaemonError(

  Fmt: String;

  Args: array of Const

);

Arguments

Msg

Message for the exception

Arguments

Fmt | Formatting string for exception message
Args | Arguments to format for exception message

Description

DaemonError raises an EDaemon exception with message Msg or it formats the message using Fmt and Args.

See also

EDaemon

Exception used in all daemon application code


RegisterDaemonApplicationClass

Register alternative TCustomDaemonApplication class.

Declaration

Source position: daemonapp.pp line 387

procedure RegisterDaemonApplicationClass(

  AClass: TCustomDaemonApplicationClass

);

Arguments

AClass

New class pointer to be used

Description

RegisterDaemonApplicationClass can be used to register an alternative TCustomDaemonApplication descendent which will be used when creating the global Application instance. Only the last registered class pointer will be used.

See also

TCustomDaemonApplication | Custom daemon application class
Application | Application instance


RegisterDaemonClass

Register daemon

Declaration

Source position: daemonapp.pp line 386

procedure RegisterDaemonClass(

  AClass: TCustomDaemonClass

);

Arguments

AClass

TCustomDaemon descendent class to be registered.

Description

RegisterDaemonClass must be called for each TCustomDaemon descendent that is used in the class: the class pointer and class name are used by the TCustomDaemonMapperClass class to create a TCustomDaemon instance when a daemon is required.

See also

TCustomDaemonMapperClass | Class of TCustomDaemonMapper
TCustomDaemon | Base daemon application class


RegisterDaemonMapper

Register a daemon mapper class

Declaration

Source position: daemonapp.pp line 385

procedure RegisterDaemonMapper(

  AMapperClass: TCustomDaemonMapperClass

);

Arguments

AMapperClass

New TCustomDaemonMapperClass class

Description

RegisterDaemonMapper can be used to register an alternative class for the global daemonmapper. The daemonmapper will be used only when the application is being run, by the TCustomDaemonApplication code, so registering an alternative mapping class should happen in the initialization section of the application units.

See also

TCustomDaemonApplication | Custom daemon application class
TCustomDaemonMapperClass | Class of TCustomDaemonMapper


GetDebuggingEnabled

Check if sending of debug messages is enabled.

Declaration

Source position: dbugintf.pp line 38

function GetDebuggingEnabled: Boolean;

Function result

True if sending debug messages is currently enabled.

Description

GetDebuggingEnabled returns the value set by the last call to SetDebuggingEnabled. It is True by default.

See also

SetDebuggingEnabled | Temporary enables or disables debugging
SendDebug | Send a message to the debug server.


InitDebugClient

Initialize the debug client.

Declaration

Source position: dbugintf.pp line 43

function InitDebugClient: Boolean;

Function result

True if the client was successfully started.

Description

InitDebugClient starts the debug server and then performs all necessary initialization of the debug IPC communication channel.

Normally this function should not be called. The SendDebug call will initialize the debug client when it is first called.

Errors

None.

See also

SendDebug | Send a message to the debug server.
StartDebugServer | Start the debug server


SendBoolean

Send the value of a boolean variable

Declaration

Source position: dbugintf.pp line 25

procedure SendBoolean(

  const Identifier: String;

  const Value: Boolean

);

Arguments

Identifier | Name of the boolean variable
Value | Value of the boolean variable.

Description

SendBoolean is a simple wrapper around SendDebug which sends the name and value of a boolean value as an informational message.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendDateTime | Send the value of a TDateTime variable.
SendInteger | Send the value of an integer variable.
SendPointer | Send the value of a pointer variable.


SendDateTime

Send the value of a TDateTime variable.

Declaration

Source position: dbugintf.pp line 26

procedure SendDateTime(

  const Identifier: String;

  const Value: TDateTime

);

Arguments

Identifier | Name of the TDateTime variable
Value | The actual date/time

Description

SendDateTime is a simple wrapper around SendDebug which sends the name and value of an integer value as an informational message. The value is converted to a string using the DateTimeToStr call.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendBoolean | Send the value of a boolean variable
SendInteger | Send the value of an integer variable.
SendPointer | Send the value of a pointer variable.


SendDebug

Send a message to the debug server.

Declaration

Source position: dbugintf.pp line 30

procedure SendDebug(

  const Msg: String

);

Arguments

Msg

The message to be sent to the server.

Description

SendDebug sends the message Msg to the debug server as an informational message (debug level dlInformation). If no debug server is running, then an attempt will be made to start the server first.

The binary that is started is called debugserver and should be somewhere on the PATH. A sample binary which writes received messages to standard output is included in the FCL, it is called dbugsrv. This binary can be renamed to debugserver or can be started before the program is started.

Errors

Errors are silently ignored, any exception messages are stored in SendError.

See also

SendDebugEx | Send debug message other than informational messages
SendDebugFmt | Format and send a debug message
SendDebugFmtEx | Format and send message with alternate type


SendDebugEx

Send debug message other than informational messages

Declaration

Source position: dbugintf.pp line 29

procedure SendDebugEx(

  const Msg: String;

  MType: TDebugLevel

);

Arguments

Msg | Message to be sent
MType | Debug level of the message to be sent

Description

SendDebugEx allows to specify the debug level of the message to be sent in MType. By default, SendDebug uses informational messages.

Other than that the function of SendDebugEx is equal to that of SendDebug

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendDebugFmt | Format and send a debug message
SendDebugFmtEx | Format and send message with alternate type


SendDebugFmt

Format and send a debug message

Declaration

Source position: dbugintf.pp line 34

procedure SendDebugFmt(

  const Msg: String;

  const Args: array of Const

);

Arguments

Msg | Template for message
Args | Arguments to be inserted in template

Description

SendDebugFmt is a utility routine which formats a message by passing Msg and Args to Format and sends the result to the debug server using SendDebug. It exists mainly to avoid the Format call in calling code.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendDebugEx | Send debug message other than informational messages
SendDebugFmtEx | Format and send message with alternate type
#rtl.sysutils.format


SendDebugFmtEx

Format and send message with alternate type

Declaration

Source position: dbugintf.pp line 35

procedure SendDebugFmtEx(

  const Msg: String;

  const Args: array of Const;

  MType: TDebugLevel

);

Arguments

Msg | Message template
Args | Arguments to insert in template
MType | Debug level of message

Description

SendDebugFmtEx is a utility routine which formats a message by passing Msg and Args to Format and sends the result to the debug server using SendDebugEx with Debug level MType. It exists mainly to avoid the Format call in calling code.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendDebugEx | Send debug message other than informational messages
SendDebugFmt | Format and send a debug message
#rtl.sysutils.format


SendInteger

Send the value of an integer variable.

Declaration

Source position: dbugintf.pp line 27

procedure SendInteger(

  const Identifier: String;

  const Value: Integer;

  HexNotation: Boolean = false

);

Arguments

Identifier | Name of the integer variable
Value | The actual value
HexNotation | Format integer using hexadecimal notation

Description

SendInteger is a simple wrapper around SendDebug which sends the name and value of an integer value as an informational message. If HexNotation is True, then the value will be displayed using hexadecimal notation.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendBoolean | Send the value of a boolean variable
SendDateTime | Send the value of a TDateTime variable.
SendPointer | Send the value of a pointer variable.


SendMethodEnter

Send method enter message

Declaration

Source position: dbugintf.pp line 31

procedure SendMethodEnter(

  const MethodName: String

);

Arguments

MethodName

Name of the entered method

Description

SendMethodEnter sends a "Entering MethodName" message to the debug server. After that it increases the message indentation (currently 2 characters). By sending a corresponding SendMethodExit, the indentation of messages can be decreased again.

By using the SendMethodEnter and SendMethodExit methods at the beginning and end of a procedure/method, it is possible to visually trace program execution.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendMethodExit | Send method exit message
SendSeparator | Send a separator message


SendMethodExit

Send method exit message

Declaration

Source position: dbugintf.pp line 32

procedure SendMethodExit(

  const MethodName: String

);

Arguments

MethodName

Name of the method that is entered

Description

SendMethodExit sends a "Exiting MethodName" message to the debug server. After that it decreases the message indentation (currently 2 characters). By sending a corresponding SendMethodEnter, the indentation of messages can be increased again.

By using the SendMethodEnter and SendMethodExit methods at the beginning and end of a procedure/method, it is possible to visually trace program execution.

Note that the indentation level will not be made negative.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendMethodEnter | Send method enter message
SendSeparator | Send a separator message


SendPointer

Send the value of a pointer variable.

Declaration

Source position: dbugintf.pp line 28

procedure SendPointer(

  const Identifier: String;

  const Value: Pointer

);

Arguments

Identifier | Name of the pointer variable
Value | The actual pointer value

Description

SendInteger is a simple wrapper around SendDebug which sends the name and value of a pointer value as an informational message. The pointer value is displayed using hexadecimal notation.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendBoolean | Send the value of a boolean variable
SendDateTime | Send the value of a TDateTime variable.
SendInteger | Send the value of an integer variable.


SendSeparator

Send a separator message

Declaration

Source position: dbugintf.pp line 33

procedure SendSeparator;

Description

SendSeparator is a simple wrapper around SendDebug which sends a short horizontal line to the debug server. It can be used to visually separate execution of blocks of code or blocks of values.

Errors

None.

See also

SendDebug | Send a message to the debug server.
SendMethodEnter | Send method enter message
SendMethodExit | Send method exit message


SetDebuggingEnabled

Temporary enables or disables debugging

Declaration

Source position: dbugintf.pp line 37

procedure SetDebuggingEnabled(

  const AValue: Boolean

);

Arguments

AValue

Should sending of debug messages be enabled or not

Description

SetDebuggingEnabled can be used to temporarily enable or disable sending of debug messages: this allows to control the amount of messages sent to the debug server without having to remove the SendDebug statements. By default, debugging is enabled. If set to false, debug messages are simply discarded till debugging is enabled again.

A value of True enables sending of debug messages. A value of False disables sending.

Errors

None.

See also

GetDebuggingEnabled | Check if sending of debug messages is enabled.
SendDebug | Send a message to the debug server.


StartDebugServer

Start the debug server

Declaration

Source position: dbugintf.pp line 42

function StartDebugServer: Integer;

Function result

True if started succesfully, false otherwise

Description

StartDebugServer attempts to start the debug server. The process started is called debugserver and should be located in the PATH.

Normally this function should not be called. The SendDebug call will attempt to start the server by itself if it is not yet running.

Errors

On error, False is returned.

See also

SendDebug | Send a message to the debug server.
InitDebugClient | Initialize the debug client.


DebugMessageName

Return the name of the debug message

Declaration

Source position: dbugmsg.pp line 42

function DebugMessageName(

  msgType: Integer

):String;

Arguments

msgType

Message type

Function result

String describing the message type

Description

DebugMessageName returns the name of the message type. It can be used to examine the MsgType field of a TDebugMessage record, and if msgType contains a known type, it returns a string describing this type.

Errors

If MsgType contains an unknown type, 'Unknown' is returned.


ReadDebugMessageFromStream

Read a message from stream

Declaration

Source position: dbugmsg.pp line 40

procedure ReadDebugMessageFromStream(

  AStream: TStream;

  var Msg: TDebugMessage

);

Arguments

AStream | Stream from which record is read
Msg | Record to be read from stream

Description

ReadDebugMessageFromStream reads a TDebugMessage record (Msg) from the stream AStream.

The record is not read in a byte-ordering safe way, i.e. it cannot be exchanged between little- and big-endian systems.

Errors

If the stream contains not enough bytes or is malformed, then an exception may be raised.

See also

TDebugMessage | Structure describing a message
WriteDebugMessageToStream | Write a message to stream


WriteDebugMessageToStream

Write a message to stream

Declaration

Source position: dbugmsg.pp line 41

procedure WriteDebugMessageToStream(

  AStream: TStream;

  const Msg: TDebugMessage

);

Arguments

AStream | Stream to write message to
Msg | Message record to be written

Description

WriteDebugMessageFromStream writes a TDebugMessage record (Msg) to the stream AStream.

The record is not written in a byte-ordering safe way, i.e. it cannot be exchanged between little- and big-endian systems.

Errors

A stream write error may occur if the stream cannot be written to.

See also

TDebugMessage

Structure describing a message

ReadDebugMessageToStream


DecRect

Declaration

Source position: line 0

procedure DecRect(

  var rect: TRect;

  delta: Integer

);

procedure DecRect(

  var rect: TRect

);


IncRect

Declaration

Source position: line 0

procedure IncRect(

  var rect: TRect;

  delta: Integer

);

procedure IncRect(

  var rect: TRect

);


CalculateGray

Declaration

Source position: fpimage.pp line 258

function CalculateGray(

  const From: TFPColor

):Word;


CompareColors

Declaration

Source position: fpimage.pp line 275

function CompareColors(

  const Color1: TFPColor;

  const Color2: TFPColor

):Integer;


CreateBlackAndWhitePalette

Declaration

Source position: fpimage.pp line 336

function CreateBlackAndWhitePalette: TFPPalette;


CreateGrayScalePalette

Declaration

Source position: fpimage.pp line 338

function CreateGrayScalePalette: TFPPalette;


CreateVGAPalette

Declaration

Source position: fpimage.pp line 339

function CreateVGAPalette: TFPPalette;


CreateWebSafePalette

Declaration

Source position: fpimage.pp line 337

function CreateWebSafePalette: TFPPalette;


FPColor

Declaration

Source position: line 0

function FPColor(

  r: Word;

  g: Word;

  b: Word;

  a: Word

):TFPColor;

function FPColor(

  r: Word;

  g: Word;

  b: Word

):TFPColor;


operator =(TFPColor, TFPColor): Boolean

Declaration

Source position: fpimage.pp line 271

function operator =(TFPColor, TFPColor): Boolean(

  const c: TFPColor;

  const d: TFPColor

):Boolean;


operator and(TFPColor, TFPColor): TFPColor

Declaration

Source position: fpimage.pp line 273

function operator and(TFPColor, TFPColor): TFPColor(

  const c: TFPColor;

  const d: TFPColor

):TFPColor;


operator or(TFPColor, TFPColor): TFPColor

Declaration

Source position: fpimage.pp line 272

function operator or(TFPColor, TFPColor): TFPColor(

  const c: TFPColor;

  const d: TFPColor

):TFPColor;


operator xor(TFPColor, TFPColor): TFPColor

Declaration

Source position: fpimage.pp line 274

function operator xor(TFPColor, TFPColor): TFPColor(

  const c: TFPColor;

  const d: TFPColor

):TFPColor;


GetLanguageIDs

Return the current language IDs

Declaration

Source position: gettext.pp line 73

procedure GetLanguageIDs(

  var Lang: String;

  var FallbackLang: String

);

Arguments

Lang | Primary language
FallbackLang | Secondary language

Description

GetLanguageIDs returns the current language IDs (an ISO string) as returned by the operating system. On windows, the GetUserDefaultLCID and GetLocaleInfo calls are used. On other operating systems, the LC_ALL, LC_MESSAGES or LANG environment variables are examined.


TranslateResourceStrings

Translate the resource strings of the application.

Declaration

Source position: line 0

procedure TranslateResourceStrings(

  AFile: TMOFile

);

procedure TranslateResourceStrings(

  const AFilename: String

);

Arguments

AFile

TMOfile instance with translated strings.

Arguments

AFilename

Name of .mo file with translated strings

Description

TranslateResourceStrings translates all the resource strings in the application based on the values in the .mo file AFileName or AFile. The procedure creates an TMOFile instance to read the .mo file if a filename is given.

Errors

If the file does not exist or is an invalid .mo file.

See also

TranslateUnitResourceStrings | Translate the resource strings of a unit.
TMOFile | Class providing access to a .mo file.


TranslateUnitResourceStrings

Translate the resource strings of a unit.

Declaration

Source position: line 0

procedure TranslateUnitResourceStrings(

  const AUnitName: String;

  AFile: TMOFile

);

procedure TranslateUnitResourceStrings(

  const AUnitName: String;

  const AFilename: String

);

Arguments

AUnitName | Name of the unit whose strings should be translated.
AFile | TMOFile instance with translated strings.

Arguments

AUnitName | Name of the unit whose strings should be translated.
AFilename | Name of .mo file with translated strings

Description

TranslateUnitResourceStrings is identical in function to TranslateResourceStrings, but translates the strings of a single unit (AUnitName) which was used to compile the application. This can be more convenient, since the resource string files are created on a unit basis.

See also

TranslateResourceStrings | Translate the resource strings of the application.
TMOFile | Class providing access to a .mo file.


CipherIdea

Encrypt or decrypt a buffer.

Declaration

Source position: idea.pp line 69

procedure CipherIdea(

  Input: TIdeaCryptData;

  var outdata: TIdeaCryptData;

  z: TIDEAKey

);

Arguments

Input | Data to be encrypted/decrypted
outdata | Decrypted/Encrypted data
z | Key to use for Encryption/Decryption

Description

CipherIdea encrypts or decrypts a buffer with data (Input) using key z. The resulting encrypted or decrypted data is returned in Output.

Errors

None.

See also

EnKeyIdea | Create an IDEA encryption key from a user key.
DeKeyIdea | Create a decryption key from an encryption key.
TIDEAEncryptStream | IDEA encryption stream.
TIDEADecryptStream | IDEA Decryption stream.


DeKeyIdea

Create a decryption key from an encryption key.

Declaration

Source position: idea.pp line 68

procedure DeKeyIdea(

  z: TIDEAKey;

  var dk: TIDEAKey

);

Arguments

z | Encryption key
dk | Key for decryption

Description

DeKeyIdea creates a decryption key based on the encryption key z. The decryption key is returned in dk. Note that only a decryption key generated from the encryption key that was used to encrypt the data can be used to decrypt the data.

Errors

None.

See also

EnKeyIdea | Create an IDEA encryption key from a user key.
CipherIdea | Encrypt or decrypt a buffer.


EnKeyIdea

Create an IDEA encryption key from a user key.

Declaration

Source position: idea.pp line 67

procedure EnKeyIdea(

  UserKey: TIdeaCryptKey;

  var z: TIDEAKey

);

Arguments

UserKey | User-supplied data to generate key from
z | 64-bit Encryption key.

Description

EnKeyIdea creates an IDEA encryption key from user-supplied data in UserKey. The Encryption key is stored in z.

Errors

None.

See also

DeKeyIdea | Create a decryption key from an encryption key.
CipherIdea | Encrypt or decrypt a buffer.


ClearDirRec

Initialize tar archive entry

Declaration

Source position: libtar.pp line 227

procedure ClearDirRec(

  var DirRec: TTarDirRec

);

Arguments

DirRec

Record to clear.

Description

ClearDirRec clears the DirRec entry, it basically zeroes out all fields.

See also

TTarDirRec

Tar Directory entry


ConvertFilename

Convert filename to archive format

Declaration

Source position: libtar.pp line 224

function ConvertFilename(

  Filename: String

):String;

Arguments

Filename

Filename to correct

Function result

Corrected filename in archive format

Description

ConvertFileName converts the file name FileName to a format allowed by the tar archive. Basically, it converts directory specifiers to forward slashes.


FileTimeGMT

Extract filetime

Declaration

Source position: line 0

function FileTimeGMT(

  FileName: String

):TDateTime; overload;

function FileTimeGMT(

  SearchRec: TSearchRec

):TDateTime; overload;

Arguments

FileName

Name of file to examine

Function result

File time in GMT notation

Arguments

SearchRec

Searchrec from which timestamp is taken

Function result

File time in GMT notation

Description

FileTimeGMT returns the timestamp of a filename (FileName must exist) or a search rec (TSearchRec) to a GMT representation that can be used in a tar entry.

See also

TTarDirRec

Tar Directory entry


PermissionString

Convert a set of permissions to a string

Declaration

Source position: libtar.pp line 223

function PermissionString(

  Permissions: TTarPermissions

):String;

Arguments

Permissions

Set of permissions

Function result

String representation of Permissions

Description

PermissionString can be used to convert a set of Permissions to a string in the same format as used by the unix 'ls' command.

See also

TTarPermissions

Complete set of permissions for file


CreatePipeHandles

Function to create a set of pipe handles

Declaration

Source position: pipes.pp line 48

function CreatePipeHandles(

  var Inhandle: THandle;

  var OutHandle: THandle

):Boolean;

Arguments

Inhandle | File handle for reading end of the pipe
OutHandle | File handle for writing end of the pipe

Function result

True if the call was succesul, False if not.

Description

CreatePipeHandles provides an OS-independent way to create a set of pipe filehandles. These handles are inheritable to child processes. The reading end of the pipe is returned in InHandle, the writing end in OutHandle.

Errors

On error, False is returned.

See also

CreatePipeStreams

Create a pair of pipe stream.


CreatePipeStreams

Create a pair of pipe stream.

Declaration

Source position: pipes.pp line 49

procedure CreatePipeStreams(

  var InPipe: TInputPipeStream;

  var OutPipe: TOutputPipeStream

);

Arguments

InPipe | Contains the read end of the pipe on return
OutPipe | Contains the write end of the pipe on return.

Description

CreatePipeStreams creates a set of pipe file descriptors with CreatePipeHandles, and if that call is succesfull, a pair of streams is created: InPipe and OutPipe.

Errors

If no pipe handles could be created, an EPipeCreation exception is raised.

See also

CreatePipeHandles | Function to create a set of pipe handles
TInputPipeStream | TStream descendent which wraps the read end of a pipe.
TOutputPipeStream | TStream descendent which wraps the write end of a pipe.


CreateStoredItem

Concatenates component and property name

Declaration

Source position: rttiutils.pp line 127

function CreateStoredItem(

  const CompName: String;

  const PropName: String

):String;

Arguments

CompName | Component name
PropName | Property name

Function result

Full property path

Description

CreateStoredItem concatenates CompName and PropName if they are both empty. The names are separated by a dot (.) character. If either of the names is empty, an empty string is returned.

This function can be used to create items for the list of properties such as used in UpdateStoredList, TPropsStorage.StoreObjectsProps or TPropsStorage.LoadObjectsProps.

See also

ParseStoredItem | Split a property reference to component reference and property name
UpdateStoredList | Update a stringlist with object references
TPropsStorage.StoreObjectsProps | Store a list of component properties
TPropsStorage.LoadObjectsProps | Load a list of component properties


ParseStoredItem

Split a property reference to component reference and property name

Declaration

Source position: rttiutils.pp line 128

function ParseStoredItem(

  const Item: String;

  var CompName: String;

  var PropName: String

):Boolean;

Arguments

Item | Property reference to parse
CompName | Component part of property reference.
PropName | Property name part of property reference.

Function result

True if Item contains a valid property reference

Description

ParseStoredItem parses the property reference Item and splits it in a reference to a component (returned in CompName) and a name of a property (returned in PropName). This function basically does the opposite of CreateStoredItem. Note that both names should be non-empty, i.e., at least 1 dot character must appear in Item.

Errors

If an error occurred during parsing, False is returned.

See also

CreateStoredItem | Concatenates component and property name
UpdateStoredList | Update a stringlist with object references
TPropsStorage.StoreObjectsProps | Store a list of component properties
TPropsStorage.LoadObjectsProps | Load a list of component properties


UpdateStoredList

Update a stringlist with object references

Declaration

Source position: rttiutils.pp line 126

procedure UpdateStoredList(

  AComponent: TComponent;

  AStoredList: TStrings;

  FromForm: Boolean

);

Arguments

AComponent | Root component
AStoredList | List of property references to resolve
FromForm | Start search from form or search globally

Description

UpdateStoredList will parse the strings in AStoredList using ParseStoredItem and will replace the Objects properties with the instance of the object whose name each property path in the list refers to. If FromForm is True, then all instances are searched relative to AComponent, i.e. they must be owned by AComponent. If FromForm is False the instances are searched in the global list of streamed components. (the FindGlobalComponentCallBack callback must be set for the search to work correctly in this case)

If a component cannot be found, the reference string to the property is removed from the stringlist.

Errors

If AComponent is Nil, an exception may be raised.

See also

ParseStoredItem | Split a property reference to component reference and property name
TPropsStorage.StoreObjectsProps | Store a list of component properties
TPropsStorage.LoadObjectsProps | Load a list of component properties
FindGlobalComponentCallBack | Callback used when component references must be resolved.


ColReadBoolean

Read a boolean value from a stream

Declaration

Source position: streamcoll.pp line 76

function ColReadBoolean(

  S: TStream

):Boolean;

Arguments

S

Stream to read boolean value from

Function result

Boolean value read from the stream

Description

ColReadBoolean reads a boolean from the stream S as it was written by ColWriteBoolean and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColWriteBoolean | Write a boolean to a stream
ColReadString | Read a string from a stream
ColReadInteger | Read a 32-bit integer from a stream.
ColReadFloat | Read a floating point value from a stream
ColReadCurrency | Read a currency value from the stream


ColReadCurrency

Read a currency value from the stream

Declaration

Source position: streamcoll.pp line 78

function ColReadCurrency(

  S: TStream

):Currency;

Arguments

S

Stream to read currency value from

Function result

Currency value read from the stream

Description

ColReadCurrency reads a currency value from the stream S as it was written by ColWriteCurrency and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColReadBoolean | Read a boolean value from a stream
ColReadString | Read a string from a stream
ColReadInteger | Read a 32-bit integer from a stream.
ColReadFloat | Read a floating point value from a stream
ColWriteCurrency | Write a currency value to stream


ColReadDateTime

Read a TDateTime value from a stream

Declaration

Source position: streamcoll.pp line 79

function ColReadDateTime(

  S: TStream

):TDateTime;

Arguments

S

Stream to read TDateTime value from

Function result

TDateTime value read from the stream

Description

ColReadDateTime reads a currency value from the stream S as it was written by ColWriteDateTime and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColWriteDateTime | Write a TDateTime value to stream
ColReadBoolean | Read a boolean value from a stream
ColReadString | Read a string from a stream
ColReadInteger | Read a 32-bit integer from a stream.
ColReadFloat | Read a floating point value from a stream
ColReadCurrency | Read a currency value from the stream


ColReadFloat

Read a floating point value from a stream

Declaration

Source position: streamcoll.pp line 80

function ColReadFloat(

  S: TStream

):Double;

Arguments

S

Stream to read float value from.

Function result

Float value read from the stream

Description

ColReadFloat reads a double value from the stream S as it was written by ColWriteFloat and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColReadBoolean | Read a boolean value from a stream
ColReadString | Read a string from a stream
ColReadInteger | Read a 32-bit integer from a stream.
ColWriteFloat | Write floating point value to stream
ColReadCurrency | Read a currency value from the stream


ColReadInteger

Read a 32-bit integer from a stream.

Declaration

Source position: streamcoll.pp line 75

function ColReadInteger(

  S: TStream

):Integer;

Arguments

S

Stream to read integer value from

Function result

Integer value read from stream S

Description

ColReadInteger reads a 32-bit integer from the stream S as it was written by ColWriteInteger and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColReadBoolean | Read a boolean value from a stream
ColReadString | Read a string from a stream
ColWriteInteger | Write a 32-bit integer to a stream
ColReadFloat | Read a floating point value from a stream
ColReadCurrency | Read a currency value from the stream


ColReadString

Read a string from a stream

Declaration

Source position: streamcoll.pp line 77

function ColReadString(

  S: TStream

):String;

Arguments

S

Stream to read string value from

Function result

String value read from the stream

Description

ColReadStream reads a string value from the stream S as it was written by ColWriteString and returns the read value. The value cannot be read and written across systems that have different endian values.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColReadBoolean | Read a boolean value from a stream
ColWriteString | Write a string value to the stream
ColReadInteger | Read a 32-bit integer from a stream.
ColReadFloat | Read a floating point value from a stream
ColReadCurrency | Read a currency value from the stream


ColWriteBoolean

Write a boolean to a stream

Declaration

Source position: streamcoll.pp line 70

procedure ColWriteBoolean(

  S: TStream;

  AValue: Boolean

);

Arguments

S | Stream to write value to
AValue | Boolean value to write to stream

Description

ColWriteBoolean writes the boolean AValue to the stream. S.

See also

ColReadBoolean | Read a boolean value from a stream
ColWriteString | Write a string value to the stream
ColWriteInteger | Write a 32-bit integer to a stream
ColWriteCurrency | Write a currency value to stream
ColWriteDateTime | Write a TDateTime value to stream
ColWriteFloat | Write floating point value to stream


ColWriteCurrency

Write a currency value to stream

Declaration

Source position: streamcoll.pp line 72

procedure ColWriteCurrency(

  S: TStream;

  AValue: Currency

);

Arguments

S | Stream to write currency to
AValue | Currency value to write to stream

Description

ColWriteCurrency writes the currency AValue to the stream S.

See also

ColWriteBoolean | Write a boolean to a stream
ColWriteString | Write a string value to the stream
ColWriteInteger | Write a 32-bit integer to a stream
ColWriteDateTime | Write a TDateTime value to stream
ColWriteFloat | Write floating point value to stream
ColReadCurrency | Read a currency value from the stream


ColWriteDateTime

Write a TDateTime value to stream

Declaration

Source position: streamcoll.pp line 73

procedure ColWriteDateTime(

  S: TStream;

  AValue: TDateTime

);

Arguments

S | Stream to write datetime value to
AValue | DateTime value to write to stream

Description

ColWriteDateTime writes the TDateTimeAValue to the stream S.

See also

ColReadDateTime | Read a TDateTime value from a stream
ColWriteBoolean | Write a boolean to a stream
ColWriteString | Write a string value to the stream
ColWriteInteger | Write a 32-bit integer to a stream
ColWriteFloat | Write floating point value to stream
ColWriteCurrency | Write a currency value to stream


ColWriteFloat

Write floating point value to stream

Declaration

Source position: streamcoll.pp line 74

procedure ColWriteFloat(

  S: TStream;

  AValue: Double

);

Arguments

S | Stream to write float value to
AValue | Double value to write to the stream

Description

ColWriteFloat writes the double AValue to the stream S.

See also

ColWriteDateTime | Write a TDateTime value to stream
ColWriteBoolean | Write a boolean to a stream
ColWriteString | Write a string value to the stream
ColWriteInteger | Write a 32-bit integer to a stream
ColReadFloat | Read a floating point value from a stream
ColWriteCurrency | Write a currency value to stream


ColWriteInteger

Write a 32-bit integer to a stream

Declaration

Source position: streamcoll.pp line 69

procedure ColWriteInteger(

  S: TStream;

  AValue: Integer

);

Arguments

S | Stream to write integer to
AValue | Integer value to write to stream

Description

ColWriteInteger writes the 32-bit integer AValue to the stream S. No endianness is observed.

See also

ColWriteBoolean | Write a boolean to a stream
ColWriteString | Write a string value to the stream
ColReadInteger | Read a 32-bit integer from a stream.
ColWriteCurrency | Write a currency value to stream
ColWriteDateTime | Write a TDateTime value to stream


ColWriteString

Write a string value to the stream

Declaration

Source position: streamcoll.pp line 71

procedure ColWriteString(

  S: TStream;

  AValue: String

);

Arguments

S | Stream to write string value to
AValue | String value to write to stream

Description

ColWriteString writes the string value AValue to the stream S.

See also

ColWriteBoolean | Write a boolean to a stream
ColReadString | Read a string from a stream
ColWriteInteger | Write a 32-bit integer to a stream
ColWriteCurrency | Write a currency value to stream
ColWriteDateTime | Write a TDateTime value to stream
ColWriteFloat | Write floating point value to stream


AssignStream

Assign a text file to a stream.

Declaration

Source position: streamio.pp line 25

procedure AssignStream(

  var F: Textfile;

  Stream: TStream

);

Arguments

F | The file one wishes to reroute through a stream.
Stream | The stream that should perform the actual I/O.

Description

AssignStream assigns the stream Stream to file F. The file can subsequently be used to write to the stream, using the standard Write calls.

Before writing, call Rewrite on the stream. Before reading, call Reset.

Errors

if Stream is Nil, an exception will be raised.

See also

TStream

GetStream

Return the stream, associated with a file.


GetStream

Return the stream, associated with a file.

Declaration

Source position: streamio.pp line 26

function GetStream(

  var F: TTextRec

):TStream;

Arguments

F

The file one wishes to get the stream from.

Function result

The stream assigned to the fle.

Description

GetStream returns the instance of the stream that was associated with the file F using AssignStream.

Errors

An invalid class reference will be returned if the file was not associated with a stream.

See also

AssignStream

Assign a text file to a stream.

TStream


EncodeURI

Form a string representation of the URI

Declaration

Source position: uriparser.pp line 39

function EncodeURI(

  const URI: TURI

):String;

Arguments

URI

The URI record to encode

Function result

The text representation of the URI

Description

EncodeURI will return a valid text representation of the URI in the URI record.

See also

ParseURI

Parse a URI and split it into its constituent parts


FilenameToURI

Construct a URI from a filename

Declaration

Source position: uriparser.pp line 50

function FilenameToURI(

  const Filename: String

):String;

Arguments

Filename

Filename to construct URI from

Function result

file: protocol URI

Description

FilenameToURI takes Filename and constructs a file: protocol URI from it.

Errors

None.

See also

URIToFilename

Convert a URI to a filename


IsAbsoluteURI

Check whether a URI is absolute.

Declaration

Source position: uriparser.pp line 52

function IsAbsoluteURI(

  const UriReference: String

):Boolean;

Arguments

UriReference

URI to analyse

Function result

True if UriReference is absolute.

Description

IsAbsoluteURI returns True if the URI in UriReference is absolute, i.e. contains a protocol part.

Errors

None.

See also

FilenameToURI | Construct a URI from a filename
URIToFileName | Convert a URI to a filename


ParseURI

Parse a URI and split it into its constituent parts

Declaration

Source position: line 0

function ParseURI(

  const URI: String

):TURI; overload;

function ParseURI(

  const URI: String;

  const DefaultProtocol: String;

  DefaultPort: Word

):TURI; overload;

Arguments

URI

URI to decode

Function result

Record with the URI split out in parts.

Arguments

URI | URI to decode
DefaultProtocol | Default protocol to use if none is specified.
DefaultPort | Default port to use if none is specified.

Function result

Record with the URI split out in parts.

Description

ParseURI decodes URI and returns the various parts of the URI in the result record.

The function accepts the most general URI scheme:

proto://user:pwd@host:port/path/document?params#bookmark

Missing (optional) parts in the URI will be left blank in the result record. If a default protocol and port are specified, they will be used in the record if the corresponding part is not present in the URI.

See also

EncodeURI

Form a string representation of the URI


ResolveRelativeURI

Return a relative link

Declaration

Source position: line 0

function ResolveRelativeURI(

  const BaseUri: WideString;

  const RelUri: WideString;

  out ResultUri: WideString

):Boolean; overload;

function ResolveRelativeURI(

  const BaseUri: UTF8String;

  const RelUri: UTF8String;

  out ResultUri: UTF8String

):Boolean; overload;

Arguments

BaseUri | Base URI
RelUri | URI relative to BaseURI or absolute URI.
ResultUri | Resulting absolute URI

Function result

True if the operation was succesful, False if not.

Arguments

BaseUri | Base URI
RelUri | URI relative to BaseURI or absolute URI.
ResultUri | Resulting absolute URI

Function result

True if the operation was succesful, False if not.

Description

ResolveRelativeURI returns in ResultUri an absolute link constructed from a base URI BaseURI and a relative link RelURI. One of the two URI names must have a protocol specified. If the RelURI argument contains a protocol, it is considered a complete (absolute) URI and is returned as the result.

The function returns True if a link was succesfully returned.

Errors

If no protocols are specified, the function returns False


URIToFilename

Convert a URI to a filename

Declaration

Source position: uriparser.pp line 49

function URIToFilename(

  const URI: String;

  out Filename: String

):Boolean;

Arguments

URI | URI to analyse
Filename | Resulting filename

Function result

True if a filename was extracted from the URI

Description

URIToFilename returns a filename (using the correct Path Delimiter character) from URI. The URI must be of protocol File or have no protocol.

Errors

If the URI contains an unsupported protocol, False is returned.

See also

ResolveRelativeURI | Return a relative link
FilenameToURI | Construct a URI from a filename


Reference for package 'fcl'

Free Pascal FCL: Free Component Library

Units

ascii85 | ASCII 85 or Base 85 encoding
AVL_Tree | AVL tree implementation
base64 | Unit implementing base64 encoding
BlowFish | Unit implementing blowfish encryption/decryption streams
bufstream | Buffered stream
CacheCls | Unit implementing cache class
contnrs | Various general purpose classes: stack, queue, objectlists
CustApp | Custom application class
daemonapp | Daemon (service) application class
dbugintf | Unit to send commands to a debug server process
dbugmsg | Auxiliary unit for the dbugintf unit.
eventlog | Unit implementing system log class
ezcgi | Easy CGI unit
FPCanvas |
FPimage
fpTimer | Timer class
gettext | Unit implementing resource string translation using gettext files
idea | The IDEA unit provides IDEA encryption support
inicol | Collection which can write itself to inifile.
IniFiles | Ini files support
iostream | Implement streams for handling standard input, output and stderr
libtar | tar archive manipulation classes
Pipes | Unit implementing pipe streams.
pooledmm | Pooled memory manager implementation
process | Unit implementing the TProcess component.
rttiutils | RTTI utility functions
simpleipc | Simple one-way IPC protocol
streamcoll | Collection which can stream itself
streamex | Stream extensions
StreamIO | Streams for standard text files.
syncobjs | Synchronization objects
URIParser | URI Parsing routines
zstream | Support for compression streams

Description

The Free Component Library is a series of units that implemenent various classes and non-visual components for use with Free Pascal. They are building blocks for non-visual and visual programs, such as designed in Lazarus.

The TDataset descendents have been implemented in a way that makes them compatible to the Delphi implementation of these units. There are other units that have counterparts in Delphi, but most of them are unique to Free Pascal.


Index of all identifiers in package 'fcl'

A B C D E F G H I K L M O P R S T U W Z

A

ALL_PERMISSIONS | ascii85 | ascThreeEncodedChars
alphaOpaque | ascInitial | ascTwoEncodedChars
alphaTransparent | ascNoEncodedChar | AssignStream
Application | ascOneEncodedChar | AVL_Tree
ascFourEncodedChars | ascPrefix |

B

base64 | bl4 | bsHorizontal
bdmMIME | bl64 | bsImage
bdmStrict | bl8 | bsPattern
BFRounds | BlowFish | bsSolid
bl128 | bsBDiagonal | bsVertical
bl16 | bsClear | bufstream
bl2 | bsCross | BytesNeeded
bl256 | bsDiagCross |
bl32 | bsFDiagonal |

C

CacheCls | clfastest | colSilver
CalculateGray | clmax | colTeal
cfABGR16 | clnone | colTransparent
cfABGR32 | colAqua | colWhite
cfABGR64 | colBlack | ColWriteBoolean
cfABGR8 | colBlue | ColWriteCurrency
cfBGR15 | colCyan | ColWriteDateTime
cfBGR16 | colDkBlue | ColWriteFloat
cfBGR24 | colDkCyan | ColWriteInteger
cfBGR32 | colDkGray | ColWriteString
cfBGR48 | colDkGreen | colYellow
cfGray16 | colDkMagenta | CompareColors
cfGray2 | colDkRed | contnrs
cfGray24 | colDkYellow | ConvertFilename
cfGray4 | colFuchsia | CreateBlackAndWhitePalette
cfGray8 | colGray | CreateGrayScalePalette
cfGrayA16 | colGreen | CreatePipeHandles
cfGrayA32 | colLime | CreatePipeStreams
cfGrayA8 | colLtGray | CreateStoredItem
cfMono | colLtGreen | CreateVGAPalette
cfRGB15 | colMagenta | CreateWebSafePalette
cfRGB16 | colMaroon | csContinuePending
cfRGB24 | colNavy | csPaused
cfRGB32 | colOlive | csPausePending
cfRGB48 | colPurple | csRunning
cfRGBA16 | ColReadBoolean | csStartPending
cfRGBA32 | ColReadCurrency | csStopped
cfRGBA64 | ColReadDateTime | csStopPending
cfRGBA8 | ColReadFloat | CurrentStatusNames
CipherIdea | ColReadInteger | CustApp
cldefault | ColReadString |
ClearDirRec | colRed |

D

daemonapp | DefaultDaemonOptions | doAllowPause
DaemonError | DefaultIPCClientClass | doAllowStop
dbugintf | DefaultIPCServerClass | doInteractive
dbugmsg | DefaultTimerDriverClass | drmInstall
DebugMessageName | DeKeyIdea | drmRun
DebugServerID | dlError | drmUninstall
DecRect | dlInformation | drmUnknown
DefaultBufferCapacity | dlWarning |

E

EBase64DecodingException | EKeyNotFound | esIgnore
EBlowFishError | ELogError | esNormal
ECacheError | EMOFileError | esSevere
ECGIException | EncodeURI | EStreamColl
Ecompressionerror | EnKeyIdea | etCustom
EDaemon | ENoSeekMsg | etDebug
Edecompressionerror | EPipeCreation | etError
EDuplicate | EPipeError | etInfo
Egzfileerror | EPipeMsg | etWarning
EIDEAError | EPipeSeek | eventlog
EIniCol | EProcess | EXECUTE_PERMISSIONS
EIOStreamError | ErrorText | ezcgi
EIPCError | esCritical | Ezliberror

F

FilenameToURI | FPImageException | ftFifo
FileTimeGMT | fpTimer | ftLink
FILETYPE_NAME | ftBlock | ftMultiVolume
FindGlobalComponentCallBack | ftCharacter | ftNormal
FPCanvas | ftContiguous | ftSymbolicLink
FPColor | ftDirectory | ftVolumeHeader
FPimage | ftDumpDir |

G

GCM_JPEG | GetDebuggingEnabled | GrayConvMatrix
GCM_Mathematical | GetLanguageIDs | gzopenread
GCM_NTSC | GetStream | gzopenwrite
GCM_Photoshop | gettext |

H

hexTable

I

idea | ImageHandlers | iosError
IDEABLOCKSIZE | IncRect | iosInput
IdeaCryptData | INFINITE | iosOutPut
IdeaCryptKey | inicol | iostream
IDEAkey | IniFiles | IsAbsoluteURI
IDEAKEYSIZE | InitDebugClient |

K

KeyCount KEYLEN

L

lctError | lctStop | ltFile
lctIdentify | lctWarning | ltSystem
lctInformation | libtar |

M

MaxHashListSize | MaxItemsPerHash | mtString
MaxHashStrSize | MOFileHeaderMagic | mtUnknown
MaxHashTableSize | MsgVersion |

O

operator =(TFPColor, TFPColor): Boolean | operator or(TFPColor, TFPColor): TFPColor
operator and(TFPColor, TFPColor): TFPColor | operator xor(TFPColor, TFPColor): TFPColor

P

ParseStoredItem | pmMaskPenNot | poUsePipes
ParseURI | pmMerge | poWaitOnExit
PatternBitCount | pmMergeNotPen | PPCharArray
PBlowFishKey | pmMergePenNot | ppHigh
PBrushPattern | pmNop | ppIdle
PBucket | pmNot | ppNormal
PCacheSlot | pmNotCopy | PPooledMemManagerItem
PCacheSlotArray | pmNotMask | ppRealTime
PColorData | pmNotMerge | process
PermissionString | pmNotXor | psClear
PFPColor | PMOStringTable | psDash
PFPColorArray | pmWhite | psDashDot
PFPIntegerArray | pmXor | psDashDotDot
PHashItem | poDebugOnlyThisProcess | psDot
PHashItemList | poDebugProcess | PSecurityAttributes
PHashTable | poDefaultErrorMode | psEnding
Pipes | poNewConsole | psinsideFrame
PLongWordArray | poNewProcessGroup | psPattern
pmBlack | poNoConsole | psRunning
pmCopy | pooledmm | psSolid
pmMask | poRunSuspended | psStarting
pmMaskNotPen | poStderrToOutPut |

R

READ_PERMISSIONS | RegisterDaemonClass | ROUNDS
ReadDebugMessageFromStream | RegisterDaemonMapper | RSHash
RegisterDaemonApplicationClass | ResolveRelativeURI | rttiutils

S

SControlFailed | SetDebuggingEnabled | StrNoFile
SCustomCode | SExiting | StrNoImageToWrite
SDaemonStatus | SGlobal | StrNoPaletteAvailable
SendBoolean | simpleipc | StrNoStream
SendDateTime | SInvalidIndex | StrPalette
SendDebug | SLogCustom | StrReadWithError
SendDebugEx | SLogDebug | StrTypeAlreadyExist
SendDebugFmt | SLogError | StrTypeReaderAlreadyExist
SendDebugFmtEx | SLogInfo | StrTypeWriterAlreadyExist
SendError | SLogWarning | StrWriteWithError
SendInteger | SProcessID | stSystem
SendMethodEnter | sPropNameDelimiter | stWin32
SendMethodExit | SSeparator | suoUseCountChars
SendPointer | SServerStartFailed | suoUseFillAttribute
SendSeparator | SStatus | suoUsePosition
SEntering | StartDebugServer | suoUseShowWindow
SErrActive | stAuto | suoUseSize
SErrApplicationAlreadyCreated | stBoot | swoHIDE
SErrDaemonStartFailed | stDevice | swoMaximize
SErrDuplicateName | stDisabled | swoMinimize
SErrInActive | stFileSystem | swoNone
SErrLogFailedMsg | stManual | swoRestore
SErrNoDaemonDefForStatus | StrCantDetermineType | swoShow
SErrNoDaemonForStatus | streamcoll | swoShowDefault
SErrNoServiceMapper | streamex | swoShowMaximized
SErrNothingToDo | StreamIO | swoShowMinimized
SErrOnlyOneMapperAllowed | StrImageExtra | swoshowMinNOActive
SErrServerNotActive | StrImageX | swoShowNA
SErrServiceManagerStartFailed | StrImageY | swoShowNoActivate
SErrUnknownDaemonClass | StrInvalidIndex | swoShowNormal
SErrWindowClass | StrNoCorrectReaderFound | syncobjs

T

TASCII85DecoderStream | TFPBaseInterpolation | TIPCClientCommClass
TASCII85EncoderStream | TFPBrushException | TIPCServerComm
TASCII85RingBuffer | TFPBrushStyle | TIPCServerCommClass
TASCII85State | TFPCanvasException | TIteratorMethod
TAVLTree | TFPCanvasHelper | TLogCategoryEvent
TAVLTreeNode | TFPColor | TLogCodeEvent
TAVLTreeNodeMemManager | TFPColorArray | TLogType
TBase64DecodingMode | TFPCustomBrush | TLongWordArray
TBase64DecodingStream | TFPCustomBrushClass | TMemIniFile
TBase64EncodingStream | TFPCustomCanvas | TMessageType
TBaseAVLTreeNodeManager | TFPCustomDrawBrush | TMitchelInterpolation
TBFBlock | TFPCustomDrawFont | TMOFile
TBidirBinaryObjectReader | TFPCustomDrawPen | TMOFileHeader
TBidirBinaryObjectWriter | TFPCustomFont | TMOStringInfo
TBlowFish | TFPCustomFontClass | TMOStringTable
TBlowFishDeCryptStream | TFPCustomHashTable | tmSaveText
TBlowFishEncryptStream | TFPCustomImage | tmSetGid
TBlowFishKey | TFPCustomImageClass | tmSetUid
TBlowFishStream | TFPCustomImageHandler | TMsgHeader
TBrushPattern | TFPCustomImageReader | TNamedIniCollection
TBucket | TFPCustomImageReaderClass | TNamedIniCollectionItem
TBucketArray | TFPCustomImageWriter | TNonFreePooledMemManager
TBucketItem | TFPCustomImageWriterClass | TObjectBucketList
TBucketItemArray | TFPCustomInterpolation | TObjectIteratorMethod
TBucketList | TFPCustomPen | TObjectList
TBucketListSizes | TFPCustomPenClass | TObjectListCallback
TBucketProc | TFPCustomTimer | TObjectListStaticCallback
TBucketProcObject | TFPDataHashTable | TObjectQueue
TBufStream | TFPEmptyBrush | TObjectStack
TCache | TFPEmptyFont | TOnFreeSlot
TCacheSlot | TFPEmptyPen | TOnIsDataEqual
TCacheSlotArray | TFPFontException | TOrderedList
TClassList | TFPHashList | TOutputPipeStream
TColorData | TFPHashObject | TPCharArray
TColorFormat | TFPHashObjectList | TPenPattern
TComponentList | TFPImgProgressEvent | tpExecuteByGroup
Tcompressionlevel | TFPImgProgressStage | tpExecuteByOther
Tcompressionstream | TFPIntegerArray | tpExecuteByOwner
TCriticalSection | TFPMemoryImage | TPooledMemManager
TCurrentStatus | TFPObjectHashTable | TPooledMemManagerItem
TCustomApplication | TFPObjectList | tpReadByGroup
TCustomBucketList | TFPPalette | tpReadByOther
TCustomControlCodeEvent | TFPPenException | tpReadByOwner
TCustomDaemon | TFPPenMode | TProcess
TCustomDaemonApplication | TFPPenStyle | TProcessOption
TCustomDaemonApplicationClass | TFPPenStyleSet | TProcessOptions
TCustomDaemonClass | TFPStringHashTable | TProcessPriority
TCustomDaemonMapper | TFPTimer | TProgressEvent
TCustomDaemonMapperClass | TFPTimerDriver | TProgressStage
TCustomIniFile | TFPTimerDriverClass | TPropInfoList
Tcustomzlibstream | TGrayConvMatrix | TPropsStorage
TDaemon | TGuiLoopEvent | tpWriteByGroup
TDaemonApplication | TGZFileStream | tpWriteByOther
TDaemonClass | Tgzopenmode | tpWriteByOwner
TDaemonController | THandleObject | TQueue
TDaemonDef | THashedStringList | TranslateResourceStrings
TDaemonDefs | THashFunction | TranslateUnitResourceStrings
TDaemonEvent | THashItem | TReadBufStream
TDaemonMapper | THashItemList | TReadStrEvent
TDaemonOKEvent | THashTable | TServiceType
TDaemonOption | THTCustomNode | TShowWindowOptions
TDaemonOptions | THTCustomNodeClass | TSimpleEvent
TDaemonRunMode | THTDataNode | TSimpleIPC
TDaemonThread | THTNode | TSimpleIPCClient
TDataIteratorMethod | THTObjectNode | TSimpleIPCServer
TDebugLevel | THTOwnedObjectNode | TStack
TDebugMessage | THTStringNode | TStartType
Tdecompressionstream | TIdeaCryptData | TStartupOption
TDelphiReader | TIdeaCryptKey | TStartupOptions
TDelphiWriter | TIDEADeCryptStream | TStreamCollection
TDependencies | TIDEAEncryptStream | TStreamCollectionItem
TDependency | TIDEAKey | TStringIteratorMethod
TDeviceColor | TIDEAStream | TSynchroObject
TEnumItemsMethod | TIHData | TTarArchive
TEraseSectEvent | TImageHandlersManager | TTarDirRec
TErrorSeverity | TIniCollection | TTarMode
TErrorTextIndices | TIniCollectionItem | TTarModes
TEvent | TIniFile | TTarPermission
TEventHandle | TIniFileKey | TTarPermissions
TEventLog | TIniFileKeyList | TTarWriter
TEventObject | TIniFileSection | TURI
TEventType | TIniFileSectionList | TWaitResult
TExceptionEvent | TInputPipeStream | TWinBindings
TEZcgi | TIOStream | TWriteBufStream
TFileType | TIOSType | TWriteStrEvent
TFindComponentEvent | TIPCClientComm |

U

UpdateStoredList URIParser URIToFilename

W

wrAbandoned | WRITE_PERMISSIONS | wrSignaled
wrError | WriteDebugMessageToStream | wrTimeout

Z

zstream


Reference for unit 'ascii85'

ASCII 85 or Base 85 encoding

uses

  sysutils,

  Classes;

Overview

The ascii85 provides an ASCII 85 or base 85 decoding algorithm. It is class and stream based: the TASCII85DecoderStream stream can be used to decode any stream with ASCII85 encoded data.

Currently, no ASCII85 encoder stream is available.

It's usage and purpose is similar to the IDEA or base64 units.


Reference for unit 'ascii85': Types

TASCII85State

Encoder state enumeration


Reference for unit 'ascii85': Classes

TASCII85DecoderStream | ASCII 85 decoder stream.
TASCII85EncoderStream
TASCII85RingBuffer | Internal buffer class


Index of all identifiers in unit 'ascii85'

A T

A

ascFourEncodedChars | ascOneEncodedChar | ascTwoEncodedChars
ascInitial | ascPrefix |
ascNoEncodedChar | ascThreeEncodedChars |

T

TASCII85DecoderStream | TASCII85RingBuffer
TASCII85EncoderStream | TASCII85State


TASCII85State

Encoder state enumeration

Declaration

Source position: ascii85.pp line 29

type TASCII85State = (
ascInitial, | Initial state
ascOneEncodedChar, | One encoded character in buffer.
ascTwoEncodedChars, | Two encoded characters in buffer.
ascThreeEncodedChars, | Three encoded characters in buffer.
ascFourEncodedChars, | Four encoded characters in buffer.
ascNoEncodedChar, | No encoded characters in buffer.
ascPrefix | Prefix processing
);

Description

TASCII85State is for internal use, it contains the current state of the decoder.

See also

TASCII85DecoderStream

ASCII 85 decoder stream.


Reference for unit 'AVL_Tree'

AVL tree implementation

uses

  Classes,

  sysutils;

Overview

The avl_tree unit implements a general-purpose AVL (balanced) tree class: the TAVLTree class and it's associated data node class TAVLTreeNode.


Reference for unit 'AVL_Tree': Classes

TAVLTree | AVL tree component
TAVLTreeNode | Represents a node in the tree.
TAVLTreeNodeMemManager | TAVLTreeNode Node memory manager
TBaseAVLTreeNodeManager


Index of all identifiers in unit 'AVL_Tree'

T

T

TAVLTree | TAVLTreeNodeMemManager
TAVLTreeNode | TBaseAVLTreeNodeManager


Reference for unit 'base64'

Unit implementing base64 encoding

uses

  Classes,

  sysutils;

Overview

base64 implements base64 encoding (as used for instance in MIME encoding) based on streams. it implements 2 streams which encode or decode anything written or read from it. The source or the destination of the encoded data is another stream. 2 classes are implemented for this: TBase64EncodingStream for encoding, and TBase64DecodingStream for decoding.

The streams are designed as plug-in streams, which can be placed between other streams, to provide base64 encoding and decoding on-the-fly...


Reference for unit 'base64': Types

TBase64DecodingMode

Decoding mode for stream


Reference for unit 'base64': Classes

EBase64DecodingException | Exception raised on errors
TBase64DecodingStream | Base64 Decoding stream
TBase64EncodingStream | Base64 encoding stream.


Index of all identifiers in unit 'base64'

B E T

B

bdmMIME bdmStrict

E

EBase64DecodingException

T

TBase64DecodingMode TBase64DecodingStream TBase64EncodingStream


TBase64DecodingMode

Decoding mode for stream

Declaration

Source position: base64.pp line 58

type TBase64DecodingMode = (
bdmStrict, | Strict encoding
bdmMIME | MIME encoding
);

Description

TBase64DecodingMode determines the decoding algorithm used by TBase64DecodingStream. There are 2 modes:

bdmStrict
Strict mode, which follows RFC3548 and rejects any characters outside of base64 alphabet. In this mode only up to two '=' characters are accepted at the end. It requires the input to have a Size being a multiple of 4, otherwise an EBase64DecodingException exception is raised.
bdmMime
MIME mode, which follows RFC2045 and ignores any characters outside of base64 alphabet. In this mode any '=' is seen as the end of string, it handles apparently truncated input streams gracefully.


BFRounds

Number of rounds in blowfish encryption.

Declaration

Source position: blowfish.pp line 28

const BFRounds = 16;


Reference for unit 'BlowFish'

Unit implementing blowfish encryption/decryption streams

uses

  sysutils,

  Classes;

Overview

The BlowFish implements a class TBlowFish to handle blowfish encryption/descryption of memory buffers, and 2 TStream descendents TBlowFishDeCryptStream which descrypts any data that is read from it on the fly, as well as TBlowFishEnCryptStream which encrypts the data that is written to it on the fly.


Reference for unit 'BlowFish': Constants

BFRounds

Number of rounds in blowfish encryption.


Reference for unit 'BlowFish': Types

PBlowFishKey | Pointer to TBlowFishKey array
TBFBlock | Internal blowfish data structure
TBlowFishKey | Array to hold blowfish encryption keys


Reference for unit 'BlowFish': Classes

EBlowFishError | Exception used to report errors.
TBlowFish | Class implementing blowfish encryption/decription
TBlowFishDeCryptStream | On-the-fly Blowfish decryption stream
TBlowFishEncryptStream | On-the-fly Blowfish encryption stream
TBlowFishStream | Parent class for blowfish encryption/decryption streams


Index of all identifiers in unit 'BlowFish'

B E P T

B

BFRounds

E

EBlowFishError

P

PBlowFishKey

T

TBFBlock | TBlowFishDeCryptStream | TBlowFishKey
TBlowFish | TBlowFishEncryptStream | TBlowFishStream


PBlowFishKey

Pointer to TBlowFishKey array

Declaration

Source position: blowfish.pp line 31

type PBlowFishKey = ^TBlowFishKey;

Description

PBlowFishKey is a simple pointer to a TBlowFishKey array.

See also

TBlowFishKey

Array to hold blowfish encryption keys


TBFBlock

Internal blowfish data structure

Declaration

Source position: blowfish.pp line 33

type TBFBlock = array [0..1] of LongInt;

Description

TBFBlock is the basic data structure used by the encrypting/decrypting routines in TBlowFish, TBlowFishDeCryptStream and TBlowFishEnCryptStream. It is the basic encryption/decryption block for all encrypting/decrypting: all encrypting/decrypting happens on a TBFBlock structure.

See also

TBlowFish | Class implementing blowfish encryption/decription
TBlowFishEnCryptStream | On-the-fly Blowfish encryption stream
TBlowFishDeCryptStream | On-the-fly Blowfish decryption stream


TBlowFishKey

Array to hold blowfish encryption keys

Declaration

Source position: blowfish.pp line 32

type TBlowFishKey = array [0..55] of Byte;

Description

TBlowFishKey is a data structure which keeps the encryption or decryption key for the TBlowFish, TBlowFishDeCryptStream and TBlowFishEnCryptStream classes. It should be filled with the encryption key and passed to the constructor of one of these classes.

See also

TBlowFish | Class implementing blowfish encryption/decription
TBlowFishDeCryptStream | On-the-fly Blowfish decryption stream
TBlowFishEnCryptStream | On-the-fly Blowfish encryption stream


DefaultBufferCapacity

Default buffer size

Declaration

Source position: bufstream.pp line 26

const DefaultBufferCapacity: Integer = 16;

Description

If no buffer size is specified when the stream is created, then this size is used.

See also

TBufStream.Create

Create a new TBufStream instance.


Reference for unit 'bufstream'

Buffered stream

uses

  Classes,

  sysutils;

Overview

BufStream implements two one-way buffered streams: the streams store all data from (or for) the source stream in a memory buffer, and only flush the buffer when it's full (or refill it when it's empty). The buffer size can be specified at creation time. 2 streams are implemented: TReadBufStream which is for reading only, and TWriteBufStream which is for writing only.

Buffered streams can help in speeding up read or write operations, especially when a lot of small read/write operations are done: it avoids doing a lot of operating system calls.


Reference for unit 'bufstream': Constants

DefaultBufferCapacity

Default buffer size


Reference for unit 'bufstream': Classes

TBufStream | Common ancestor for buffered streams
TReadBufStream | Read-only buffered stream.
TWriteBufStream | Write-only buffered stream.


Index of all identifiers in unit 'bufstream'

D T

D

DefaultBufferCapacity

T

TBufStream TReadBufStream TWriteBufStream


Reference for unit 'CacheCls'

Unit implementing cache class

uses

  sysutils;

Overview

The CacheCls unit implements a caching class: similar to a hash class, it can be used to cache data, associated with string values (keys). The class is calles TCache


Reference for unit 'CacheCls': Resource strings

SInvalidIndex
'Invalid index %i'


Reference for unit 'CacheCls': Types

PCacheSlot | Pointer to TCacheSlot record.
PCacheSlotArray | Pointer to TCacheSlotArray array
TCacheSlot | Record representing 1 item in the cache list.
TCacheSlotArray | Array of TCacheSlot
TOnFreeSlot | Callback called when a slot must be freed.
TOnIsDataEqual | Callback type to check whether 2 data types are equal.


Reference for unit 'CacheCls': Classes

ECacheError | Exception class used in the cachecls unit.
TCache | Cache class


Index of all identifiers in unit 'CacheCls'

E P S T

E

ECacheError

P

PCacheSlot PCacheSlotArray

S

SInvalidIndex

T

TCache | TCacheSlotArray | TOnIsDataEqual
TCacheSlot | TOnFreeSlot |


PCacheSlot

Pointer to TCacheSlot record.

Declaration

Source position: cachecls.pp line 44

type PCacheSlot = ^TCacheSlot;

See also

TCacheSlot

Record representing 1 item in the cache list.


PCacheSlotArray

Pointer to TCacheSlotArray array

Declaration

Source position: cachecls.pp line 51

type PCacheSlotArray = ^TCacheSlotArray;

See also

TCacheSlotArray

Array of TCacheSlot


TOnFreeSlot

Callback called when a slot must be freed.

Declaration

Source position: cachecls.pp line 56

type TOnFreeSlot = procedure(

  ACache: TCache;

  SlotIndex: Integer

) of object;

Arguments

ACache | Cache class calling the function
SlotIndex | Index of the slot that will be freed.

Description

TOnFreeSlot is a callback prototype used when not enough slots are free, and a slot must be freed.

See also

TCache.OnFreeSlot

Event called when a slot is freed


TOnIsDataEqual

Callback type to check whether 2 data types are equal.

Declaration

Source position: cachecls.pp line 54

type TOnIsDataEqual = function(

  ACache: TCache;

  AData1: Pointer;

  AData2: Pointer

):Boolean of object;

Arguments

ACache | TCache instance which calls the callback.
AData1 | First data element pointer.
AData2 | Second data element pointer.

Function result

True if AData1 and AData2 are equal.

Description

TOnIsDataEqual is a callback prototype; It is used by the TCache.Add call to determine whether the item to be added is a new item or not. The function returns True if the 2 data pointers AData1 and AData2 should be considered equal, or False when they are not.

For most purposes, comparing the pointers will be enough, but if the pointers are ansistrings, then the contents should be compared.

See also

TCache.Add

Add a data element to the list.


Reference for unit 'contnrs'

Various general purpose classes: stack, queue, objectlists

uses

  sysutils,

  Classes;

Overview

The contnrs unit implements various general-purpose classes:

Object lists
lists that manage objects instead of pointers, and which automatically dispose of the objects.
Component lists
lists that manage components instead of pointers, and which automatically dispose the components.
Class lists
lists that manage class pointers instead of pointers.
Stacks
Stack classes to push/pop pointers or objects
Queues
Classes to manage a FIFO list of pointers or objects
Hash lists
General-purpose Hash lists.


Reference for unit 'contnrs': Constants

MaxHashListSize | Maximum size of hash list.
MaxHashStrSize | Maximum string size
MaxHashTableSize | Maximum size of the hash table.
MaxItemsPerHash | Maximum number of items in each hash bucket.


Reference for unit 'contnrs': Types

PBucket | Pointer to TBucket" type.
PHashItem | Pointer to THashItem
PHashItemList | Pointer to THashItemList array
PHashTable | Pointer to THashTable array.
TBucket | Bucket record
TBucketArray | Array of TBucket records.
TBucketItem | Record used in bucket list.
TBucketItemArray | Array of TBucketItem records
TBucketListSizes | Enumerated type to indicate bucket list size
TBucketProc | Callback for the ForEach call.
TBucketProcObject | Callback for the ForEach call.
TDataIteratorMethod | Data iterator method.
THashFunction | Hash calculation function.
THashItem | Record used to maintain an item in the hash list
THashItemList | array of THashItem records.
THashTable | Array of hash values
THTCustomNodeClass | Class of THTCustomNodeClass.
THTNode | Alias for THTDataNode
TIteratorMethod | Iterator prototype for TFPHashTable
TObjectIteratorMethod | iterate callback prototype.
TObjectListCallback | Method callback type for TFPObjectList.ForEachCall
TObjectListStaticCallback | Plan procedure callback type for TFPObjectList.ForEachCall
TStringIteratorMethod | Iterator callback type


Reference for unit 'contnrs': Classes

EDuplicate | Exception raised when a key is stored twice in a hash table.
EKeyNotFound | Exception raised when a key is not found.
TBucketList | Default bucket list implementation.
TClassList | List of classes.
TComponentList | List to manage component instances.
TCustomBucketList | Custom bucket list class
TFPCustomHashTable | Hash class
TFPDataHashTable | Hash table for data pointers
TFPHashList | Hash list class for pointer data
TFPHashObject | Hash-list aware object
TFPHashObjectList
TFPObjectHashTable | Hash table for object instances
TFPObjectList | TFPList descendent which manages objects.
TFPStringHashTable | Hash table for string data.
THTCustomNode | Single item in the hash table.
THTDataNode | Data node for pointer hashtable
THTObjectNode | Node type for TFPObjectHashTable
THTOwnedObjectNode | Node type for owned objects.
THTStringNode | Node type for TFPStringHashTable
TObjectBucketList | Bucket list using objects instead of pointers.
TObjectList | List to manage object instances.
TObjectQueue
TObjectStack | Object instances stack
TOrderedList | Base class for queues and stacks.
TQueue | Pointer queue
TStack | Pointer Stack


Reference for unit 'contnrs': Procedures and functions

RSHash

Standard hash value calculating function.


Index of all identifiers in unit 'contnrs'

B E M P R T

B

bl128 | bl256 | bl64
bl16 | bl32 | bl8
bl2 | bl4 |

E

EDuplicate EKeyNotFound

M

MaxHashListSize | MaxHashTableSize
MaxHashStrSize | MaxItemsPerHash

P

PBucket | PHashItemList
PHashItem | PHashTable

R

RSHash

T

TBucket | TFPHashObject | THTStringNode
TBucketArray | TFPHashObjectList | TIteratorMethod
TBucketItem | TFPObjectHashTable | TObjectBucketList
TBucketItemArray | TFPObjectList | TObjectIteratorMethod
TBucketList | TFPStringHashTable | TObjectList
TBucketListSizes | THashFunction | TObjectListCallback
TBucketProc | THashItem | TObjectListStaticCallback
TBucketProcObject | THashItemList | TObjectQueue
TClassList | THashTable | TObjectStack
TComponentList | THTCustomNode | TOrderedList
TCustomBucketList | THTCustomNodeClass | TQueue
TDataIteratorMethod | THTDataNode | TStack
TFPCustomHashTable | THTNode | TStringIteratorMethod
TFPDataHashTable | THTObjectNode |
TFPHashList | THTOwnedObjectNode |


MaxHashListSize

Maximum size of hash list.

Declaration

Source position: contnrs.pp line 193

const MaxHashListSize = Maxint div 16;

Description

MaxHashListSize is the maximum number of elements a hash list can contain.

See also

TFPHashList

Hash list class for pointer data


MaxHashStrSize

Maximum string size

Declaration

Source position: contnrs.pp line 194

const MaxHashStrSize = Maxint;

Description

MaxHashStrSize is the maximum amount of data for the key string values. The key strings are kept in a continuous memory area. This constant determines the maximum size of this memory area.

See also

TFPHashList

Hash list class for pointer data


MaxHashTableSize

Maximum size of the hash table.

Declaration

Source position: contnrs.pp line 195

const MaxHashTableSize = Maxint div 4;

Description

MaxHashTableSize is the maximum number of elements in the hash.

See also

TFPHashList

Hash list class for pointer data


MaxItemsPerHash

Maximum number of items in each hash bucket.

Declaration

Source position: contnrs.pp line 196

const MaxItemsPerHash = 3;

Description

MaxItemsPerHash is the threshold above which the hash is expanded. If the number of elements in a hash bucket becomes larger than this value, the hash size is increased.

See also

TFPHashList

Hash list class for pointer data


PBucket

Pointer to TBucket" type.

Declaration

Source position: contnrs.pp line 496

type PBucket = ^TBucket;


PHashItem

Pointer to THashItem

Declaration

Source position: contnrs.pp line 190

type PHashItem = ^THashItem;

Description

PHashItem is a pointer type, pointing to the THashItem record.

See also

THashItem

Record used to maintain an item in the hash list


PHashItemList

Pointer to THashItemList array

Declaration

Source position: contnrs.pp line 199

type PHashItemList = ^THashItemList;

Description

PHashItemList is a pointer to the THashItemList. It's used in the TFPHashList as a pointer to the memory area containing the hash item records.

See also

THashItemList

array of THashItem records.


PHashTable

Pointer to THashTable array.

Declaration

Source position: contnrs.pp line 201

type PHashTable = ^THashTable;

Description

PHashTable is a pointer to the THashTable. It's used in the TFPHashList as a pointer to the memory area containing the hash values.

See also

THashTable | Array of hash values
TFPHashList | Hash list class for pointer data


TBucket

Bucket record

Declaration

Source position: contnrs.pp line 492

type TBucket = record
Count: Integer; | Number of items in the bucket
Items: TBucketItemArray; | Items in this bucket
end;

Description

TBucket describes 1 bucket in the TCustomBucketList class. It is a container for TBucketItem records. It should never be used directly.

See also

TBucketItem

Record used in bucket list.

CustomBucketList


TBucketArray

Array of TBucket records.

Declaration

Source position: contnrs.pp line 497

type TBucketArray = array of TBucket;


TBucketItem

Record used in bucket list.

Declaration

Source position: contnrs.pp line 487

type TBucketItem = record
Item: Pointer; | Item to associate data with
Data: Pointer; | Data associated with item
end;

Description

TBucketItem is a record used for internal use in TCustomBucketList. It should not be necessary to use it directly.

See also

TCustomBucketList

Custom bucket list class


TBucketItemArray

Array of TBucketItem records

Declaration

Source position: contnrs.pp line 490

type TBucketItemArray = array of TBucketItem;

See also

TBucketItem

Record used in bucket list.


TBucketProc

Callback for the ForEach call.

Declaration

Source position: contnrs.pp line 499

type TBucketProc = procedure(

  AInfo: Pointer;

  AItem: Pointer;

  AData: Pointer;

  out AContinue: Boolean

);

Arguments

AInfo | Extra info pointer passed to Foreach call.
AItem | Item
AData | Data associated with item
AContinue | Set to false to stop iteration over items.

Description

TBucketProc is the prototype for the #TCustomBucketList.Foreach call. It is the plain procedural form. The Continue parameter can be set to False to indicate that the Foreach call should stop the iteration.

For a procedure of object (a method) callback, see the TBucketProcObject prototype.

See also

#TCustomBucketList.Foreach

TBucketProcObject

Callback for the ForEach call.


TBucketProcObject

Callback for the ForEach call.

Declaration

Source position: contnrs.pp line 500

type TBucketProcObject = procedure(

  AItem: Pointer;

  AData: Pointer;

  out AContinue: Boolean

) of object;

Arguments

AItem | Item
AData | Data associated with item
AContinue | Set to false to stop iteration over items.

Description

TBucketProcObject is the prototype for the #TCustomBucketList.Foreach call. It is the method (procedure of object) form. The Continue parameter can be set to False to indicate that the Foreach call should stop the iteration.

For a plain procedural callback, see the TBucketProc prototype.

See also

#TCustomBucketList.Foreach

TBucketProc

Callback for the ForEach call.


TDataIteratorMethod

Data iterator method.

Declaration

Source position: contnrs.pp line 406

type TDataIteratorMethod = procedure(

  Item: Pointer;

  const Key: String;

  var Continue: Boolean

) of object;

Arguments

Item | Data pointer item
Key | Key associated with item
Continue | Continue iterating or stop iteration

Description

TDataIteratorMethod is a callback prototype for the TDataHashTable.Iterate method. It is called for each data pointer in the hash list, passing the key (key) and data pointer (item) for each item in the list. If Continue is set to false, the iteration stops.

See also

TDataHashTable.Iterate


THashFunction

Hash calculation function.

Declaration

Source position: contnrs.pp line 334

type THashFunction = function(

  const S: String;

  const TableSize: LongWord

):LongWord;

Arguments

S | String to calculate hash value from.
TableSize | Hash table size.

Function result

Hash value

Description

THashFunction is the prototype for a hash calculation function. It should calculate a hash of string S, where the hash table size is TableSize. The return value should be the hash value.


THashItem

Record used to maintain an item in the hash list

Declaration

Source position: contnrs.pp line 184

type THashItem = record
HashValue: LongWord; | Key hash value
StrIndex: Integer; | Index of the string value
NextIndex: Integer; | Next value index
Data: Pointer; | Data associated with the key.
end;

Description

THashItem is used internally in the hash list. It should never be used directly.

See also

TFPHashList

Hash list class for pointer data


THashItemList

array of THashItem records.

Declaration

Source position: contnrs.pp line 200

type THashItemList = array [0..MaxHashListSize-1] of THashItem;

Description

THashItemList is an array type, primarily used to be able to define the PHashItemList type. It's used in the TFPHashList class.

See also

PHashItemList | Pointer to THashItemList array
TFPHashList | Hash list class for pointer data


THashTable

Array of hash values

Declaration

Source position: contnrs.pp line 202

type THashTable = array [0..MaxHashTableSize-1] of Integer;

Description

THashTable defines an array of integers, used to hold hash values. It's mainly used to define the PHashTable class.

See also

PHashTable | Pointer to THashTable array.
TFPHashList | Hash list class for pointer data


THTNode

Alias for THTDataNode

Declaration

Source position: contnrs.pp line 404

type THTNode = THTDataNode;

Description

THTNode is provided for backwards compatibility.

See also

THTDataNode | Data node for pointer hashtable
TFPHashTable
TFPDataHashTable | Hash table for data pointers
THTObjectNode | Node type for TFPObjectHashTable
THTStringNode | Node type for TFPStringHashTable


TIteratorMethod

Iterator prototype for TFPHashTable

Declaration

Source position: contnrs.pp line 408

type TIteratorMethod = TDataIteratorMethod;

Description

TIteratorMethod is used in an internal TFPHashTable method.

See also

TFPHashTable


TObjectIteratorMethod

iterate callback prototype.

Declaration

Source position: contnrs.pp line 457

type TObjectIteratorMethod = procedure(

  Item: TObject;

  const Key: String;

  var Continue: Boolean

) of object;

Arguments

Item | Data object
Key | Key value
Continue | Should the iteration continue or stop

Description

TObjectIteratorMethod is the iterator callback prototype. It is used to iterate over all items in the hash table, and is called with each key value (Key) and associated object (Item). If Continue is set to false, the iteration stops.


TStringIteratorMethod

Iterator callback type

Declaration

Source position: contnrs.pp line 429

type TStringIteratorMethod = procedure(

  Item: String;

  const Key: String;

  var Continue: Boolean

) of object;

Arguments

Item | String associated with key
Key | Key value
Continue | Should iterate continue or stop ?

Description

TStringIteratorMethod is the callback prototype for the Iterate method. It is called for each element in the hash table, with the string. If Continue is set to false, the iteration stops.


Reference for unit 'CustApp'

Custom application class

uses

  sysutils,

  Classes;

Overview

The CustApp unit implements the TCustomApplication class, which serves as the common ancestor to many kinds of TApplication classes: a GUI application in the LCL, a CGI application in FPCGI, a daemon application in daemonapp. It introduces some properties to describe the environment in which the application is running (environment variables, program command-line parameters) and introduces some methods to initialize and run a program, as well as functionality to handle exceptions.

Typical use of a descendent class is to introduce a global variable Application and use the following code:

Application.Initialize;
  Application.Run;

Since normally only a single instance of this class is created, and it is a TComponent descendent, it can be used as an owner for many components, doing so will ensure these components will be freed when the application terminates.


Reference for unit 'CustApp': Types

TExceptionEvent

Exception handling event prototype


Reference for unit 'CustApp': Classes

TCustomApplication

Ancestor class for TApplication classes.


Index of all identifiers in unit 'CustApp'

T

T

TCustomApplication TExceptionEvent


TExceptionEvent

Exception handling event prototype

Declaration

Source position: custapp.pp line 24

type TExceptionEvent = procedure(

  Sender: TObject;

  E: Exception

) of object;

Arguments

Sender | TCustomApplication instance.
E | Exception instance that should be handled.

Description

TExceptionEvent is the prototype for the exception handling events in TCustomApplication.

See also

TCustomApplication.HandleException | Handle an exception.
TCustomApplication.ShowException | Show an exception to the user


Daemon application architecture

The latest version of this document can be found at lazarus-ccr.sourceforge.net .


CurrentStatusNames

Names for various service statuses

Declaration

Source position: daemonapp.pp line 415

var CurrentStatusNames: array [TCurrentStatus] of String = ('Stopped','Start Pending','Stop Pending','Running','Continue Pending','Pause Pending','Paused' );


DefaultDaemonOptions

Default daemon options

Declaration

Source position: daemonapp.pp line 420

var DefaultDaemonOptions: TDaemonOptions = [doAllowStop,doAllowPause];

Description

DefaultDaemonOptions are the default options with which a daemon definition (TDaemonDef) is created.

See also

TDaemonDef

Daemon definition


Reference for unit 'daemonapp'

Daemon (service) application class

uses
CustApp, | Custom application class
Classes,
sysutils,
eventlog, | Unit implementing system log class
rtlconsts;

Overview

The daemonapp unit implements a TApplication class which encapsulates a daemon or service application. It handles installation where this is necessary, and does instantiation of the various daemons where necessary.

The unit consists of 3 separate classes which cooperate tightly:

TDaemon
This is a class that implements the daemon's functionality. One or more descendents of this class can be implemented and instantiated in a single daemon application. For more information, see TDaemon.
TDaemonApplication
This is the actual daemon application class. A global instance of this class is instantiated. It handles the command-line arguments, and instantiates the various daemons. For more information, see TDaemonApplication.
TDaemonDef
This class defines the daemon in the operation system. The TDaemonApplication class has a collection of TDaemonDef instances, which it uses to start the various daemons. For more information, see TDaemonDef.

As can be seen, a single application can implement one ore more daemons (services). Each daemon will be run in a separate thread which is controlled by the application class.

The classes take care of logging through the TEventLog class.

Many options are needed only to make the application behave as a windows service application on windows. These options are ignored in unix-like environment. The documentation will mention this.

Related topics

Architecture

Daemon application architecture


Reference for unit 'daemonapp': Resource strings

SErrNoServiceMapper
'No daemon mapper class registered.'

SErrOnlyOneMapperAllowed
'Not changing daemon mapper class %s with %s: Only 1 mapper allowed.'

SErrNothingToDo
'Options do not allow determining what needs to be done.'

SErrDuplicateName
'Duplicate daemon name: %s'

SErrUnknownDaemonClass
'Unknown daemon class name: %s'

SErrDaemonStartFailed
'Failed to start daemon %s : %s'

SDaemonStatus
'Daemon %s current status: %s'

SControlFailed
'Control code %s handling failed: %s'

SCustomCode
'[Custom code %d]'

SErrServiceManagerStartFailed
'Failed to start service manager: %s'

SErrNoDaemonForStatus
'%s: No daemon for status report'

SErrNoDaemonDefForStatus
'%s: No daemon definition for status report'

SErrWindowClass
'Could not register window class'

SErrApplicationAlreadyCreated
'An application instance of class %s was already created.'


Reference for unit 'daemonapp': Types

TCurrentStatus | Current daemon status
TCustomControlCodeEvent | Prototype for event to handle a custom control code
TCustomDaemonApplicationClass | Class pointer for TCustomDaemonApplication
TCustomDaemonClass | Class type for TCustomDaemon
TCustomDaemonMapperClass | Class of TCustomDaemonMapper
TDaemonClass | Class type of TDaemon
TDaemonEvent | Daemon event handler prototype
TDaemonOKEvent | Daemon acknowledgement event handler
TDaemonOption | Daemon options
TDaemonOptions | Set of TDaemonOption options.
TDaemonRunMode | Daemon application run mode
TErrorSeverity | Severity of a startup error (Windows only)
TGuiLoopEvent | GUI loop event mechanism
TServiceType | Type of service (Windows only)
TStartType | When should the daemon be started (windows only)


Reference for unit 'daemonapp': Classes

EDaemon | Exception used in all daemon application code
TCustomDaemon | Base daemon application class
TCustomDaemonApplication | Custom daemon application class
TCustomDaemonMapper | Daemon mapper
TDaemon | Daemon class for visual development
TDaemonApplication | Default descendent of CustomDaemonApplication
TDaemonController | Internal daemon controller class
TDaemonDef | Daemon definition
TDaemonDefs | Collection of daemon definitions.
TDaemonMapper | Daemon mapper for designing in IDE
TDaemonThread | Thread to run daemons in
TDependencies | Dependencies collection for a daemon
TDependency | Container to define depenencies on other services.
TWinBindings | Windows Daemon bindings (windows only)


Reference for unit 'daemonapp': Procedures and functions

Application | Application instance
DaemonError | Raise an EDaemon exception
RegisterDaemonApplicationClass | Register alternative TCustomDaemonApplication class.
RegisterDaemonClass | Register daemon
RegisterDaemonMapper | Register a daemon mapper class


Reference for unit 'daemonapp': Variables

CurrentStatusNames | Names for various service statuses
DefaultDaemonOptions | Default daemon options
SStatus | Status message


Index of all identifiers in unit 'daemonapp'

A C D E R S T

A

Application

C

csContinuePending | csRunning | csStopPending
csPaused | csStartPending | CurrentStatusNames
csPausePending | csStopped |

D

DaemonError | doAllowStop | drmRun
DefaultDaemonOptions | doInteractive | drmUninstall
doAllowPause | drmInstall | drmUnknown

E

EDaemon | esIgnore | esSevere
esCritical | esNormal |

R

RegisterDaemonApplicationClass RegisterDaemonClass RegisterDaemonMapper

S

SControlFailed | SErrNoServiceMapper | stBoot
SCustomCode | SErrNothingToDo | stDevice
SDaemonStatus | SErrOnlyOneMapperAllowed | stDisabled
SErrApplicationAlreadyCreated | SErrServiceManagerStartFailed | stFileSystem
SErrDaemonStartFailed | SErrUnknownDaemonClass | stManual
SErrDuplicateName | SErrWindowClass | stSystem
SErrNoDaemonDefForStatus | SStatus | stWin32
SErrNoDaemonForStatus | stAuto |

T

TCurrentStatus | TDaemonClass | TDaemonThread
TCustomControlCodeEvent | TDaemonController | TDependencies
TCustomDaemon | TDaemonDef | TDependency
TCustomDaemonApplication | TDaemonDefs | TErrorSeverity
TCustomDaemonApplicationClass | TDaemonEvent | TGuiLoopEvent
TCustomDaemonClass | TDaemonMapper | TServiceType
TCustomDaemonMapper | TDaemonOKEvent | TStartType
TCustomDaemonMapperClass | TDaemonOption | TWinBindings
TDaemon | TDaemonOptions |
TDaemonApplication | TDaemonRunMode |


SStatus

Status message

Declaration

Source position: daemonapp.pp line 418

var SStatus: array [1..5] of String = ('Stop','Pause','Continue','Interrogate','Shutdown' );


TCurrentStatus

Current daemon status

Declaration

Source position: daemonapp.pp line 38

type TCurrentStatus = (
csStopped, | The daemon is stopped, i.e. inactive.
csStartPending, | The daemon is starting, but not yet fully running.
csStopPending, | The daemon is stopping, but not yet fully stopped.
csRunning, | The daemon is running (it is operational).
csContinuePending, | The daemon is continuing, but not yet running
csPausePending, | The daemon is about to be paused.
csPaused | The daemon is paused: running but not active.
);

Description

TCurrentStatus indicates the current state of the daemon. It changes from one state to the next during the time the instance is active. The daemon application changes the state of the daemon, depending on signals it gets from the operating system, by calling the appropriate methods.


TCustomControlCodeEvent

Prototype for event to handle a custom control code

Declaration

Source position: daemonapp.pp line 74

type TCustomControlCodeEvent = procedure(

  Sender: TCustomDaemon;

  ACode: DWord;

  var Handled: Boolean

) of object;

Arguments

Sender | Daemon instance for which the control event was meant
ACode | Control code being sent to the daemon
Handled | Was the control code handled ?

Description

In case the system sends a non-standard control code to the daemon, an event handler is executed with this prototype.


TCustomDaemonClass

Class type for TCustomDaemon

Declaration

Source position: daemonapp.pp line 71

type TCustomDaemonClass = class of TCustomDaemon;

Description

The class type is needed in the TDaemonDef definition.

See also

TDaemonDef

Daemon definition


TDaemonClass

Class type of TDaemon

Declaration

Source position: daemonapp.pp line 138

type TDaemonClass = class of TDaemon;


TDaemonEvent

Daemon event handler prototype

Declaration

Source position: daemonapp.pp line 27

type TDaemonEvent = procedure(

  Sender: TCustomDaemon

) of object;

Arguments

Sender

Daemon instance

Description

TDaemonEvent is used in event handling. The Sender is the TCustomDaemon instance that has initiated the event.


TDaemonOKEvent

Daemon acknowledgement event handler

Declaration

Source position: daemonapp.pp line 28

type TDaemonOKEvent = procedure(

  Sender: TCustomDaemon;

  var OK: Boolean

) of object;

Arguments

Sender | Daemon instance
OK | Operation was successful

Description

TDaemonOKEvent is used in event handling, when a boolean result must be obtained, for instance, to see if an operation was performed succesfully.


TDaemonOption

Daemon options

Declaration

Source position: daemonapp.pp line 30

type TDaemonOption = (
doAllowStop, | The daemon can be stopped.
doAllowPause, | The daemon can be paused.
doInteractive | The daemon interacts with the desktop.
);

Description

Enumerated that enumerates the various daemon operation options.


TDaemonOptions

Set of TDaemonOption options.

Declaration

Source position: daemonapp.pp line 31

type TDaemonOptions = set of (
doAllowStop, | The daemon can be stopped.
doAllowPause, | The daemon can be paused.
doInteractive | The daemon interacts with the desktop.
);

Description

TDaemonOption enumerates the various options a daemon can have.


TDaemonRunMode

Daemon application run mode

Declaration

Source position: daemonapp.pp line 33

type TDaemonRunMode = (
drmUnknown, | Unknown mode
drmInstall, | Daemon install mode (windows only)
drmUninstall, | Daemon uninstall mode (windows only)
drmRun | Daemon is running normally
);

Description

TDaemonRunMode indicates in what mode the daemon application (as a whole) is currently running.

See also

RunMode

Application mode


TErrorSeverity

Severity of a startup error (Windows only)

Declaration

Source position: daemonapp.pp line 143

type TErrorSeverity = (
esIgnore, | Ignore startup errors
esNormal, | Error is logged, but startup continues
esSevere, | Error is logged, and startup is continued if last known good configuration is active, or system is restarted using last known good configuration
esCritical | Error is logged, and startup is stopped if last known good configuration is active, or system is restarted using last known good configuration
);

Description

TErrorSeverity determines what action windows takes when the daemon fails to start. It is used on windows only, and is ignored on other platforms.


TGuiLoopEvent

GUI loop event mechanism

Declaration

Source position: daemonapp.pp line 326

type TGuiLoopEvent = procedure of object;

Description

TGuiLoopEvent is the main GUI loop event procedure prototype. It is called by the application instance in case the daemon has a visual part, which needs to handle visual events. It is run in the main application thread.

See also

TCustomDaemonApplication.GUIMainLoop | GUI main loop callback
TCustomDaemonApplication.GUIHandle | Handle of GUI loop main application window handle


TServiceType

Type of service (Windows only)

Declaration

Source position: daemonapp.pp line 142

type TServiceType = (
stWin32, | Regular win32 service
stDevice, | Device driver
stFileSystem | File system driver
);

Description

The type of service. This type is used on windows only, to signal the operating system what kind of service is being installed or run.


TStartType

When should the daemon be started (windows only)

Declaration

Source position: daemonapp.pp line 144

type TStartType = (
stBoot, | During system boot
stSystem, | During load of device drivers
stAuto, | Started automatically by service manager during system startup
stManual, | Started manually by the user or other processes.
stDisabled | Service is not started, it is disabled
);

Description

TStartType can be used to define when the service must be started on windows. This type is not used on other platforms.


Writing a debug server

Writing a debug server is relatively easy. It should instantiate a TSimpleIPCServer class from the SimpleIPC unit, and use the DebugServerID as ServerID identification. This constant, as well as the record containing the message which is sent between client and server is defined in the msgintf unit.

The dbugintf unit relies on the SimpleIPC mechanism to communicate with the debug server, hence it works on all platforms that have a functional version of that unit. It also uses TProcess to start the debug server if needed, so the process unit should also be functional.


Reference for unit 'dbugintf'

Unit to send commands to a debug server process

Overview

Use dbugintf to add debug messages to your application. The messages are not sent to standard output, but are sent to a debug server process which collects messages from various clients and displays them somehow on screen.

The unit is transparant in its use: it does not need initialization, it will start the debug server by itself if it can find it: the program should be called debugserver and should be in the PATH. When the first debug message is sent, the unit will initialize itself.

The FCL contains a sample debug server (dbugsvr) which can be started in advance, and which writes debug message to the console (both on Windows and Linux). The Lazarus project contains a visual application which displays the messages in a GUI.

The dbugintf unit relies on the SimpleIPC mechanism to communicate with the debug server, hence it works on all platforms that have a functional version of that unit. It also uses TProcess to start the debug server if needed, so the process unit should also be functional.

Related topics

debugservers

Writing a debug server


Reference for unit 'dbugintf': Resource strings

SProcessID
'Process %s'

SEntering
'> Entering '

SExiting
'< Exiting '

SSeparator
'>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<'

SServerStartFailed
'Failed to start debugserver. (%s)'


Reference for unit 'dbugintf': Constants

SendError

Last error in the debug system.


Reference for unit 'dbugintf': Types

TDebugLevel

Level of the message.


Reference for unit 'dbugintf': Procedures and functions

GetDebuggingEnabled | Check if sending of debug messages is enabled.
InitDebugClient | Initialize the debug client.
SendBoolean | Send the value of a boolean variable
SendDateTime | Send the value of a TDateTime variable.
SendDebug | Send a message to the debug server.
SendDebugEx | Send debug message other than informational messages
SendDebugFmt | Format and send a debug message
SendDebugFmtEx | Format and send message with alternate type
SendInteger | Send the value of an integer variable.
SendMethodEnter | Send method enter message
SendMethodExit | Send method exit message
SendPointer | Send the value of a pointer variable.
SendSeparator | Send a separator message
SetDebuggingEnabled | Temporary enables or disables debugging
StartDebugServer | Start the debug server


Index of all identifiers in unit 'dbugintf'

D G I S T

D

dlError dlInformation dlWarning

G

GetDebuggingEnabled

I

InitDebugClient

S

SendBoolean | SendInteger | SExiting
SendDateTime | SendMethodEnter | SProcessID
SendDebug | SendMethodExit | SSeparator
SendDebugEx | SendPointer | SServerStartFailed
SendDebugFmt | SendSeparator | StartDebugServer
SendDebugFmtEx | SEntering |
SendError | SetDebuggingEnabled |

T

TDebugLevel


SendError

Last error in the debug system.

Declaration

Source position: dbugintf.pp line 46

const SendError: String = '';

Description

Whenever a call encounteres an exception, the exception message is stored in this variable.


TDebugLevel

Level of the message.

Declaration

Source position: dbugintf.pp line 23

type TDebugLevel = (
dlInformation, | Informational message
dlWarning, | Warning message
dlError | Error message
);

Description

TDebugLevel indicates the severity level of the debug message to be sent. By default, an informational message is sent.

See also

SendDebugFmtEx | Format and send message with alternate type
SendDebugEx | Send debug message other than informational messages


DebugServerID

System unique name

Declaration

Source position: dbugmsg.pp line 25

const DebugServerID: String = 'fpcdebugserver';

Description

DebugServerID is a string which is used when creating the message protocol, it is used when identifying the server in the (platform dependent) client-server protocol.


Reference for unit 'dbugmsg'

Auxiliary unit for the dbugintf unit.

uses

  Classes;

Overview

dbugmsg is an auxialiary unit used in the dbugintf unit. It defines the message protocol used between the debug unit and the debug server.


Reference for unit 'dbugmsg': Constants

DebugServerID | System unique name
lctError | Error message
lctIdentify | Identification message
lctInformation | Informational message
lctStop | Stop message
lctWarning | Warning message


Reference for unit 'dbugmsg': Types

TDebugMessage

Structure describing a message


Reference for unit 'dbugmsg': Procedures and functions

DebugMessageName | Return the name of the debug message
ReadDebugMessageFromStream | Read a message from stream
WriteDebugMessageToStream | Write a message to stream


Index of all identifiers in unit 'dbugmsg'

D L R T W

D

DebugMessageName DebugServerID

L

lctError | lctInformation | lctWarning
lctIdentify | lctStop |

R

ReadDebugMessageFromStream

T

TDebugMessage

W

WriteDebugMessageToStream


lctError

Error message

Declaration

Source position: dbugmsg.pp line 30

const lctError = 2;

Description

lctError is the identification of error messages.


lctIdentify

Identification message

Declaration

Source position: dbugmsg.pp line 31

const lctIdentify = 3;

Description

lctIdentify is sent by the client to a server when it first connects. It's the first message, and contains the name of client application.


lctInformation

Informational message

Declaration

Source position: dbugmsg.pp line 28

const lctInformation = 0;

Description

lctInformation is the identification of informational messages.


lctStop

Stop message

Declaration

Source position: dbugmsg.pp line 27

const lctStop = -1;

Description

lctStop is sent by the client to a server when it disconnects.


lctWarning

Warning message

Declaration

Source position: dbugmsg.pp line 29

const lctWarning = 1;

Description

lctWarning is the identification of warning messages.


TDebugMessage

Structure describing a message

Declaration

Source position: dbugmsg.pp line 34

type TDebugMessage = record
MsgType: Integer; | Constant, identifying the type of message
MsgTimeStamp: TDateTime; | Time when the message was generated
Msg: String; | String containing the message text.
end;

Description

TDebugMessage is a record that describes the message passed from the client to the server. It should not be passed directly in shared memory, as the string containing the message is allocated on the heap. Instead, the WriteDebugMessageToStream and ReadDebugMessageFromStream can be used to read or write the message from/to a stream.

See also

ReadDebugMessageFromStream | Read a message from stream
WriteDebugMessageToStream | Write a message to stream


Reference for unit 'eventlog'

Unit implementing system log class

uses

  sysutils,

  Classes;

Overview

The EventLog unit implements the TEventLog component, which is a component that can be used to send log messages to the system log (if it is available) or to a file.


Reference for unit 'eventlog': Resource strings

SLogInfo
'Info'

SLogWarning
'Warning'

SLogError
'Error'

SLogDebug
'Debug'

SLogCustom
'Custom (%d)'

SErrLogFailedMsg
'Failed to log entry (Error: %s)'


Reference for unit 'eventlog': Types

TEventType | Type of event
TLogCategoryEvent | Callback type to return custom category code
TLogCodeEvent | Callback type to retrieve custom event codes
TLogType | Type of log


Reference for unit 'eventlog': Classes

ELogError | Exception raised on errors in the TEventLog component
TEventLog | Event logging class


Index of all identifiers in unit 'eventlog'

E L S T

E

ELogError | etDebug | etInfo
etCustom | etError | etWarning

L

ltFile ltSystem

S

SErrLogFailedMsg | SLogDebug | SLogInfo
SLogCustom | SLogError | SLogWarning

T

TEventLog | TLogCategoryEvent | TLogType
TEventType | TLogCodeEvent |


TEventType

Type of event

Declaration

Source position: eventlog.pp line 26

type TEventType = (
etCustom, | Custom event type.
etInfo, | Informational event
etWarning, | Warning event
etError, | Error event
etDebug | Debug event
);

Description

TEventType determines the type of event. Depending on the system logger, the log event may end up in different places, or may be displayed in a different manner. A suitable mapping is shown for each system. In the case of Windows, the formatting of the message is done differently, and a different icon is shown for each type of message.


TLogCategoryEvent

Callback type to return custom category code

Declaration

Source position: eventlog.pp line 29

type TLogCategoryEvent = procedure(

  Sender: TObject;

  var Code: Word

) of object;

Arguments

Sender | TEventLog instance that triggered the event
Code | OS category code

Description

TLogCategoryEvent is the event type for the TEventLog.OnGetCustomCategory event handler. It should return a OS event catagory code for the etCustom log event type in the Code parameter.

See also

TEventLog.OnGetCustomCategory | Event to retrieve custom message category
TLogCodeEvent | Callback type to retrieve custom event codes


TLogCodeEvent

Callback type to retrieve custom event codes

Declaration

Source position: eventlog.pp line 28

type TLogCodeEvent = procedure(

  Sender: TObject;

  var Code: DWord

) of object;

Arguments

Sender | TEventLog instance that triggered the event
Code | Code to return

Description

TLogCodeEvent is the event type for the OnGetCustomEvent and OnGetCustomEventID event handlers. It should return a OS system log code for the etCustom log event or event ID type in the Code parameter.

See also

TEventLog.OnGetCustomEvent | Event to retrieve custom event Code
TEventLog.OnGetCustomEventID | Event to retrieve custom event ID
TLogCategoryEvent | Callback type to return custom category code


TLogType

Type of log

Declaration

Source position: eventlog.pp line 27

type TLogType = (
ltSystem, | Use the system log
ltFile | Write to file
);

Description

TLogType determines where the log messages are written. It is the type of the TEventLog.LogType property. It can have 2 values:

ltFile
This is used to write all messages to file. if no system logging mechanism exists, this is used as a fallback mechanism.
ltSystem
This is used to send all messages to the system log mechanism. Which log mechanism this is, depends on the operating system.

See also

TEventLog.LogType

Log type


hexTable

Integer to hex code conversion table

Declaration

Source position: ezcgi.pp line 23

const hexTable = '0123456789ABCDEF';

Description

String constant used to convert a number to a hexadecimal code or back.


Reference for unit 'ezcgi'

Easy CGI unit

uses

  Classes,

  strings,

  sysutils;

Overview

ezcgi, written by Michael Hess, provides a single class which offers simple access to the CGI environment which a CGI program operates under. It supports both GET and POST methods. It's intended for simple CGI programs which do not need full-blown CGI support. File uploads are not supported by this component.

To use the unit, a descendent of the TEZCGI class should be created and the DoPost or DoGet methods should be overidden.


Reference for unit 'ezcgi': Constants

hexTable

Integer to hex code conversion table


Reference for unit 'ezcgi': Classes

ECGIException | Exception raised by TEZcgi
TEZcgi | Easy CGI class


Index of all identifiers in unit 'ezcgi'

E H T

E

ECGIException

H

hexTable

T

TEZcgi


Reference for unit 'FPCanvas'

uses

  math,

  sysutils,

  Classes,

  FPImage;


Reference for unit 'FPCanvas': Constants

PatternBitCount


Reference for unit 'FPCanvas': Types

PBrushPattern |
TBrushPattern |
TFPBrushStyle | TFPBrushStyle - Solid, Clear, Horizontal, Vertical, FDiagonal, BDiagonal, Cross, DiagCross, Image, Pattern
TFPCustomBrushClass | TFPCustomBrushClass - class of TFPCustomBrush
TFPCustomFontClass | TFPCustomFontClass - class of TFPCustomFont
TFPCustomPenClass | TFPCustomPenClass - class of TFPCustomPen
TFPPenMode | TFPPenMode - Black, White, Nop, Not, Copy, NotCopy, MergePenNot, MaskPenNot, MergeNotPen, MaskNotPen, Merge, NotMerge, Mask, NotMask, Xor, NotXor
TFPPenStyle | TFPPenStyle - Solid, Dash, Dot, DashDot, DashDotDot, insideFrame, Pattern, Clear
TFPPenStyleSet | TFPPenStyleSet - set of TFPPenStyle
TPenPattern |


Reference for unit 'FPCanvas': Classes

TFPBaseInterpolation | TFPBaseInterpolation - the default interpolation to be applied if no other is specified
TFPBrushException | TFPBrushException - exception handler for FreePascal base Brush class
TFPCanvasException | TFPCanvasException - exception handler for FreePascal base Canvas class
TFPCanvasHelper | TFPCanvasHelper - FreePascal base class providing utilities for drawing and painting canvases
TFPCustomBrush | TFPCustomBrush - FreePascal base class for Brushes
TFPCustomCanvas | TFPCustomCanvas - FreePascal base class for Canvas
TFPCustomDrawBrush | TFPCustomDrawBrush - base class for brush used for drawing
TFPCustomDrawFont | TFPCustomDrawFont - base class for drawing fonts
TFPCustomDrawPen | TFPCustomDrawPen - base class for pen used for drawing figures
TFPCustomFont | TFPCustomFont - FreePascal base class for Fonts
TFPCustomInterpolation | TFPCustomInterpolation - FreePascal base class for interpolations while drawing in unspecified regions between specified points
TFPCustomPen | TFPCustomPen - FreePascal base class for Pens
TFPEmptyBrush | TFPEmptyBrush - dummy class for empty brush
TFPEmptyFont | TFPEmptyFont - dummy class for empty font
TFPEmptyPen | TFPEmptyPen - dummy class for empty pen
TFPFontException | TFPFontException exception handler for FreePascal base Font class
TFPPenException | TFPPenException - exception handler for FreePascal base Pen class
TMitchelInterpolation | TMitchelInterpolation - one possible algorithm for interpolation


Reference for unit 'FPCanvas': Procedures and functions

DecRect

IncRect


Index of all identifiers in unit 'FPCanvas'

B D I P T

B

bsBDiagonal | bsFDiagonal | bsSolid
bsClear | bsHorizontal | bsVertical
bsCross | bsImage |
bsDiagCross | bsPattern |

D

DecRect

I

IncRect

P

PatternBitCount | pmMergePenNot | psClear
PBrushPattern | pmNop | psDash
pmBlack | pmNot | psDashDot
pmCopy | pmNotCopy | psDashDotDot
pmMask | pmNotMask | psDot
pmMaskNotPen | pmNotMerge | psinsideFrame
pmMaskPenNot | pmNotXor | psPattern
pmMerge | pmWhite | psSolid
pmMergeNotPen | pmXor |

T

TBrushPattern | TFPCustomDrawBrush | TFPEmptyFont
TFPBaseInterpolation | TFPCustomDrawFont | TFPEmptyPen
TFPBrushException | TFPCustomDrawPen | TFPFontException
TFPBrushStyle | TFPCustomFont | TFPPenException
TFPCanvasException | TFPCustomFontClass | TFPPenMode
TFPCanvasHelper | TFPCustomInterpolation | TFPPenStyle
TFPCustomBrush | TFPCustomPen | TFPPenStyleSet
TFPCustomBrushClass | TFPCustomPenClass | TMitchelInterpolation
TFPCustomCanvas | TFPEmptyBrush | TPenPattern


PatternBitCount

Declaration

Source position: fpcanvas.pp line 23

const PatternBitCount = sizeof ( longword ) * 8;


PBrushPattern

Declaration

Source position: fpcanvas.pp line 137

type PBrushPattern = ^TBrushPattern;


TBrushPattern

Declaration

Source position: fpcanvas.pp line 136

type TBrushPattern = array [0..PatternBitCount-1] of TPenPattern;


TFPBrushStyle

TFPBrushStyle - Solid, Clear, Horizontal, Vertical, FDiagonal, BDiagonal, Cross, DiagCross, Image, Pattern

Declaration

Source position: fpcanvas.pp line 134

type TFPBrushStyle = (

  bsSolid,

  bsClear,

  bsHorizontal,

  bsVertical,

  bsFDiagonal,

  bsBDiagonal,

  bsCross,

  bsDiagCross,

  bsImage,

  bsPattern

);


TFPPenMode

TFPPenMode - Black, White, Nop, Not, Copy, NotCopy, MergePenNot, MaskPenNot, MergeNotPen, MaskNotPen, Merge, NotMerge, Mask, NotMask, Xor, NotXor

Declaration

Source position: fpcanvas.pp line 107

type TFPPenMode = (

  pmBlack,

  pmWhite,

  pmNop,

  pmNot,

  pmCopy,

  pmNotCopy,

  pmMergePenNot,

  pmMaskPenNot,

  pmMergeNotPen,

  pmMaskNotPen,

  pmMerge,

  pmNotMerge,

  pmMask,

  pmNotMask,

  pmXor,

  pmNotXor

);


TFPPenStyle

TFPPenStyle - Solid, Dash, Dot, DashDot, DashDotDot, insideFrame, Pattern, Clear

Declaration

Source position: fpcanvas.pp line 105

type TFPPenStyle = (

  psSolid,

  psDash,

  psDot,

  psDashDot,

  psDashDotDot,

  psinsideFrame,

  psPattern,

  psClear

);


TFPPenStyleSet

TFPPenStyleSet - set of TFPPenStyle

Declaration

Source position: fpcanvas.pp line 106

type TFPPenStyleSet = set of (

  psSolid,

  psDash,

  psDot,

  psDashDot,

  psDashDotDot,

  psinsideFrame,

  psPattern,

  psClear

);


TPenPattern

Declaration

Source position: fpcanvas.pp line 110

type TPenPattern = LongWord;


alphaOpaque

Declaration

Source position: fpcolors.inc line 20

const alphaOpaque = $FFFF;


alphaTransparent

Declaration

Source position: fpcolors.inc line 19

const alphaTransparent = $0000;


BytesNeeded

Declaration

Source position: fpcolors.inc line 16

const BytesNeeded: array [TColorFormat] of Byte = (1,1,1,1,2,3,1,2,4,2,2,3,4,6,1,2,4,8,2,2,3,4,6,1,2,4,8 );


colAqua

Declaration

Source position: fpcolors.inc line 48

const colAqua: TFPColor = (Red:$0000;Green:$ffff;Blue:$ffff;Alpha:alphaOpaque );


colBlack

Declaration

Source position: fpcolors.inc line 22

const colBlack: TFPColor = (Red:$0000;Green:$0000;Blue:$0000;Alpha:alphaOpaque );


colBlue

Declaration

Source position: fpcolors.inc line 23

const colBlue: TFPColor = (Red:$0000;Green:$0000;Blue:$ffff;Alpha:alphaOpaque );


colCyan

Declaration

Source position: fpcolors.inc line 25

const colCyan: TFPColor = (Red:$0000;Green:$ffff;Blue:$ffff;Alpha:alphaOpaque );


colDkBlue

Declaration

Source position: fpcolors.inc line 33

const colDkBlue: TFPColor = (Red:$0000;Green:$0000;Blue:$8000;Alpha:alphaOpaque );


colDkCyan

Declaration

Source position: fpcolors.inc line 35

const colDkCyan: TFPColor = (Red:$0000;Green:$8000;Blue:$8000;Alpha:alphaOpaque );


colDkGray

Declaration

Source position: fpcolors.inc line 32

const colDkGray: TFPColor = (Red:$4000;Green:$4000;Blue:$4000;Alpha:alphaOpaque );


colDkGreen

Declaration

Source position: fpcolors.inc line 34

const colDkGreen: TFPColor = (Red:$0000;Green:$8000;Blue:$0000;Alpha:alphaOpaque );


colDkMagenta

Declaration

Source position: fpcolors.inc line 37

const colDkMagenta: TFPColor = (Red:$8000;Green:$0000;Blue:$8000;Alpha:alphaOpaque );


colDkRed

Declaration

Source position: fpcolors.inc line 36

const colDkRed: TFPColor = (Red:$8000;Green:$0000;Blue:$0000;Alpha:alphaOpaque );


colDkYellow

Declaration

Source position: fpcolors.inc line 38

const colDkYellow: TFPColor = (Red:$8000;Green:$8000;Blue:$0000;Alpha:alphaOpaque );


colFuchsia

Declaration

Source position: fpcolors.inc line 47

const colFuchsia: TFPColor = (Red:$ffff;Green:$0000;Blue:$ffff;Alpha:alphaOpaque );


colGray

Declaration

Source position: fpcolors.inc line 30

const colGray: TFPColor = (Red:$8000;Green:$8000;Blue:$8000;Alpha:alphaOpaque );


colGreen

Declaration

Source position: fpcolors.inc line 24

const colGreen: TFPColor = (Red:$0000;Green:$ffff;Blue:$0000;Alpha:alphaOpaque );


colLime

Declaration

Source position: fpcolors.inc line 46

const colLime: TFPColor = (Red:$0000;Green:$ffff;Blue:$0000;Alpha:alphaOpaque );


colLtGray

Declaration

Source position: fpcolors.inc line 31

const colLtGray: TFPColor = (Red:$c000;Green:$c000;Blue:$c000;Alpha:alphaOpaque );


colLtGreen

Declaration

Source position: fpcolors.inc line 40

const colLtGreen: TFPColor = (Red:$0000;Green:$8000;Blue:$0000;Alpha:alphaOpaque );


colMagenta

Declaration

Source position: fpcolors.inc line 27

const colMagenta: TFPColor = (Red:$ffff;Green:$0000;Blue:$ffff;Alpha:alphaOpaque );


colMaroon

Declaration

Source position: fpcolors.inc line 39

const colMaroon: TFPColor = (Red:$8000;Green:$0000;Blue:$0000;Alpha:alphaOpaque );


colNavy

Declaration

Source position: fpcolors.inc line 42

const colNavy: TFPColor = (Red:$0000;Green:$0000;Blue:$8000;Alpha:alphaOpaque );


colOlive

Declaration

Source position: fpcolors.inc line 41

const colOlive: TFPColor = (Red:$8000;Green:$8000;Blue:$0000;Alpha:alphaOpaque );


colPurple

Declaration

Source position: fpcolors.inc line 43

const colPurple: TFPColor = (Red:$8000;Green:$0000;Blue:$8000;Alpha:alphaOpaque );


colRed

Declaration

Source position: fpcolors.inc line 26

const colRed: TFPColor = (Red:$ffff;Green:$0000;Blue:$0000;Alpha:alphaOpaque );


colSilver

Declaration

Source position: fpcolors.inc line 45

const colSilver: TFPColor = (Red:$c000;Green:$c000;Blue:$c000;Alpha:alphaOpaque );


colTeal

Declaration

Source position: fpcolors.inc line 44

const colTeal: TFPColor = (Red:$0000;Green:$8000;Blue:$8000;Alpha:alphaOpaque );


colTransparent

Declaration

Source position: fpcolors.inc line 21

const colTransparent: TFPColor = (Red:$0000;Green:$0000;Blue:$0000;Alpha:alphaTransparent );


colWhite

Declaration

Source position: fpcolors.inc line 29

const colWhite: TFPColor = (Red:$ffff;Green:$ffff;Blue:$ffff;Alpha:alphaOpaque );


colYellow

Declaration

Source position: fpcolors.inc line 28

const colYellow: TFPColor = (Red:$ffff;Green:$ffff;Blue:$0000;Alpha:alphaOpaque );


ErrorText

Declaration

Source position: fpimage.pp line 301

const ErrorText: array [TErrorTextIndices] of String = ('Invalid %s index %d','No image to write','File "%s" does not exist','No stream to write to','palette','horizontal pixel','vertical pixel','extra','Image type "%s" already exists','Image type "%s" already has a reader class','Image type "%s" already has a writer class','Error while determining image type of stream: %s','Can''t determine image type of stream','Error while reading stream: %s','Error while writing stream: %s','No palette available' );


GCM_JPEG

Declaration

Source position: fpimage.pp line 332

const GCM_JPEG: TGrayConvMatrix = (red:0.299;green:0.587;blue:0.114 );


GCM_Mathematical

Declaration

Source position: fpimage.pp line 333

const GCM_Mathematical: TGrayConvMatrix = (red:0.334;green:0.333;blue:0.333 );


GCM_NTSC

Declaration

Source position: fpimage.pp line 331

const GCM_NTSC: TGrayConvMatrix = (red:0.299;green:0.587;blue:0.114 );


GCM_Photoshop

Declaration

Source position: fpimage.pp line 334

const GCM_Photoshop: TGrayConvMatrix = (red:0.213;green:0.715;blue:0.072 );


GrayConvMatrix

Declaration

Source position: fpimage.pp line 328

var GrayConvMatrix: TGrayConvMatrix;


ImageHandlers

Declaration

Source position: fpimage.pp line 277

var ImageHandlers: TImageHandlersManager;


Reference for unit 'FPimage'

uses

  sysutils,

  Classes;


Reference for unit 'FPimage': Constants

alphaOpaque

alphaTransparent

BytesNeeded

colAqua

colBlack

colBlue

colCyan

colDkBlue

colDkCyan

colDkGray

colDkGreen

colDkMagenta

colDkRed

colDkYellow

colFuchsia

colGray

colGreen

colLime

colLtGray

colLtGreen

colMagenta

colMaroon

colNavy

colOlive

colPurple

colRed

colSilver

colTeal

colTransparent

colWhite

colYellow

ErrorText

GCM_JPEG

GCM_Mathematical

GCM_NTSC

GCM_Photoshop


Reference for unit 'FPimage': Types

PColorData
PFPColor | PFPColor - pointer to a TFPColor
PFPColorArray
PFPIntegerArray | PFPIntegerArray - pointer to an integer array
TColorData
TColorFormat
TDeviceColor
TErrorTextIndices
TFPColor | TFPColor - record type used as an internal representation for a colour: a TColor has been decomposed into its component Red, Green, Blue and Alpha parts, to allow easy manipulation of each
TFPColorArray
TFPCustomImageClass | TFPCustomImageClass - class of TFPCustomImage
TFPCustomImageReaderClass | TFPCustomImageReaderClass - class of TFPCustomImageReader
TFPCustomImageWriterClass | TFPCustomImageWriterClass - class of TFPCustomImageWriter
TFPImgProgressEvent
TFPImgProgressStage
TFPIntegerArray | TFPIntegerArray - definition of integer array for use in images
TGrayConvMatrix
TProgressEvent
TProgressStage


Reference for unit 'FPimage': Classes

FPImageException
TFPCustomImage | TFPCustomImage - FreePascal base definition for all Image classes
TFPCustomImageHandler | TFPCustomImageHandler FreePascal base class for handling images
TFPCustomImageReader | TFPCustomImageReader - FreePascal base class for Image reading
TFPCustomImageWriter | TFPCustomImageWriter - FreePascal base class for writing image data
TFPMemoryImage | TFPMemoryImage - FreePascal base class for an image held in memory
TFPPalette | TFPPalette - FreePascal Palette definition: base for LCL TPalette etc
TIHData | TIHData - data for Image Handler
TImageHandlersManager | TImageHandlersManager - class for managing image handlers


Reference for unit 'FPimage': Procedures and functions

CalculateGray

CompareColors

CreateBlackAndWhitePalette

CreateGrayScalePalette

CreateVGAPalette

CreateWebSafePalette

FPColor

operator =(TFPColor, TFPColor): Boolean

operator and(TFPColor, TFPColor): TFPColor

operator or(TFPColor, TFPColor): TFPColor

operator xor(TFPColor, TFPColor): TFPColor


Reference for unit 'FPimage': Variables

GrayConvMatrix

ImageHandlers


Index of all identifiers in unit 'FPimage'

A B C E F G I O P S T

A

alphaOpaque alphaTransparent

B

BytesNeeded

C

CalculateGray | cfRGB24 | colLime
cfABGR16 | cfRGB32 | colLtGray
cfABGR32 | cfRGB48 | colLtGreen
cfABGR64 | cfRGBA16 | colMagenta
cfABGR8 | cfRGBA32 | colMaroon
cfBGR15 | cfRGBA64 | colNavy
cfBGR16 | cfRGBA8 | colOlive
cfBGR24 | colAqua | colPurple
cfBGR32 | colBlack | colRed
cfBGR48 | colBlue | colSilver
cfGray16 | colCyan | colTeal
cfGray2 | colDkBlue | colTransparent
cfGray24 | colDkCyan | colWhite
cfGray4 | colDkGray | colYellow
cfGray8 | colDkGreen | CompareColors
cfGrayA16 | colDkMagenta | CreateBlackAndWhitePalette
cfGrayA32 | colDkRed | CreateGrayScalePalette
cfGrayA8 | colDkYellow | CreateVGAPalette
cfMono | colFuchsia | CreateWebSafePalette
cfRGB15 | colGray |
cfRGB16 | colGreen |

E

ErrorText

F

FPColor FPImageException

G

GCM_JPEG | GCM_NTSC | GrayConvMatrix
GCM_Mathematical | GCM_Photoshop |

I

ImageHandlers

O

operator =(TFPColor, TFPColor): Boolean | operator or(TFPColor, TFPColor): TFPColor
operator and(TFPColor, TFPColor): TFPColor | operator xor(TFPColor, TFPColor): TFPColor

P

PColorData | PFPIntegerArray | psStarting
PFPColor | psEnding |
PFPColorArray | psRunning |

S

StrCantDetermineType | StrNoFile | StrTypeAlreadyExist
StrImageExtra | StrNoImageToWrite | StrTypeReaderAlreadyExist
StrImageX | StrNoPaletteAvailable | StrTypeWriterAlreadyExist
StrImageY | StrNoStream | StrWriteWithError
StrInvalidIndex | StrPalette |
StrNoCorrectReaderFound | StrReadWithError |

T

TColorData | TFPCustomImageHandler | TFPMemoryImage
TColorFormat | TFPCustomImageReader | TFPPalette
TDeviceColor | TFPCustomImageReaderClass | TGrayConvMatrix
TErrorTextIndices | TFPCustomImageWriter | TIHData
TFPColor | TFPCustomImageWriterClass | TImageHandlersManager
TFPColorArray | TFPImgProgressEvent | TProgressEvent
TFPCustomImage | TFPImgProgressStage | TProgressStage
TFPCustomImageClass | TFPIntegerArray |


PColorData

Declaration

Source position: fpimage.pp line 42

type PColorData = ^TColorData;


PFPColor

PFPColor - pointer to a TFPColor

Declaration

Source position: fpimage.pp line 33

type PFPColor = ^TFPColor;


PFPColorArray

Declaration

Source position: fpimage.pp line 58

type PFPColorArray = ^TFPColorArray;


PFPIntegerArray

PFPIntegerArray - pointer to an integer array

Declaration

Source position: fpimage.pp line 162

type PFPIntegerArray = ^TFPIntegerArray;


TColorData

Declaration

Source position: fpimage.pp line 41

type TColorData = qword;


TColorFormat

Declaration

Source position: fpimage.pp line 35

type TColorFormat = (

  cfMono,

  cfGray2,

  cfGray4,

  cfGray8,

  cfGray16,

  cfGray24,

  cfGrayA8,

  cfGrayA16,

  cfGrayA32,

  cfRGB15,

  cfRGB16,

  cfRGB24,

  cfRGB32,

  cfRGB48,

  cfRGBA8,

  cfRGBA16,

  cfRGBA32,

  cfRGBA64,

  cfBGR15,

  cfBGR16,

  cfBGR24,

  cfBGR32,

  cfBGR48,

  cfABGR8,

  cfABGR16,

  cfABGR32,

  cfABGR64

);


TDeviceColor

Declaration

Source position: fpimage.pp line 44

type TDeviceColor = record

  Fmt: TColorFormat;

  Data: TColorData;

end;


TErrorTextIndices

Declaration

Source position: fpimage.pp line 280

type TErrorTextIndices = (

  StrInvalidIndex,

  StrNoImageToWrite,

  StrNoFile,

  StrNoStream,

  StrPalette,

  StrImageX,

  StrImageY,

  StrImageExtra,

  StrTypeAlreadyExist,

  StrTypeReaderAlreadyExist,

  StrTypeWriterAlreadyExist,

  StrCantDetermineType,

  StrNoCorrectReaderFound,

  StrReadWithError,

  StrWriteWithError,

  StrNoPaletteAvailable

);


TFPColor

TFPColor - record type used as an internal representation for a colour: a TColor has been decomposed into its component Red, Green, Blue and Alpha parts, to allow easy manipulation of each

Declaration

Source position: fpimage.pp line 30

type TFPColor = record

  red: Word;

  green: Word;

  blue: Word;

  alpha: Word;

end;


TFPColorArray

Declaration

Source position: fpimage.pp line 56

type TFPColorArray = array [0..(maxint-1)divsizeof(TFPColor)-1] of TFPColor;


TFPImgProgressEvent

Declaration

Source position: fpimage.pp line 61

type TFPImgProgressEvent = procedure(

  Sender: TObject;

  Stage: TFPImgProgressStage;

  PercentDone: Byte;

  RedrawNow: Boolean;

  const R: TRect;

  const Msg: AnsiString;

  var Continue: Boolean

) of object;


TFPImgProgressStage

Declaration

Source position: fpimage.pp line 60

type TFPImgProgressStage = (

  psStarting,

  psRunning,

  psEnding

);


TFPIntegerArray

TFPIntegerArray - definition of integer array for use in images

Declaration

Source position: fpimage.pp line 160

type TFPIntegerArray = array [0..(maxint-1)divsizeof(integer)-1] of Integer;


TGrayConvMatrix

Declaration

Source position: fpimage.pp line 323

type TGrayConvMatrix = record

  red: single;

  green: single;

  blue: single;

end;


TProgressEvent

Declaration

Source position: fpimage.pp line 66

type TProgressEvent = TFPImgProgressEvent;


TProgressStage

Declaration

Source position: fpimage.pp line 65

type TProgressStage = TFPImgProgressStage;


DefaultTimerDriverClass

Actual timer class to be used

Declaration

Source position: fptimer.pp line 83

var DefaultTimerDriverClass: TFPTimerDriverClass = nil;

Description

DefaultTimerDriverClass contains the TFPTimerDriver class pointer that should be used when a new instance of TFPCustomTimer is created. It is by default set to the system timer class.

Setting this class pointer to another descendent of TFPTimerDriver allows to customize the default timer implementation used in the entire application.

See also

TFPTimerDriver | Abstract driver class
TFPCustomTimer | Custom timer class


Reference for unit 'fpTimer'

Timer class

uses

  Classes;

Overview

The fpTimer unit implements a timer class TFPTimer which can be used on all supported platforms. The timer class uses a driver class TFPTimerDriver which does the actual work.

A default timer driver class is implemented on all platforms. It will work in GUI and non-gui applications, but only in the application's main thread.

An alternative driver class can be used by setting the DefaultTimerDriverClass variable to the class pointer of the driver class. The driver class should descend from TFPTimerDriver.


Reference for unit 'fpTimer': Types

TFPTimerDriverClass

Class of TFPTimerDriver


Reference for unit 'fpTimer': Classes

TFPCustomTimer | Custom timer class
TFPTimer | Timer class with published properties
TFPTimerDriver | Abstract driver class


Reference for unit 'fpTimer': Variables

DefaultTimerDriverClass

Actual timer class to be used


Index of all identifiers in unit 'fpTimer'

D T

D

DefaultTimerDriverClass

T

TFPCustomTimer | TFPTimerDriver
TFPTimer | TFPTimerDriverClass


Reference for unit 'gettext'

Unit implementing resource string translation using gettext files

uses

  sysutils,

  Classes;

Overview

The gettext unit can be used to hook into the resource string mechanism of Free Pascal to provide translations of the resource strings, based on the GNU gettext mechanism. The unit provides a class (TMOFile) to read the .mo files with localizations for various languages. It also provides a couple of calls to translate all resource strings in an application based on the translations in a .mo file.


Reference for unit 'gettext': Constants

MOFileHeaderMagic

file header bytes indicating a .mo file.


Reference for unit 'gettext': Types

PLongWordArray | Pointer to a TLongWordArray array.
PMOStringTable | Pointer to a TMOStringTable array.
PPCharArray | Pointer to a TPCharArray array.
TLongWordArray | Array of longword elements.
TMOFileHeader | Structure found at the head of a .mo file.
TMOStringInfo | Structure describing string
TMOStringTable | Array of TMOStringInfo records.
TPCharArray | Array of PChar elements


Reference for unit 'gettext': Classes

EMOFileError | Exception raised in case of an error.
TMOFile | Class providing access to a .mo file.


Reference for unit 'gettext': Procedures and functions

GetLanguageIDs | Return the current language IDs
TranslateResourceStrings | Translate the resource strings of the application.
TranslateUnitResourceStrings | Translate the resource strings of a unit.


Index of all identifiers in unit 'gettext'

E G M P T

E

EMOFileError

G

GetLanguageIDs

M

MOFileHeaderMagic

P

PLongWordArray PMOStringTable PPCharArray

T

TLongWordArray | TMOStringInfo | TranslateResourceStrings
TMOFile | TMOStringTable | TranslateUnitResourceStrings
TMOFileHeader | TPCharArray |


MOFileHeaderMagic

file header bytes indicating a .mo file.

Declaration

Source position: gettext.pp line 26

const MOFileHeaderMagic = $950412de;

Description

This constant is found as the first integer in a .mo

See also

TMOFileHeader

Structure found at the head of a .mo file.


PLongWordArray

Pointer to a TLongWordArray array.

Declaration

Source position: gettext.pp line 50

type PLongWordArray = ^TLongWordArray;


PMOStringTable

Pointer to a TMOStringTable array.

Declaration

Source position: gettext.pp line 46

type PMOStringTable = ^TMOStringTable;


PPCharArray

Pointer to a TPCharArray array.

Declaration

Source position: gettext.pp line 53

type PPCharArray = ^TPCharArray;


TLongWordArray

Array of longword elements.

Declaration

Source position: gettext.pp line 49

type TLongWordArray = array [0..(1shl30)divSizeOf(LongWord)] of LongWord;

Description

TLongWordArray is an array used to define the PLongWordArray pointer. A variable of type TLongWordArray should never be directly declared, as it would occupy too much memory. The PLongWordArray type can be used to allocate a dynamic number of elements.

See also

PLongWordArray

Pointer to a TLongWordArray array.


TMOStringInfo

Structure describing string

Declaration

Source position: gettext.pp line 40

type TMOStringInfo = packed record
length: LongWord; | Length of the string
offset: LongWord; | Offset in the file
end;

Description

This record is one element in the string tables describing the original and translated strings. It describes the position and length of the string. The location of these tables is stored in the TMOFileHeader record at the start of the file.

See also

TMOFileHeader

Structure found at the head of a .mo file.


TMOStringTable

Array of TMOStringInfo records.

Declaration

Source position: gettext.pp line 45

type TMOStringTable = array [0..(1shl30)divSizeOf(TMOStringInfo)] of TMOStringInfo;

Description

TMOStringTable is an array type containing TMOStringInfo records. It should never be used directly, as it would occupy too much memory.

See also

PMOStringTable

Pointer to a TMOStringTable array.


TPCharArray

Array of PChar elements

Declaration

Source position: gettext.pp line 52

type TPCharArray = array [0..(1shl30)divSizeOf(PChar)] of PChar;

Description

TLongWordArray is an array used to define the PPCharArray pointer. A variable of type TPCharArray should never be directly declared, as it would occupy too much memory. The PPCharArray type can be used to allocate a dynamic number of elements.

See also

PPCharArray

Pointer to a TPCharArray array.


IDEABLOCKSIZE

IDEA block size

Declaration

Source position: idea.pp line 53

const IDEABLOCKSIZE = 8;

See also

IDEAKEYSIZE

IDEA Key size constant.


IdeaCryptData

Alias for for TIDEACryptData

Declaration

Source position: idea.pp line 65

type IdeaCryptData = TIdeaCryptData;

Description

Provided for backward functionality.

See also

TIDEACryptData

Buffer type to hold encryption data.


IdeaCryptKey

Alias for for TIDEACryptKey

Declaration

Source position: idea.pp line 64

type IdeaCryptKey = TIdeaCryptKey;

Description

Provided for backward functionality.

See also

TIDEACryptKey

Type for holding an encyption/decryption IDEA key.


IDEAkey

Alias for TIDEAKey

Declaration

Source position: idea.pp line 63

type IDEAkey = TIDEAKey;

Description

Provided for backward functionality.

See also

TIDEAKey

Type for holding a user IDEA key


IDEAKEYSIZE

IDEA Key size constant.

Declaration

Source position: idea.pp line 52

const IDEAKEYSIZE = 16;

See also

IDEABLOCKSIZE

IDEA block size


Reference for unit 'idea'

The IDEA unit provides IDEA encryption support

uses

  sysutils,

  Classes;

Overview

Besides some low level IDEA encryption routines, the IDEA unit also offers 2 streams which offer on-the-fly encryption or decryption: there are 2 stream objects: A write-only encryption stream which encrypts anything that is written to it, and a decription stream which decrypts anything that is read from it.


Reference for unit 'idea': Constants

IDEABLOCKSIZE | IDEA block size
IDEAKEYSIZE | IDEA Key size constant.
KEYLEN | Key length
ROUNDS | Number of rounds to encrypt


Reference for unit 'idea': Types

IdeaCryptData | Alias for for TIDEACryptData
IdeaCryptKey | Alias for for TIDEACryptKey
IDEAkey | Alias for TIDEAKey
TIdeaCryptData | Buffer type to hold encryption data.
TIdeaCryptKey | Type for holding an encyption/decryption IDEA key.
TIDEAKey | Type for holding a user IDEA key


Reference for unit 'idea': Classes

EIDEAError | Exception for IDEA Stream errors.
TIDEADeCryptStream | IDEA Decryption stream.
TIDEAEncryptStream | IDEA encryption stream.
TIDEAStream | Ancestor stream for IDEA encryption/decryption streams.


Reference for unit 'idea': Procedures and functions

CipherIdea | Encrypt or decrypt a buffer.
DeKeyIdea | Create a decryption key from an encryption key.
EnKeyIdea | Create an IDEA encryption key from a user key.


Index of all identifiers in unit 'idea'

C D E I K R T

C

CipherIdea

D

DeKeyIdea

E

EIDEAError EnKeyIdea

I

IDEABLOCKSIZE | IdeaCryptKey | IDEAKEYSIZE
IdeaCryptData | IDEAkey |

K

KEYLEN

R

ROUNDS

T

TIdeaCryptData | TIDEADeCryptStream | TIDEAKey
TIdeaCryptKey | TIDEAEncryptStream | TIDEAStream


KEYLEN

Key length

Declaration

Source position: idea.pp line 55

const KEYLEN = (6 * ROUNDS + 4 );

See also

IDEAKEYSIZE | IDEA Key size constant.
IDEABLOCKSIZE | IDEA block size
ROUNDS | Number of rounds to encrypt


ROUNDS

Number of rounds to encrypt

Declaration

Source position: idea.pp line 54

const ROUNDS = 8;


TIdeaCryptData

Buffer type to hold encryption data.

Declaration

Source position: idea.pp line 60

type TIdeaCryptData = array [0..3] of Word;

Description

TIdeaCryptData is an internal type, defined to hold data for encryption/decryption.

See also

TIdeaCryptKey | Type for holding an encyption/decryption IDEA key.
TIDEAKey | Type for holding a user IDEA key


TIdeaCryptKey

Type for holding an encyption/decryption IDEA key.

Declaration

Source position: idea.pp line 59

type TIdeaCryptKey = array [0..7] of Word;

Description

The actual encryption or decryption key for IDEA is 64-bit long. This type is used to hold such a key. It can be generated with the EnKeyIDEA or DeKeyIDEA algorithms depending on whether an encryption or decryption key is needed.

See also

EnKeyIDEA | Create an IDEA encryption key from a user key.
DeKeyIDEA | Create a decryption key from an encryption key.


TIDEAKey

Type for holding a user IDEA key

Declaration

Source position: idea.pp line 58

type TIDEAKey = array [0..keylen-1] of Word;

Description

The IDEA key should be filled by the user with some random data (say, a passphrase). This key is used to generate the actual encryption/decryption keys.

See also

TIdeaCryptKey | Type for holding an encyption/decryption IDEA key.
TIdeaCryptData | Buffer type to hold encryption data.


Reference for unit 'inicol'

Collection which can write itself to inifile.

uses

  sysutils,

  Classes,

  Inifiles;

Ini files support

Overview

inicol contains an implementation of TCollection and TCollectionItem descendents which cooperate to read and write the collection from and to a .ini file. It uses the TCustomIniFile class for this.


Reference for unit 'inicol': Constants

KeyCount | Name used for the count item
SGlobal | Default global section name


Reference for unit 'inicol': Classes

EIniCol | Exception used for error reporting.
TIniCollection | Collection which can write itself to an .ini file
TIniCollectionItem | Collection item with support for loading/saving from/to ini file
TNamedIniCollection | Collection of named collection items
TNamedIniCollectionItem | TIniCollectionItem with a name property


Index of all identifiers in unit 'inicol'

E K S T

E

EIniCol

K

KeyCount

S

SGlobal

T

TIniCollection | TNamedIniCollection
TIniCollectionItem | TNamedIniCollectionItem


KeyCount

Name used for the count item

Declaration

Source position: inicol.pp line 79

const KeyCount = 'Count';

Description

KeyCount is used as a key name when reading or writing the number of items in the collection from the global section.


SGlobal

Default global section name

Declaration

Source position: inicol.pp line 80

const SGlobal = 'Global';

Description

SGlobal is used as the default name of the global section when reading or writing the collection.


Reference for unit 'IniFiles'

Ini files support

uses

  Classes,

  sysutils,

  contnrs;

Various general purpose classes: stack, queue, objectlists

Overview

IniFiles provides support for handling .ini files. It contains an implementation completely independent of the Windows API for handling such files. The basic (abstract) functionality is defined in TCustomInifile and is implemented in TIniFile and TMemIniFile. The API presented by these components is Delphi compatible.


Reference for unit 'IniFiles': Classes

TCustomIniFile | Abstract ini file object
THashedStringList | String list with support for has values
TIniFile | Ini file implementation
TIniFileKey | Object representing a key=value pair in the ini file.
TIniFileKeyList | Key list object
TIniFileSection | Ini file section object
TIniFileSectionList | Section objects list
TMemIniFile | Inifile cached in memory


Index of all identifiers in unit 'IniFiles'

T

T

TCustomIniFile | TIniFileKey | TIniFileSectionList
THashedStringList | TIniFileKeyList | TMemIniFile
TIniFile | TIniFileSection |


Reference for unit 'iostream'

Implement streams for handling standard input, output and stderr

uses

  Classes;

Overview

The iostream implements a descendent of THandleStream streams that can be used to read from standard input and write to standard output and standard diagnostic output (stderr).


Reference for unit 'iostream': Types

TIOSType

Type of stream to create


Reference for unit 'iostream': Classes

EIOStreamError | Error thrown in case of an invalid operation on a TIOStream.
TIOStream | Stream which handles standard input/output and stderr.


Index of all identifiers in unit 'iostream'

E I T

E

EIOStreamError

I

iosError iosInput iosOutPut

T

TIOStream TIOSType


TIOSType

Type of stream to create

Declaration

Source position: iostream.pp line 22

type TIOSType = (
iosInput, | The stream can be used to read from standard input
iosOutPut, | The stream can be used to write to standard output
iosError | The stream can be used to write to standard diagnostic output
);

Description

TIOSType is passed to the Create constructor of TIOStream, it determines what kind of stream is created.

See also

TIOStream

Stream which handles standard input/output and stderr.


ALL_PERMISSIONS

Set with all permissions

Declaration

Source position: libtar.pp line 215

const ALL_PERMISSIONS = [tpReadByOwner,tpWriteByOwner,tpExecuteByOwner,tpReadByGroup,tpWriteByGroup,tpExecuteByGroup,tpReadByOther,tpWriteByOther,tpExecuteByOther];

Description

ALL_PERMISSIONS is a set constant containing all possible permissions (read/write/execute, for all groups of users) for an archive entry.

See also

TTarPermissions | Complete set of permissions for file
READ_PERMISSIONS | Set with all read permissions
WRITE_PERMISSIONS | Set with all write permissions
EXECUTE_PERMISSIONS | Set with all execute permissions


EXECUTE_PERMISSIONS

Set with all execute permissions

Declaration

Source position: libtar.pp line 220

const EXECUTE_PERMISSIONS = [tpExecuteByOwner,tpExecuteByGroup,tpExecuteByOther];

Description

WRITE_PERMISSIONS is a set constant containing all possible execute permissions set for an archive entry.

See also

TTarPermissions | Complete set of permissions for file
ALL_PERMISSIONS | Set with all permissions
READ_PERMISSIONS | Set with all read permissions
WRITE_PERMISSIONS | Set with all write permissions


FILETYPE_NAME

Names of filetypes

Declaration

Source position: libtar.pp line 211

const FILETYPE_NAME: array [TFileType] of String = ('Regular','Link','Symbolic Link','Char File','Block File','Directory','FIFO File','Contiguous','Dir Dump','Multivol','Volume Header' );

Description

FILETYPE_NAME can be used to get a textual description for each of the possible entry file types.

See also

TFileType

File type


Reference for unit 'libtar'

tar archive manipulation classes

uses

  UnixType,

  BaseUnix,

  Unix,

  Windows,

  sysutils,

  Classes;

Overview

The libtar units provides 2 classes to read and write .tar archives: TTarArchive class can be used to read a tar file, and the TTarWriter class can be used to write a tar file. The unit was implemented originally by Stefan Heymann.


Reference for unit 'libtar': Constants

ALL_PERMISSIONS | Set with all permissions
EXECUTE_PERMISSIONS | Set with all execute permissions
FILETYPE_NAME | Names of filetypes
READ_PERMISSIONS | Set with all read permissions
WRITE_PERMISSIONS | Set with all write permissions


Reference for unit 'libtar': Types

TFileType | File type
TTarDirRec | Tar Directory entry
TTarMode | Tar mode
TTarModes | Full set of modes
TTarPermission | File permissions
TTarPermissions | Complete set of permissions for file


Reference for unit 'libtar': Classes

TTarArchive | Class to examine and read tar archives
TTarWriter | Class to write tar archives


Reference for unit 'libtar': Procedures and functions

ClearDirRec | Initialize tar archive entry
ConvertFilename | Convert filename to archive format
FileTimeGMT | Extract filetime
PermissionString | Convert a set of permissions to a string


Index of all identifiers in unit 'libtar'

A C E F P R T W

A

ALL_PERMISSIONS

C

ClearDirRec ConvertFilename

E

EXECUTE_PERMISSIONS

F

FileTimeGMT | ftDirectory | ftNormal
FILETYPE_NAME | ftDumpDir | ftSymbolicLink
ftBlock | ftFifo | ftVolumeHeader
ftCharacter | ftLink |
ftContiguous | ftMultiVolume |

P

PermissionString

R

READ_PERMISSIONS

T

TFileType | tpReadByGroup | TTarDirRec
tmSaveText | tpReadByOther | TTarMode
tmSetGid | tpReadByOwner | TTarModes
tmSetUid | tpWriteByGroup | TTarPermission
tpExecuteByGroup | tpWriteByOther | TTarPermissions
tpExecuteByOther | tpWriteByOwner | TTarWriter
tpExecuteByOwner | TTarArchive |

W

WRITE_PERMISSIONS


READ_PERMISSIONS

Set with all read permissions

Declaration

Source position: libtar.pp line 218

const READ_PERMISSIONS = [tpReadByOwner,tpReadByGroup,tpReadByOther];

Description

READ_PERMISSIONS is a set constant containing all possible read permissions set for an archive entry.

See also

TTarPermissions | Complete set of permissions for file
ALL_PERMISSIONS | Set with all permissions
WRITE_PERMISSIONS | Set with all write permissions
EXECUTE_PERMISSIONS | Set with all execute permissions


TFileType

File type

Declaration

Source position: libtar.pp line 114

type TFileType = (
ftNormal, | Normal file
ftLink, | Hard link
ftSymbolicLink, | Symbolic link
ftCharacter, | Character device file
ftBlock, | Block device file
ftDirectory, | Directory
ftFifo, | FIFO file
ftContiguous, | Contiguous file
ftDumpDir, | List of files
ftMultiVolume, | Multi-volume file part
ftVolumeHeader | Volume header, can appear only as first entry in the archive
);

Description

TFileType describes the file type of a file in the archive. It is used in the FileType field of the TTarDirRec record.

See also

TTarDirRec | Tar Directory entry
TTarPermissions | Complete set of permissions for file
TTarModes | Full set of modes


TTarDirRec

Tar Directory entry

Declaration

Source position: libtar.pp line 132

type TTarDirRec = record
Name: String; | File name
Size: Int64; | File size
DateTime: TDateTime; | File time stamp
Permissions: TTarPermissions; | File permissions
FileType: TFileType; | File type
LinkName: String; | Symbolic link target name
UID: Integer; | Owner user ID
GID: Integer; | Owner group ID
UserName: String; | Owner username
GroupName: String; | Owner group name
ChecksumOK: Boolean; | Checksum OK ?
Mode: TTarModes; | Extra file mode bits
Magic: String; | ?
MajorDevNo: Integer; | Major device number
MinorDevNo: Integer; | Minor device number
FilePos: Int64; | Start position of file in archive
end;

Description

TTarDirRec describes an entry in the tar archive. It is similar to a directory entry as in TSearchRec, and is returned by the TTarArchive.FindNext call.

See also

TTarArchive.FindNext

Find next archive entry


TTarMode

Tar mode

Declaration

Source position: libtar.pp line 127

type TTarMode = (
tmSetUid, | File has SetUID bit set.
tmSetGid, | File has SetGID bit set
tmSaveText | Bit $200 is set
);

Description

TTarMode describes extra file modes. It is used in the Mode field of the TTarDirRec record.

See also

TTarDirRec | Tar Directory entry
TTarPermission | File permissions
TTarPermissions | Complete set of permissions for file
TTarModes | Full set of modes


TTarModes

Full set of modes

Declaration

Source position: libtar.pp line 128

type TTarModes = set of (
tmSetUid, | File has SetUID bit set.
tmSetGid, | File has SetGID bit set
tmSaveText | Bit $200 is set
);

Description

TTarModes denotes the full set of permission bits for the file in the field Mode field of the TTarDirRec record.

See also

TTarDirRec

Tar Directory entry


TTarPermission

File permissions

Declaration

Source position: libtar.pp line 108

type TTarPermission = (
tpReadByOwner, | Owner can read the file
tpWriteByOwner, | Owner can write the file
tpExecuteByOwner, | Owner can execute the file
tpReadByGroup, | Group can read the file
tpWriteByGroup, | Group can write the file
tpExecuteByGroup, | Group can execute the file
tpReadByOther, | Other people can read the file.
tpWriteByOther, | Other people can write the file
tpExecuteByOther | Other people can execute the file
);

Description

TTarPermission denotes part of a files permission as it it stored in the .tar archive. Each of these enumerated constants correspond with one of the permission bits from a unix file permission.

See also

TTarPermissions | Complete set of permissions for file
TTarMode | Tar mode
TTarModes | Full set of modes


TTarPermissions

Complete set of permissions for file

Declaration

Source position: libtar.pp line 111

type TTarPermissions = set of (
tpReadByOwner, | Owner can read the file
tpWriteByOwner, | Owner can write the file
tpExecuteByOwner, | Owner can execute the file
tpReadByGroup, | Group can read the file
tpWriteByGroup, | Group can write the file
tpExecuteByGroup, | Group can execute the file
tpReadByOther, | Other people can read the file.
tpWriteByOther, | Other people can write the file
tpExecuteByOther | Other people can execute the file
);

Description

TTarPermissions describes the complete set of permissions that a file has. It is used in the Permissions field of the TTarDirRec record.

See also

TTarDirRec | Tar Directory entry
TFileType | File type
TTarModes | Full set of modes


WRITE_PERMISSIONS

Set with all write permissions

Declaration

Source position: libtar.pp line 219

const WRITE_PERMISSIONS = [tpWriteByOwner,tpWriteByGroup,tpWriteByOther];

Description

WRITE_PERMISSIONS is a set constant containing all possible write permissions set for an archive entry.

See also

TTarPermissions | Complete set of permissions for file
ALL_PERMISSIONS | Set with all permissions
READ_PERMISSIONS | Set with all read permissions
EXECUTE_PERMISSIONS | Set with all execute permissions


ENoSeekMsg

Constant used in EPipeSeek exception.

Declaration

Source position: pipes.pp line 53

const ENoSeekMsg = 'Cannot seek on pipes';


EPipeMsg

Constant used in EPipeCreation exception.

Declaration

Source position: pipes.pp line 52

const EPipeMsg = 'Failed to create pipe.';


Reference for unit 'Pipes'

Unit implementing pipe streams.

uses

  sysutils,

  Classes;

Overview

The Pipes unit implements streams that are wrappers around the OS's pipe functionality. It creates a pair of streams, and what is written to one stream can be read from another.


Reference for unit 'Pipes': Constants

ENoSeekMsg | Constant used in EPipeSeek exception.
EPipeMsg | Constant used in EPipeCreation exception.


Reference for unit 'Pipes': Classes

EPipeCreation | Exception raised when an error occurred during the creation of a pipe pair.
EPipeError | Exception raised when an invalid operation is performed on a pipe stream.
EPipeSeek | Exception raised when an invalid seek operation is attempted on a pipe.
TInputPipeStream | TStream descendent which wraps the read end of a pipe.
TOutputPipeStream | TStream descendent which wraps the write end of a pipe.


Reference for unit 'Pipes': Procedures and functions

CreatePipeHandles | Function to create a set of pipe handles
CreatePipeStreams | Create a pair of pipe stream.


Index of all identifiers in unit 'Pipes'

C E T

C

CreatePipeHandles CreatePipeStreams

E

ENoSeekMsg | EPipeError | EPipeSeek
EPipeCreation | EPipeMsg |

T

TInputPipeStream TOutputPipeStream


Reference for unit 'pooledmm'

Pooled memory manager implementation

uses

  Classes;

Overview

pooledmm is a memory manager class which uses pools of blocks. Since it is a higher-level implementation of a memory manager which works on top of the FPC memory manager, It also offers more debugging and analysis tools. It is used mainly in the LCL and Lazarus IDE.


Reference for unit 'pooledmm': Types

PPooledMemManagerItem | Pointer to TPooledMemManagerItem
TEnumItemsMethod | Callback for EnumerateItems.
TPooledMemManagerItem | Item used in a linked list


Reference for unit 'pooledmm': Classes

TNonFreePooledMemManager | Memory manager for fixed memory blocks which does not free any memory
TPooledMemManager | Pooled memory manager


Index of all identifiers in unit 'pooledmm'

P T

P

PPooledMemManagerItem

T

TEnumItemsMethod | TPooledMemManager
TNonFreePooledMemManager | TPooledMemManagerItem


PPooledMemManagerItem

Pointer to TPooledMemManagerItem

Declaration

Source position: pooledmm.pp line 33

type PPooledMemManagerItem = ^TPooledMemManagerItem;

Description

PPooledMemManagerItem is a pointer type, pointing to a TPooledMemManagerItem item, used in a linked list.

See also

TPooledMemManagerItem | Item used in a linked list
TPooledMemManager | Pooled memory manager


TEnumItemsMethod

Callback for EnumerateItems.

Declaration

Source position: pooledmm.pp line 71

type TEnumItemsMethod = procedure(

  Item: Pointer

) of object;

Arguments

Item

Pointer from the list in TNonFreePooledMemManager.

Description

TEnumItemsMethod is a prototype for the callback used in the TNonFreePooledMemManager.EnumerateItems call. The parameter Item will be set to each of the pointers in the item list of TNonFreePooledMemManager.

See also

TNonFreePooledMemManager.EnumerateItems

Enumerate all items in the list


Reference for unit 'process'

Unit implementing the TProcess component.

uses

  Classes,

  Pipes,

Unit implementing pipe streams.

  sysutils;

Overview

The Process unit contains the code for the TProcess component, a cross-platform component to start and control other programs, offering also access to standard input and output for these programs.

TProcess does not handle wildcard expansion, does not support complex pipelines as in Unix. If this behaviour is desired, the shell can be executed with the pipeline as the command it should execute.


Reference for unit 'process': Types

TProcessOption | Options to be used when a process is started.
TProcessOptions | Set of TProcessOption.
TProcessPriority | type determining the priority of the newly started process.
TShowWindowOptions | Description of the main window of the new process.
TStartupOption | Options determining how the application is started.
TStartupOptions | Set of TStartUpOption.


Reference for unit 'process': Classes

EProcess | Exception raised when an error occurs in a TProcess routine.
TProcess | Class to start and control other processes.


Index of all identifiers in unit 'process'

E P S T

E

EProcess

P

poDebugOnlyThisProcess | poNoConsole | ppHigh
poDebugProcess | poRunSuspended | ppIdle
poDefaultErrorMode | poStderrToOutPut | ppNormal
poNewConsole | poUsePipes | ppRealTime
poNewProcessGroup | poWaitOnExit |

S

suoUseCountChars | swoMaximize | swoShowMaximized
suoUseFillAttribute | swoMinimize | swoShowMinimized
suoUsePosition | swoNone | swoshowMinNOActive
suoUseShowWindow | swoRestore | swoShowNA
suoUseSize | swoShow | swoShowNoActivate
swoHIDE | swoShowDefault | swoShowNormal

T

TProcess | TProcessPriority | TStartupOptions
TProcessOption | TShowWindowOptions |
TProcessOptions | TStartupOption |


TShowWindowOptions

Description of the main window of the new process.

Declaration

Source position: process.pp line 30

type TShowWindowOptions = (
swoNone, | Allow system to position the window.
swoHIDE, | The main window is hidden.
swoMaximize, | The main window is maximized.
swoMinimize, | The main window is minimized.
swoRestore, | Restore the previous position.
swoShow, | Show the main window.
swoShowDefault, | When showing Show the main window on
swoShowMaximized, | The main window is shown maximized
swoShowMinimized, | The main window is shown minimized
swoshowMinNOActive, | The main window is shown minimized but not activated
swoShowNA, | The main window is shown but not activated
swoShowNoActivate, | The main window is shown but not activated
swoShowNormal | The main window is shown normally
);

Description

This type describes what the new process' main window should look like. Most of these have only effect on Windows. They are ignored on other systems.

See also

TProcessOption

Options to be used when a process is started.


TStartupOption

Options determining how the application is started.

Declaration

Source position: process.pp line 34

type TStartupOption = (
suoUseShowWindow, | Use the Show Window options specified in TShowWindowOption
suoUseSize, | Use the window sizes as specified in TProcess
suoUsePosition, | Use the window sizes as specified in TProcess.
suoUseCountChars, | Use the console character width as specified in TProcess.
suoUseFillAttribute | Use the console fill attribute as specified in TProcess.
);

Description

These options are mainly for Win32, and determine what should be done with the application once it's started.

See also

TShowWindowOptions | Description of the main window of the new process.
TProcessOptions | Set of TProcessOption.


TStartupOptions

Set of TStartUpOption.

Declaration

Source position: process.pp line 40

type TStartupOptions = set of (
suoUseShowWindow, | Use the Show Window options specified in TShowWindowOption
suoUseSize, | Use the window sizes as specified in TProcess
suoUsePosition, | Use the window sizes as specified in TProcess.
suoUseCountChars, | Use the console character width as specified in TProcess.
suoUseFillAttribute | Use the console fill attribute as specified in TProcess.
);


FindGlobalComponentCallBack

Callback used when component references must be resolved.

Declaration

Source position: rttiutils.pp line 137

var FindGlobalComponentCallBack: TFindComponentEvent;

Description

FindGlobalComponentCallBack is called by UpdateStoredList whenever it needs to resolve component references. It should be set to a routine that locates a loaded component in the global list of loaded components.

See also

UpdateStoredList | Update a stringlist with object references
TPropsStorage.StoreObjectsProps | Store a list of component properties
TPropsStorage.LoadObjectsProps | Load a list of component properties


Reference for unit 'rttiutils'

RTTI utility functions

uses

  sysutils,

  Classes,

  typinfo,

  StrUtils;

Overview

The rttiutils unit is a unit providing simplified access to the RTTI information from published properties using the TPropInfoList class. This access can be used when saving or restoring form properties at runtime, or for persisting other objects whose RTTI is available: the TPropsStorage class can be used for this. The implementation is based on the apputils unit from RXLib by AO ROSNO and Master-Bank


Reference for unit 'rttiutils': Constants

sPropNameDelimiter

Separator used when constructing section/key names


Reference for unit 'rttiutils': Types

TEraseSectEvent | Clear a storage section
TFindComponentEvent | Event callback to locate a component instance
TReadStrEvent | Callback to read strings from storage
TWriteStrEvent | Write a string to storage


Reference for unit 'rttiutils': Classes

TPropInfoList | Class for keeping property information
TPropsStorage | Property storage mechanism


Reference for unit 'rttiutils': Procedures and functions

CreateStoredItem | Concatenates component and property name
ParseStoredItem | Split a property reference to component reference and property name
UpdateStoredList | Update a stringlist with object references


Reference for unit 'rttiutils': Variables

FindGlobalComponentCallBack

Callback used when component references must be resolved.


Index of all identifiers in unit 'rttiutils'

C F P S T U

C

CreateStoredItem

F

FindGlobalComponentCallBack

P

ParseStoredItem

S

sPropNameDelimiter

T

TEraseSectEvent | TPropInfoList | TReadStrEvent
TFindComponentEvent | TPropsStorage | TWriteStrEvent

U

UpdateStoredList


sPropNameDelimiter

Separator used when constructing section/key names

Declaration

Source position: rttiutils.pp line 131

const sPropNameDelimiter: String = '_';


TEraseSectEvent

Clear a storage section

Declaration

Source position: rttiutils.pp line 64

type TEraseSectEvent = procedure(

  const ASection: String

) of object;

Arguments

ASection

Section to erase

Description

TEraseSectEvent is used by TPropsStorage to clear a storage section, in a .ini file like fashion: The call should remove all keys in the section ASection, and remove the section from storage.

See also

TPropsStorage | Property storage mechanism
TReadStrEvent | Callback to read strings from storage
TWriteStrEvent | Write a string to storage


TFindComponentEvent

Event callback to locate a component instance

Declaration

Source position: rttiutils.pp line 134

type TFindComponentEvent = function(

  const Name: String

):TComponent;

Arguments

Name

Name path of component to search for

Function result

Component instance

Description

TFindComponentEvent should return the component instance for the component with name path Name. The name path should be relative to the global list of loaded components.

See also

UpdateStoredList | Update a stringlist with object references
FindGlobalComponentCallBack | Callback used when component references must be resolved.


TReadStrEvent

Callback to read strings from storage

Declaration

Source position: rttiutils.pp line 62

type TReadStrEvent = function(

  const ASection: String;

  const Item: String;

  const Default: String

):String of object;

Arguments

ASection | Section to read value from
Item | Key name for value
Default | Default return value if none was found

Function result

Value of Item in section ASection

Description

TReadStrEvent is used by TPropsStorage to read strings from a storage mechanism, in a .ini file like fashion: The call should read the string in ASection with key Item, and if it does not exist, Default should be returned.

See also

TPropsStorage | Property storage mechanism
TWriteStrEvent | Write a string to storage
TEraseSectEvent | Clear a storage section


TWriteStrEvent

Write a string to storage

Declaration

Source position: rttiutils.pp line 63

type TWriteStrEvent = procedure(

  const ASection: String;

  const Item: String;

  const Value: String

) of object;

Arguments

ASection | Section to write in
Item | Key name for value
Value | String value to write

Description

TWriteStrEvent is used by TPropsStorage to write strings to a storage mechanism, in a .ini file like fashion: The call should write the string Value in ASection with key Item. The section and key should be created if they didn't exist yet.

See also

TPropsStorage | Property storage mechanism
TReadStrEvent | Callback to read strings from storage
TEraseSectEvent | Clear a storage section


DefaultIPCClientClass

Default client communication class

Declaration

Source position: simpleipc.pp line 159

var DefaultIPCClientClass: TIPCClientCommClass = nil;

Description

DefaultIPCClientClass is filled with a class pointer indicating which kind of communication protocol class should be instantiated by the TSimpleIPCClient class. It is set to a default value by the default implementation in the SimpleIPC unit, but can be set to another class if another method of transport is desired. (it should match the communication protocol used by the server, obviously).

See also

TSimpleIPCClient | Simple IPC client component
TIPCClientComm | Internal client-side communication protocol


DefaultIPCServerClass

Default server communication class

Declaration

Source position: simpleipc.pp line 158

var DefaultIPCServerClass: TIPCServerCommClass = nil;

Description

DefaultIPCServerClass is filled with a class pointer indicating which kind of communication protocol class should be instantiated by the TSimpleIPCServer class. It is set to a default value by the default implementation in the SimpleIPC unit, but can be set to another class if another method of transport is desired.

See also

TSimpleIPCServer | Simple IPC server component
TIPCServerComm | Internal message communication component


Reference for unit 'simpleipc'

Simple one-way IPC protocol

uses

  Classes,

  sysutils;

Overview

The SimpleIPC unit provides classes to implement a simple, one-way IPC mechanism using string messages. It provides a TSimpleIPCServer component for the server, and a TSimpleIPCClient component for the client. The components are cross-platform, and should work both on Windows and unix-like systems.


Reference for unit 'simpleipc': Resource strings

SErrServerNotActive
'Server with ID %s is not active.'

SErrActive
'This operation is illegal when the server is active.'

SErrInActive
'This operation is illegal when the server is inactive.'


Reference for unit 'simpleipc': Constants

MsgVersion | Current version of the messaging protocol
mtString | String message type
mtUnknown | Unknown message type


Reference for unit 'simpleipc': Types

TIPCClientCommClass | Class reference for TIPCClientComm
TIPCServerCommClass | Class reference for TIPCServerComm
TMessageType | For backwards compatibility
TMsgHeader | Message header record


Reference for unit 'simpleipc': Classes

EIPCError | Error reporting exception
TIPCClientComm | Internal client-side communication protocol
TIPCServerComm | Internal message communication component
TSimpleIPC | Ancestor for client/server simple IPC classes
TSimpleIPCClient | Simple IPC client component
TSimpleIPCServer | Simple IPC server component


Reference for unit 'simpleipc': Variables

DefaultIPCClientClass | Default client communication class
DefaultIPCServerClass | Default server communication class


Index of all identifiers in unit 'simpleipc'

D E M S T

D

DefaultIPCClientClass DefaultIPCServerClass

E

EIPCError

M

MsgVersion mtString mtUnknown

S

SErrActive SErrInActive SErrServerNotActive

T

TIPCClientComm | TIPCServerCommClass | TSimpleIPC
TIPCClientCommClass | TMessageType | TSimpleIPCClient
TIPCServerComm | TMsgHeader | TSimpleIPCServer


MsgVersion

Current version of the messaging protocol

Declaration

Source position: simpleipc.pp line 26

const MsgVersion = 1;


mtString

String message type

Declaration

Source position: simpleipc.pp line 30

const mtString = 1;


mtUnknown

Unknown message type

Declaration

Source position: simpleipc.pp line 29

const mtUnknown = 0;


TMessageType

For backwards compatibility

Declaration

Source position: simpleipc.pp line 34

type TMessageType = LongInt;

Description

TMessageType is provided for backward compatibility with earlier versions of the simpleipc unit.


TMsgHeader

Message header record

Declaration

Source position: simpleipc.pp line 35

type TMsgHeader = packed record
Version: Byte; | Version number
MsgType: TMessageType; | Message data type
MsgLen: Integer; | Message length
end;

Description

TMsgHeader is used internally by the IPC client and server components to transmit data. The Version field denotes the protocol version. The MsgType field denotes the type of data (mtString for string messages), and MsgLen is the length of the message which will follow.

See also

TSimpleIPCServer | Simple IPC server component
TSimpleIPCClient | Simple IPC client component


Reference for unit 'streamcoll'

Collection which can stream itself

uses

  Classes,

  sysutils;

Overview

The streamcoll unit contains the implentation of a collection (and corresponding collection item) which implements routines for saving or loading the collection to/from a stream. The collection item should implement 2 routines to implement the streaming; the streaming itself is not performed by the TStreamCollection collection item.

The streaming performed here is not compatible with the streaming implemented in the Classes unit for components. It is independent of the latter and can be used without a component to hold the collection.

The collection item introduces mostly protected methods, and the unit contains a lot of auxiliary routines which aid in streaming.


Reference for unit 'streamcoll': Classes

EStreamColl | Exception raised when an error occurs when streaming the collection.
TStreamCollection | Collection with stream support
TStreamCollectionItem | Collection item with streaming support


Reference for unit 'streamcoll': Procedures and functions

ColReadBoolean | Read a boolean value from a stream
ColReadCurrency | Read a currency value from the stream
ColReadDateTime | Read a TDateTime value from a stream
ColReadFloat | Read a floating point value from a stream
ColReadInteger | Read a 32-bit integer from a stream.
ColReadString | Read a string from a stream
ColWriteBoolean | Write a boolean to a stream
ColWriteCurrency | Write a currency value to stream
ColWriteDateTime | Write a TDateTime value to stream
ColWriteFloat | Write floating point value to stream
ColWriteInteger | Write a 32-bit integer to a stream
ColWriteString | Write a string value to the stream


Index of all identifiers in unit 'streamcoll'

C E T

C

ColReadBoolean | ColReadInteger | ColWriteDateTime
ColReadCurrency | ColReadString | ColWriteFloat
ColReadDateTime | ColWriteBoolean | ColWriteInteger
ColReadFloat | ColWriteCurrency | ColWriteString

E

EStreamColl

T

TStreamCollection TStreamCollectionItem


Reference for unit 'streamex'

Stream extensions

uses

  Classes;

Overview

streamex implements some extensions to be used together with streams from the classes unit.


Reference for unit 'streamex': Classes

TBidirBinaryObjectReader | Binary component stream reader with BiDi support
TBidirBinaryObjectWriter | Binary component stream writer with BiDi support
TDelphiReader | Stream reader with BiDi Support
TDelphiWriter | Stream writer with BiDi Support


Index of all identifiers in unit 'streamex'

T

T

TBidirBinaryObjectReader | TDelphiReader
TBidirBinaryObjectWriter | TDelphiWriter


Reference for unit 'StreamIO'

Streams for standard text files.

uses

  Classes,

  sysutils;

Overview

The StreamIO unit implements a call to reroute the input or output of a text file to a descendents of TStream.

This allows to use the standard pascal Read and Write functions (with all their possibilities), on streams.


Reference for unit 'StreamIO': Procedures and functions

AssignStream | Assign a text file to a stream.
GetStream | Return the stream, associated with a file.


Index of all identifiers in unit 'StreamIO'

A G

A

AssignStream

G

GetStream


Reference for unit 'syncobjs'

Synchronization objects

uses

  sysutils;

Overview

The syncobjs unit implements some classes which can be used when synchronizing threads in routines or classes that are used in multiple threads at once. The TCriticalSection class is a wrapper around low-level critical section routines (semaphores or mutexes). The TEventObject class can be used to send messages between threads (also known as conditional variables in Posix threads).


Reference for unit 'syncobjs': Constants

INFINITE

Infinite waiting time


Reference for unit 'syncobjs': Types

PSecurityAttributes | Dummy type
TEvent | Alias for TEventObject
TEventHandle | Handle type
TWaitResult | Unix wait result


Reference for unit 'syncobjs': Classes

TCriticalSection | Critical section
TEventObject | Event propagation object
THandleObject | Class encapsulating an operating system handle
TSimpleEvent | Simple, anonymous event
TSynchroObject | Abstract synchronization object


Index of all identifiers in unit 'syncobjs'

I P T W

I

INFINITE

P

PSecurityAttributes

T

TCriticalSection | TEventObject | TSynchroObject
TEvent | THandleObject | TWaitResult
TEventHandle | TSimpleEvent |

W

wrAbandoned | wrSignaled
wrError | wrTimeout


INFINITE

Infinite waiting time

Declaration

Source position: syncobjs.pp line 28

const INFINITE = Cardinal ( - 1 );

Description

Constant denoting an infinite timeout.


PSecurityAttributes

Dummy type

Declaration

Source position: syncobjs.pp line 24

type PSecurityAttributes = Pointer;

Description

PSecurityAttributes is a dummy type used in non-windows implementations, so the calls remain Delphi compatible.

See also

TEventObject.Create

Create a new event object


TEvent

Alias for TEventObject

Declaration

Source position: syncobjs.pp line 73

type TEvent = TEventObject;

Description

TEvent is a simple alias for the TEventObject class.

See also

TEventObject

Event propagation object


TEventHandle

Handle type

Declaration

Source position: syncobjs.pp line 25

type TEventHandle = Pointer;

Description

TEventHandle is an opaque type and should not be used in user code.


TWaitResult

Unix wait result

Declaration

Source position: syncobjs.pp line 31

type TWaitResult = (
wrSignaled, | Event was signaled (triggered)
wrTimeout, | Time-out period expired
wrAbandoned, | Wait operation was abandoned.
wrError | An error occurred during the wait operation.
);

Description

TWaitResult is used to report the result of a wait operation.

See also

TEventObject.WaitFor

Wait for the event to be set.


Reference for unit 'URIParser'

URI Parsing routines

Overview

The URIParser unit contains a basic type (TURI) and some routines for the parsing (ParseURI) and construction (EncodeURI) of Uniform Resource Indicators, commonly referred to as URL: Uniform Resource Location. It is used in various other units, and in itself contains no classes. It supports all protocols, username/password/port specification, query parameters and bookmarks etc..


Reference for unit 'URIParser': Types

TURI

Record containing all possible parts of a URI


Reference for unit 'URIParser': Procedures and functions

EncodeURI | Form a string representation of the URI
FilenameToURI | Construct a URI from a filename
IsAbsoluteURI | Check whether a URI is absolute.
ParseURI | Parse a URI and split it into its constituent parts
ResolveRelativeURI | Return a relative link
URIToFilename | Convert a URI to a filename


Index of all identifiers in unit 'URIParser'

E F I P R T U

E

EncodeURI

F

FilenameToURI

I

IsAbsoluteURI

P

ParseURI

R

ResolveRelativeURI

T

TURI

U

URIToFilename


TURI

Record containing all possible parts of a URI

Declaration

Source position: uriparser.pp line 26

type TURI = record
Protocol: String; | Protocol of the URI (http, ftp, file, mailto etc.)
Username: String; | Username part of the URI
Password: String; | Password part of the URI
Host: String; | Hostname part of the URI
Port: Word; | Port part of the URI
Path: String; | Path (directory) part of the URI
Document: String; | Document (filename) part of the URI
Params: String; | Query parameter part of the URI
Bookmark: String; | Bookmark part of the URI
HasAuthority: Boolean; | Indicates whether an 'Authority' part was present in the URI
end;

Description

TURI is the basic record that can be filled by the ParseURI call. It contains the contents of a URI, parsed out in it's various pieces.

See also

ParseURI | Parse a URI and split it into its constituent parts
EncodeURI | Form a string representation of the URI


Reference for unit 'zstream'

Support for compression streams

uses

  Classes,

  zbase,

  gzio;

Overview

The ZStream unit implements a TStream descendent (TCompressionStream) which uses the deflate algorithm to compress everything that is written to it. The compressed data is written to the output stream, which is specified when the compressor class is created.

Likewise, a TStream descendent is implemented which reads data from an input stream (TDecompressionStream) and decompresses it with the inflate algorithm.


Reference for unit 'zstream': Types

Tcompressionlevel | Compression level for the deflate algorithm
Tgzopenmode | Open mode for gzip file.


Reference for unit 'zstream': Classes

Ecompressionerror | Errors in the TCompressionStream class are signaled with this exception
Edecompressionerror | Errors in the TDeCompressionStream class are signaled with this exception
Egzfileerror | Exception class used in Tgzfilestream class
Ezliberror | Base exception for exceptions in the ZStream unit
Tcompressionstream | Write-only stream class which compresses data written to it.
Tcustomzlibstream | Ancestor for compression and decompression classes
Tdecompressionstream | Reads and decompresses data from a compressed data stream.
TGZFileStream | Stream to read/write from a gzip file.


Index of all identifiers in unit 'zstream'

C E G T

C

cldefault | clmax
clfastest | clnone

E

Ecompressionerror | Egzfileerror
Edecompressionerror | Ezliberror

G

gzopenread gzopenwrite

T

Tcompressionlevel | Tcustomzlibstream | TGZFileStream
Tcompressionstream | Tdecompressionstream | Tgzopenmode


Tcompressionlevel

Compression level for the deflate algorithm

Declaration

Source position: zstream.pp line 31

type Tcompressionlevel = (
clnone, | Do not use compression, just copy data.
clfastest, | Use fast (but less) compression.
cldefault, | Use default compression
clmax | Use maximum compression
);


Tgzopenmode

Open mode for gzip file.

Declaration

Source position: zstream.pp line 38

type Tgzopenmode = (
gzopenread, | Open file for reading
gzopenwrite | Open file for writing
);