Units
Classes, Interfaces, Objects
Types
Variables
Constants
Functions, Procedures
Identifiers

Class TExContainerType

Unit

rjExAnsiString2Vector

Declaration

type TExContainerType = class(TAnsiStringBase04ZeroVector)

Description

Base class for TAnsiString2Vector.

Hierarchy

TAnsiStringBase04ZeroVector > TAnsiStringBase04Vector > TAnsiStringVector > TExContainerType > TBase04ZeroVector > TBase04Vector > TExVector > TExContainer > TErrorObject

Fields

None.

Methods

Overview

constructor Create; override;
function ExistAllValuesCS(const AValues: array of TExValueType): Boolean;
function ExistAnyValuesCS(const AValues: array of TExValueType): Boolean;
function ExistsBackValueCI(const AValue: TExValueType): Boolean;
function ExistsBackValueCS(const AValue: TExValueType): Boolean;
function ExistsSortedValueCI(const Value: TExValueType): Boolean;
function ExistsSortedValueCS(const Value: TExValueType): Boolean;
function ExistsValueCI(const AValue: TExValueType): Boolean;
function ExistsValueCS(const AValue: TExValueType): Boolean;
function FindDescValueCI(const AValue: TExValueType; out Index: Integer): Boolean;
function FindDescValueCS(const AValue: TExValueType; out Index: Integer): Boolean;
function FindValueCI(const Value: TExValueType; out Index: Integer): Boolean;
function FindValueCS(const Value: TExValueType; out Index: Integer): Boolean;
function GetFirstValue: TExValueType;
function GetLastValue: TExValueType;
function GetNameBackOfValueCI(const AValue: TExValueType): TExNameType;
function GetNameBackOfValueCS(const AValue: TExValueType): TExNameType;
function GetNameOfValueCI(const AValue: TExValueType): TExNameType;
function GetNameOfValueCS(const AValue: TExValueType): TExNameType;
function GetValue(const Item: Pointer): TExValueType;
function GetValueAt(const Index: Integer): TExValueType;
function GetValueBackOfNameCI(const AName: TExNameType): TExValueType;
function GetValueBackOfNameCS(const AName: TExNameType): TExValueType;
function GetValueOfNameCI(const AName: TExNameType): TExValueType;
function GetValueOfNameCS(const AName: TExNameType): TExValueType;
function IndexBackOfValueCI(const AValue: TExValueType): Integer;
function IndexBackOfValueCS(const AValue: TExValueType): Integer;
function IndexOfValueCI(const AValue: TExValueType): Integer;
function IndexOfValueCS(const AValue: TExValueType): Integer;
function InsertNameValueLast(const AName: TExNameType; const AValue: TExValueType): Integer;
procedure InsertValueAt(const Index: Integer; const AValue: TExValueType);
function InsertValueFirst(const Value: TExValueType): Integer;
function InsertValueLast(const Value: TExValueType): Integer;
function InsertValueSortedCI(const Value: TExValueType): Integer;
function InsertValueSortedCIDesc(const AValue: TExValueType): Integer;
function InsertValueSortedCS(const AValue: TExValueType): Integer;
function InsertValueSortedCSDesc(const AValue: TExValueType): Integer;
function ItemOfValueCI(const Value: TExValueType): Pointer;
function ItemOfValueCS(const Value: TExValueType): Pointer;
function LoadFromStream(const Stream: TStream): Boolean; override;
function LoadValuesFromTextFile(const FileName: AnsiString): Boolean;
function LoadValuesFromTextStream(const Stream: TStream): Boolean; virtual;
procedure RemoveAllValuesCI(const AValue: TExValueType);
procedure RemoveAllValuesCS(const AValue: TExValueType);
procedure RemoveBackAllValuesCI(const AValue: TExValueType);
procedure RemoveBackAllValuesCS(const AValue: TExValueType);
procedure SaveToStream(const Stream: TStream); override;
procedure SaveValuesToTextFile(const FileName: AnsiString);
procedure SaveValuesToTextStream(const Stream: TStream); virtual;
procedure SetFirstValue(const Value: TExValueType);
procedure SetLastValue(const Value: TExValueType);
procedure SetNameBackOfValueCI(const AValue: TExValueType; const AName: TExNameType);
procedure SetNameBackOfValueCS(const AValue: TExValueType; const AName: TExNameType);
procedure SetNameOfValueCI(const AValue: TExValueType; const AName: TExNameType);
procedure SetNameOfValueCS(const AValue: TExValueType; const AName: TExNameType);
procedure SetValue(const Item: Pointer; const Value: TExValueType);
procedure SetValueAt(const Index: Integer; const Value: TExValueType);
procedure SetValueBackOfNameCI(const AName: TExNameType; const AValue: TExValueType);
procedure SetValueBackOfNameCS(const AName: TExNameType; const AValue: TExValueType);
procedure SetValueOfNameCI(const AName: TExNameType; const AValue: TExValueType);
procedure SetValueOfNameCS(const AName: TExNameType; const AValue: TExValueType);
procedure SortByValueCI;
procedure SortByValueCIDesc;
procedure SortByValueCS;
procedure SortByValueCSDesc;

