Class TStringPairVector

Unit

Declaration

type TStringPairVector = class(TObjectVector)

Description

List of string pairs. This class contains only non-nil objects of class TStringPair.

Using this class instead of TStringList (with it's Name and Value properties) is often better, because this allows both Name and Value of each pair to safely contain any special characters (including '=' and newline markers). It's also faster, since it doesn't try to encode Name and Value into one string.

Source: source/component/PasDoc_StringPairVector.pas (line 55).

Hierarchy

Overview

Methods

Public function Text(const NameValueSepapator, ItemSeparator: string): string;
Public function FindName(const Name: string; IgnoreCase: boolean = true): Integer;
Public function DeleteName(const Name: string; IgnoreCase: boolean = true): boolean;
Public procedure LoadFromBinaryStream(Stream: TStream);
Public procedure SaveToBinaryStream(Stream: TStream);
Public function FirstName: string;

Properties

Public property Items[i: Integer]: TStringPair read GetItems write SetItems;

Description

Methods

Public function Text(const NameValueSepapator, ItemSeparator: string): string;

Returns all items Names and Values glued together. For every item, string Name + NameValueSepapator + Value is constructed. Then all such strings for every items all concatenated with ItemSeparator.

Remember that the very idea of TStringPair and TStringPairVector is that Name and Value strings may contain any special characters, including things you give here as NameValueSepapator and ItemSeparator. So it's practically impossible to later convert such Text back to items and Names/Value pairs.

Source: source/component/PasDoc_StringPairVector.pas (line 73).

Public function FindName(const Name: string; IgnoreCase: boolean = true): Integer;

Finds a string pair with given Name. Returns -1 if not found.

Source: source/component/PasDoc_StringPairVector.pas (line 77).

Public function DeleteName(const Name: string; IgnoreCase: boolean = true): boolean;

Removes first string pair with given Name. Returns if some pair was removed.

Source: source/component/PasDoc_StringPairVector.pas (line 81).

Public procedure LoadFromBinaryStream(Stream: TStream);

Load from a stream using the binary format. For each item, it's Name and Value are saved. (TStringPair.Data pointers are not saved.)

Source: source/component/PasDoc_StringPairVector.pas (line 86).

Public procedure SaveToBinaryStream(Stream: TStream);

Save to a stream, in a format readable by LoadFromBinaryStream.

Source: source/component/PasDoc_StringPairVector.pas (line 90).

Public function FirstName: string;

Name of first item, or '' if list empty.

Source: source/component/PasDoc_StringPairVector.pas (line 93).

Properties

Public property Items[i: Integer]: TStringPair read GetItems write SetItems;

This item has no description.

Source: source/component/PasDoc_StringPairVector.pas (line 60).


Generated by PasDoc 0.17.0.snapshot.