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.
Hierarchy
- TObject
- TList
- TObjectList
- TObjectVector
- TStringPairVector
Overview
Methods
function Text(const NameValueSepapator, ItemSeparator: string): string; |
|
function FindName(const Name: string; IgnoreCase: boolean = true): Integer; |
|
function DeleteName(const Name: string; IgnoreCase: boolean = true): boolean; |
|
procedure LoadFromBinaryStream(Stream: TStream); |
|
procedure SaveToBinaryStream(Stream: TStream); |
|
function FirstName: string; |
Properties
property Items[i:Integer]: TStringPair read GetItems write SetItems; |
Description
Methods
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. |
function FindName(const Name: string; IgnoreCase: boolean = true): Integer; |
|
Finds a string pair with given Name. Returns -1 if not found. |
function DeleteName(const Name: string; IgnoreCase: boolean = true): boolean; |
|
Removes first string pair with given Name. Returns if some pair was removed. |
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.) |
procedure SaveToBinaryStream(Stream: TStream); |
|
Save to a stream, in a format readable by LoadFromBinaryStream. |
function FirstName: string; |
|
Name of first item, or '' if list empty. |
Properties
property Items[i:Integer]: TStringPair read GetItems write SetItems; |
|
Generated by PasDoc 0.16.0.