Description

constructor Create; override;

 

function ExistAllValuesCS(const AValues: array of TExValueType): Boolean;

Returns True if all of the AValues in the array exist in the Items' Value Elements of the container, otherwise returns False. Comparison starts with the first Item and is case sensitive.

function ExistAnyValuesCS(const AValues: array of TExValueType): Boolean;

Returns True if at least one of the AValues in the array exists in the Items' Value Elements of the container, otherwise returns False. Comparison starts with the first Item and is case sensitive.

function ExistsBackValueCI(const AValue: TExValueType): Boolean;

Returns True if AValue exists among the Items' Value Elements of the container, otherwise returns False. Comparison starts with the last Item and is case insensitive.

function ExistsBackValueCS(const AValue: TExValueType): Boolean;

Returns True if AValue exists among the Items' Value Elements of the container, otherwise returns False. Comparison starts with the last Item and is case sensitive.

function ExistsSortedValueCI(const Value: TExValueType): Boolean;

 

function ExistsSortedValueCS(const Value: TExValueType): Boolean;

 

function ExistsValueCI(const AValue: TExValueType): Boolean;

Returns True if AValue exists among the Items' Value Elements of the container, otherwise returns False. Comparison starts with the first Item and is case insensitive.

function ExistsValueCS(const AValue: TExValueType): Boolean;

Returns True if AValue exists among the Items' Value Elements of the container, otherwise returns False. Comparison starts with the first Item and is case sensitive.

function FindDescValueCI(const AValue: TExValueType; out Index: Integer): Boolean;

 

function FindDescValueCS(const AValue: TExValueType; out Index: Integer): Boolean;

 

function FindValueCI(const Value: TExValueType; out Index: Integer): Boolean;

 

function FindValueCS(const Value: TExValueType; out Index: Integer): Boolean;

 

function GetFirstValue: TExValueType;

Returns the Value Element of the first Item in the container.

function GetLastValue: TExValueType;

Returns the Value Element of the last Item in the container.

function GetNameBackOfValueCI(const AValue: TExValueType): TExNameType;

Looks for the last occurrence of an Item whose Value Element is the same as Value. If found, returns the Name Element of that Item. If not found, an empty string is returned.

Comparison of Value is case insensitive.

function GetNameBackOfValueCS(const AValue: TExValueType): TExNameType;

Looks for the last occurrence of an Item whose Value Element is the same as Value. If found, returns the Name Element of that Item. If not found, an empty string is returned.

Comparison of Value is case sensitive.

function GetNameOfValueCI(const AValue: TExValueType): TExNameType;

Looks for the first occurrence of an Item whose Value Element is the same as Value. If found, returns the Name Element of that Item. If not found, an empty string is returned.

Comparison of Value is case insensitive.

function GetNameOfValueCS(const AValue: TExValueType): TExNameType;

Looks for the first occurrence of an Item whose Value Element is the same as Value. If found, returns the Name Element of that Item. If not found, an empty string is returned.

Comparison of Value is case sensitive.

function GetValue(const Item: Pointer): TExValueType;

Returns the Value Element of the Item pointed to by Item.

function GetValueAt(const Index: Integer): TExValueType;

Returns the Value Element of the Item referenced by a 0-based Index.

function GetValueBackOfNameCI(const AName: TExNameType): TExValueType;

Looks for the last occurrence of an Item whose Name Element is the same as Name. If found, returns the Value Element of that Item. If not found, an empty string is returned.

Comparison of Name is case insensitive.

