[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Class to manage arrays or collections of strings
Source position: classesh.inc line 550
type TStrings = class(TPersistent) |
||
protected |
||
procedure DefineProperties(); override; |
|
Method to stream the contents of the string collection |
procedure Error(); |
|
Raises an EStringListError exception. |
function Get(); virtual; abstract; |
|
Abstract read handler for the TStrings.Strings property. |
function GetCapacity; virtual; |
|
Abstract Read handler for the TStrings.Capacity property. |
function GetCount; virtual; abstract; |
|
Abstract read handler for the TStrings.Count property. |
function GetObject(); virtual; |
|
Abstract read handler for the TStrings.Objects property. |
function GetTextStr; virtual; |
|
Read handler for the TStrings.Text property. |
procedure Put(); virtual; |
|
Write handler for the TStrings.Strings property. |
procedure PutObject(); virtual; |
|
Write handler for the TStrings.Objects property. |
procedure SetCapacity(); virtual; |
|
Write handler for the TStrings.Capacity property. |
procedure SetTextStr(); virtual; |
|
Write handler for the TStrings.Text property. |
procedure SetUpdateState(); virtual; |
|
Sets the update state. |
property UpdateCount: Integer; [r] |
||
function DoCompareText(); virtual; |
||
function GetDelimitedText; |
||
procedure SetDelimitedText(); |
||
function GetValueFromIndex(); |
||
procedure SetValueFromIndex(); |
||
procedure CheckSpecialChars; |
||
public |
||
destructor Destroy; override; |
|
Frees all strings and objects, and removes the list from memory. |
function Add(); virtual; |
|
Add a string to the list |
function AddObject(); virtual; |
|
Add a string and associated object to the list. |
procedure Append(); |
|
Add a string to the list. |
procedure AddStrings(); virtual; |
|
Add contents of another stringlist to this list. |
procedure Assign(); override; |
|
Assign the contents of another stringlist to this one. |
procedure BeginUpdate; |
|
Mark the beginning of an update batch. |
procedure Clear; virtual; abstract; |
|
Removes all strings and associated objects from the list. |
procedure Delete(); virtual; abstract; |
|
Delete a string from the list. |
procedure EndUpdate; |
|
Mark the end of an update batch. |
function Equals(); |
|
Compares the contents of two stringlists. |
procedure Exchange(); virtual; |
|
Exchanges two strings in the list. |
function GetEnumerator; |
|
Create an IEnumerator instance |
function GetText; virtual; |
|
Returns the contents as a PChar |
function IndexOf(); virtual; |
|
Find a string in the list and return its position. |
function IndexOfName(); virtual; |
|
Finds the index of a name in the name-value pairs. |
function IndexOfObject(); virtual; |
|
Finds an object in the list and returns its index. |
procedure Insert(); virtual; abstract; |
|
Insert a string in the list. |
procedure InsertObject(); |
|
Insert a string and associated object in the list. |
procedure LoadFromFile(); virtual; |
|
Load the contents of a file as a series of strings. |
procedure LoadFromStream(); virtual; |
|
Load the contents of a stream as a series of strings. |
procedure Move(); virtual; |
|
Move a string from one place in the list to another. |
procedure SaveToFile(); virtual; |
|
Save the contents of the list to a file. |
procedure SaveToStream(); virtual; |
|
Save the contents of the string to a stream. |
procedure SetText(); virtual; |
|
Set the contents of the list from a PChar. |
procedure GetNameValue(); |
|
Return both name and value of a name,value pair based on it's index. |
function ExtractName(); |
|
Extract the name part of a string |
property TextLineBreakStyle: TTextLineBreakStyle; [rw] |
|
Determines which line breaks to use in the Text property |
property Delimiter: Char; [rw] |
|
Delimiter character used in DelimitedText. |
property DelimitedText: String; [rw] |
|
Get or set all strings in the list in a delimited form. |
property StrictDelimiter: Boolean; [rw] |
|
Should only the delimiter character be considered a delimiter |
property QuoteChar: Char; [rw] |
|
Quote character used in DelimitedText. |
property NameValueSeparator: Char; [rw] |
|
Value of the character used to separate name,value pairs |
property ValueFromIndex: String; [rw] |
|
Return the value part of a string based on it's index. |
|
Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand. |
|
property CommaText: String; [rw] |
|
Contents of the list as a comma-separated string. |
|
Number of strings in the list. |
|
property Names: String; [r] |
|
Name parts of the name-value pairs in the list. |
|
Indexed access to the objects associated with the strings in the list. |
|
property Values: String; [rw] |
|
Value parts of the name-value pairs in the list. |
property Strings: String; default; [rw] |
|
Indexed access to the strings in the list. |
property Text: String; [rw] |
|
Contents of the list as one big string. |
property StringsAdapter: IStringsAdapter; [rw] |
|
Not implemented in Free Pascal. |
end; |
|
Class to manage arrays or collections of strings |
|
| | ||
|
Base class for streaming system and persistent properties. |
|
| | ||
|
Base class of all classes. |
TStrings implements an abstract class to manage an array of strings. It introduces methods to set and retrieve strings in the array, searching for a particular string, concatenating the strings and so on. It also allows an arbitrary object to be associated with each string.
It also introduces methods to manage a series of name=value settings, as found in many configuration files.
An instance of TStrings is never created directly, instead a descendent class such as TStringList should be created. This is because TStrings is an abstract class which does not implement all methods; TStrings also doesn't store any strings, this is the functionality introduced in descendents such as TStringList.
|
Standard implementation of the TStrings class. |
lazarus-ccr.sourceforge.net |