TIdThreadSafeString
Implements a thread-safe String data type.
Unit
Description
TIdThreadSafeString is a
TIdThreadSafe descendant that implements a thread-safe data type for storing a String value. TIdThreadSafeString relies on the inherited TCriticalSection for resource protection in multi-threaded applications. TIdThreadSafeString implements the
Value property for reading and writing the String value associated with the class instance with resource protection. TIdThreadSafeString also implements methods that protect write access to
Value using
Append and
Prepend.
Reads or Writes the value for the thread-safe data type.
Description
Value is a String property that represents the value for the thread-safe String data type. Read and write access to the content of Value uses the resource protection capabilities of the object instance to insure reliable access in multi-threaded applications.
Concatenates characters to the end of the thread-safe data type.
procedure Append(const AValue: string);
Parameters
const AValue: string
characters to be added to the end of the value.
Description
Append is a procedure used to concatenate the characters in AValue to the end of the thread-safe String data type. Append calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated value for the data type. Append calls Unlock to disable resource protection when the value is successfully updated, or an exception is raised.
Use Prepend to insert a sequence of characters at the beginning of the thread-safe data type.
Inserts characters at the beginning of the thread-safe data type.
procedure Prepend(const AValue: string);
Parameters
const AValue: string
characters to be inserted in the the data type.
Description
Prepend is a procedure used to insert the sequence of characters in AValue at the beginning of the thread-safe String data type. Prepend calls Lock to enable the resource protection capabilities of the object instance prior to updating the associated value for the data type. Prepend calls Unlock to disable resource protection when the value is successfully updated, or an exception is raised.
Use Append to add a sequence of characters at the end of the thread-safe data type.