function GetValueBackOfNameCS(const AName: TExNameType): TExValueType;

Looks for the last occurrence of an Item whose Name Element is the same as Name. If found, returns the Value Element of that Item. If not found, an empty string is returned.

Comparison of Name is case sensitive.

function GetValueOfNameCI(const AName: TExNameType): TExValueType;

Looks for the first occurrence of an Item whose Name Element is the same as Name. If found, returns the Value Element of that Item. If not found, an empty string is returned.

Comparison of Name is case insensitive.

function GetValueOfNameCS(const AName: TExNameType): TExValueType;

Looks for the first occurrence of an Item whose Name Element is the same as Name. If found, returns the Value Element of that Item. If not found, an empty string is returned.

Comparison of Name is case sensitive.

function IndexBackOfValueCI(const AValue: TExValueType): Integer;

Returns the position of the last occurrence of an Item whose Name Element is the same as AName. Comparison is case insensitive. IndexBackOfNameCI returns the 0-based Index of the Item, i.e. 0 for the Last Item, 1 for the second, and so on. If AName is not in the vector, IndexBackOfNameCI returns -1.

function IndexBackOfValueCS(const AValue: TExValueType): Integer;

Returns the position of the last occurrence of an Item whose Value Element is the same as AValue. Comparison is case sensitive. IndexBackOfValueCS returns the 0-based Index of the Item, i.e. 0 for the first Item, 1 for the second, and so on. If AValue is not in the vector, IndexBackOfValueCS returns -1.

function IndexOfValueCI(const AValue: TExValueType): Integer;

Returns the position of the first occurrence of an Item whose Value Element is the same as AValue. Comparison starts with the first Item and is case insensitive. IndexOfValueCI returns the 0-based Index of the Item, i.e. 0 for the first Item, 1 for the second, and so on. If AValue is not in the vector, IndexOfValueCI returns -1.

function IndexOfValueCS(const AValue: TExValueType): Integer;

Returns the position of the first occurrence of an Item whose Value Element is the same as AValue. Comparison starts with the first Item and is case sensitive. IndexOfValueCS returns the 0-based Index of the Item, i.e. 0 for the first Item, 1 for the second, and so on. If AValue is not in the vector, IndexOfValueCS returns -1.

function InsertNameValueLast(const AName: TExNameType; const AValue: TExValueType): Integer;

Inserts a new Item to the end of the vector and stores AName and AValue to the new Item's Name and Value Elements respectively. InsertNameValueLast returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0.

procedure InsertValueAt(const Index: Integer; const AValue: TExValueType);

Inserts a new Item at the position specified by Index and stores AValue to the new Item's Value Element.

function InsertValueFirst(const Value: TExValueType): Integer;

Inserts a new Item to the beginning of the vector and stores Value to the new Item's Value Element. InsertValueFirst returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0.

function InsertValueLast(const Value: TExValueType): Integer;

Inserts a new Item to the end of the vector and stores Value to the new Item's Value Element. InsertValueLast returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0.

