Class TStringPairVector
Unit
Declaration
type TStringPairVector = class(specialize TObjectList<TStringPair>)
Description
List of string pairs.
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 53).
Hierarchy
- TObject
- TList
- TObjectList
- TStringPairVector
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; |
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 66). | |
| 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 70). | |
| 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 74). | |
| 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 79). | |
| Public | procedure SaveToBinaryStream(Stream: TStream); |
|
Save to a stream, in a format readable by LoadFromBinaryStream. Source: source/component/PasDoc_StringPairVector.pas (line 83). | |
| Public | function FirstName: string; |
|
Name of first item, or '' if list empty. Source: source/component/PasDoc_StringPairVector.pas (line 86). | |
Generated by PasDoc 1.0.2.