function InsertValueSortedCI(const Value: TExValueType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Value Elements in ascending order. The new position will be based on comparisons with AValue. The comparison is case insensitive.

AddValueSortedCI relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByValueCI to prepare an unsorted vector for using AddValueSortedCI.

AddValueSortedCI does not allow duplicates in the vector. If AValue is already present in the vector, no new Item will be inserted and AValue will not be stored.

AddValueSortedCI returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function InsertValueSortedCIDesc(const AValue: TExValueType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Value Elements in descending order. The new position will be based on comparisons with AValue. The comparison is case insensitive.

AddValueSortedCIDesc relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByValueCIDesc to prepare an unsorted vector for using AddValueSortedCIDesc.

AddValueSortedCIDesc does not allow duplicates in the vector. If AValue is already present in the vector, no new Item will be inserted and AValue will not be stored.

AddValueSortedCIDesc returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function InsertValueSortedCS(const AValue: TExValueType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Value Elements in ascending order. The new position will be based on comparisons with AValue. The comparison is case sensitive.

AddValueSortedCS relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByValueCS to prepare an unsorted vector for using AddValueSortedCS.

AddValueSortedCS does not allow duplicates in the vector. If AValue is already present in the vector, no new Item will be inserted and AValue will not be stored.

AddValueSortedCS returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function InsertValueSortedCSDesc(const AValue: TExValueType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Value Elements in descending order. The new position will be based on comparisons with AValue. The comparison is case sensitive.

AddValueSortedCSDesc relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByValueCSDesc to prepare an unsorted vector for using AddValueSortedCSDesc.

AddValueSortedCSDesc does not allow duplicates in the vector. If AValue is already present in the vector, no new Item will be inserted and AValue will not be stored.

AddValueSortedCSDesc returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function ItemOfValueCI(const Value: TExValueType): Pointer;

 

function ItemOfValueCS(const Value: TExValueType): Pointer;

 

function LoadFromStream(const Stream: TStream): Boolean; override;

Loads the container's Items from a binary stream. If ItemSize is greater than the size of the type defined for TExContainerType, all additional Elements will be read as raw binary data as they were save with SaveToStream.

This stream format is not compatible with text files. To read Items from a text file compatible stream, use LoadNamesFromTextStream or LoadValuesFromTextStream instead.

function LoadValuesFromTextFile(const FileName: AnsiString): Boolean;

Loads the container's Names from a file which can be read and edited as text. Calls LoadFromTextStream to do the actual reading.

function LoadValuesFromTextStream(const Stream: TStream): Boolean; virtual;

Fills the items' Name Elements with lines of text read from a stream. The text read from the stream is parsed into strings separated by carriage return or linefeed characters.

In contrast to the TStrings' LoadFromStream method, this method does not read the whole stream into memory but starts parsing the lines immediately, using less memory and CPU power.

LoadValuesFromTextStream first clears the container before loading the Names, so all other Elements will be undefined after calling this function.

procedure RemoveAllValuesCI(const AValue: TExValueType);

Removes all Items whose Value Element is the same as AValue from the container. Comparison is case insensitive.

procedure RemoveAllValuesCS(const AValue: TExValueType);

Removes all Items whose Value Element is the same as AValue from the container. Comparison is case sensitive.

procedure RemoveBackAllValuesCI(const AValue: TExValueType);

Removes all Items whose Value Element is the same as AValue from the container starting at the last Item. Comparison is case insensitive.

procedure RemoveBackAllValuesCS(const AValue: TExValueType);

Removes all Items whose Value Element is the same as AValue from the container starting at the last Item. Comparison is case sensitive.

procedure SaveToStream(const Stream: TStream); override;

Writes all Items to a stream object. Correctly streams the Name and Value Elements. Additional Elements are streamed as raw data. This works fine for non-dynamic types like Numbers, but not for strings. To provide streaming for additional dynamic Elements you must override this function.

SaveToStream writes a binary stream format which is not compatible with text files. For writing to a text file compatible stream, use SaveNamesToTextStream or SaveValuesToTextStream instead.

Use LoadFromStream to read back a stream written by this method.

See also:

procedure SaveValuesToTextFile(const FileName: AnsiString);

 

procedure SaveValuesToTextStream(const Stream: TStream); virtual;

Writes the Value Elements of all Items in the container to a stream object. The stream format written by this method is compatible with text files. Call SaveValuesToTextStream to save the Value Elements in the container to the stream specified by the Stream parameter. SaveValuesToTextStream writes the Values delimited by carriage return, line feed pairs. If the stream is a file stream, SaveValuesToTextStream does the same thing as SaveValuesToTextFile, except the application must create and destroy the file stream.

Use LoadValuesFromTextStream to read back a stream written by this method.

procedure SetFirstValue(const Value: TExValueType);

Stores Value to the Value Element of the first Item in the container.

procedure SetLastValue(const Value: TExValueType);

Stores Value to the Value Element of the last Item in the container.

procedure SetNameBackOfValueCI(const AValue: TExValueType; const AName: TExNameType);

Looks for the last occurrence of an Item whose Value Element is the same as Value. If found, Name is stored to the Name Element of that Item. If not found, Name will not be stored.

Comparison of Value is case insensitive.

procedure SetNameBackOfValueCS(const AValue: TExValueType; const AName: TExNameType);

Looks for the last occurrence of an Item whose Value Element is the same as Value. If found, Name is stored to the Name Element of that Item. If not found, Name will not be stored.

Comparison of Value is case sensitive.

procedure SetNameOfValueCI(const AValue: TExValueType; const AName: TExNameType);

Looks for the first occurrence of an Item whose Value Element is the same as Value. If found, Name is stored to the Name Element of that Item. If not found, Name will not be stored.

Comparison of Value is case insensitive.

procedure SetNameOfValueCS(const AValue: TExValueType; const AName: TExNameType);

Looks for the first occurrence of an Item whose Value Element is the same as Value. If found, Name is stored to the Name Element of that Item. If not found, Name will not be stored.

Comparison of Value is case sensitive.

procedure SetValue(const Item: Pointer; const Value: TExValueType);

Stores Value to the Value Element of the Item pointed to by Item.

procedure SetValueAt(const Index: Integer; const Value: TExValueType);

Stores Value to the Value Element of the Item referenced by a 0-based Index.

procedure SetValueBackOfNameCI(const AName: TExNameType; const AValue: TExValueType);

Looks for the last occurrence of an Item whose Name Element is the same as Name. If found, Value is stored to the Value Element of that Item. If not found, Value will not be stored.

Comparison of Name is case insensitive.

procedure SetValueBackOfNameCS(const AName: TExNameType; const AValue: TExValueType);

Looks for the last occurrence of an Item whose Name Element is the same as Name. If found, Value is stored to the Value Element of that Item. If not found, Value will not be stored.

Comparison of Name is case sensitive.

procedure SetValueOfNameCI(const AName: TExNameType; const AValue: TExValueType);

Looks for the first occurrence of an Item whose Name Element is the same as Name. If found, Value is stored to the Value Element of that Item. If not found, Value will not be stored.

Comparison of Name is case insensitive.

procedure SetValueOfNameCS(const AName: TExNameType; const AValue: TExValueType);

Looks for the first occurrence of an Item whose Name Element is the same as Name. If found, Value is stored to the Value Element of that Item. If not found, Value will not be stored.

Comparison of Name is case sensitive.

procedure SortByValueCI;

Sorts all Items in the container by their Value Element in ascending order.

The comparison is case insensitive.

procedure SortByValueCIDesc;

Sorts all Items in the container by their Value Element in descending order.

The comparison is case insensitive.

procedure SortByValueCS;

Sorts all Items in the container by their Value Element in ascending order.

The comparison is case sensitive.

procedure SortByValueCSDesc;

Sorts all Items in the container by their Value Element in descending order.

The comparison is case sensitive.

Properties

Overview

FirstValue: TExValueType;
LastValue: TExValueType;
NameBackOfValueCI[const Value: TExValueType]: TExNameType;
NameBackOfValueCS[const Value: TExValueType]: TExNameType;
NameOfValueCI[const Value: TExValueType]: TExNameType;
NameOfValueCS[const Value: TExValueType]: TExNameType;
Value[const Item: Pointer]: TExValueType;
ValueAt[const Index: Integer]: TExValueType;
ValueBackOfNameCI[const Name: TExNameType]: TExValueType;
ValueBackOfNameCS[const Name: TExNameType]: TExValueType;
ValueOfNameCI[const Name: TExNameType]: TExValueType;
ValueOfNameCS[const Name: TExNameType]: TExValueType;

Description

FirstValue: TExValueType;

Reads or modifies the Value Element of the first Item in the container.

LastValue: TExValueType;

Reads or modifies the Value Element of the last Item in the container.

NameBackOfValueCI[const Value: TExValueType]: TExNameType;

 

NameBackOfValueCS[const Value: TExValueType]: TExNameType;

 

NameOfValueCI[const Value: TExValueType]: TExNameType;

 

NameOfValueCS[const Value: TExValueType]: TExNameType;

 

Value[const Item: Pointer]: TExValueType;

Reads or writes the Value Element of the Item pointed to by Item.

ValueAt[const Index: Integer]: TExValueType;

Lists the Value Element of the container's Items, referenced by a 0-based Index. Use Values to read or modify the Value Element of an Item at a particular position. Index gives the position of the Item, where 0 is the position of the first Item, 1 is the position of the second Item, and so on.

ValueBackOfNameCI[const Name: TExNameType]: TExValueType;

 

ValueBackOfNameCS[const Name: TExNameType]: TExValueType;

 

ValueOfNameCI[const Name: TExNameType]: TExValueType;

 

ValueOfNameCS[const Name: TExNameType]: TExValueType;

 


rjExContainer Library Version 0.2.
Copyright Ralf Junker 2000-2001.
http://www.zeitungsjunge.de/delphi/.