Classes unit
Basic classes for RTL.
This documentation describes the FPC classes unit.
The Classes unit contains basic classes for the Free Component
Library (FCL):
- a TList class for maintaining lists of pointers,
- TStringList for lists of strings,
- TCollection to manage collections of objects
- TStream classes to support streaming.
Furthermore it introduces methods for object persistence, and classes that understand an owner-owned relationship, with automatic memory management.
Classes and records
ComponentPlatformsAttribute | class | |
EBitsError | class | Exception raised when an error occurs in a method of . |
EClassNotFound | class | Exception raised when an unknown class is referenced in a streamed component. |
EComponentError | class | Exception raised when an error occurs in the component registration routines. |
EFCreateError | class | Exception raised when an error occurred during creation of a stream. |
EFilerError | class | Exception raised by the component streaming system if an error occurs. |
EFOpenError | class | Exception raised when an error occurred during creation of a . |
EInvalidImage | class | Exception raised when the resource header needed for streaming of a component is invalid. |
EInvalidOperation | class | Exception raised when an invalid operation is performed. Obsolete. |
EMethodNotFound | class | This exception is no longer used. |
EObserver | class | Error raised when an observer error occurs. |
EObserverException | class | |
EOutOfResources | class | Exception raised when the system is out of resources. |
EParserError | class | Exception raised when an error occurs during the parsing of streams. |
EReadError | class | Exception raised if an error occurs while reading from a stream. |
EResNotFound | class | Exception raised when a resource, needed to initialize a component, is not found. |
EStreamError | class | Exception raised when an error occurs during read or write operations on a stream. |
EStringListError | class | Exception raised when an error occurs in a method of . |
EThread | class | Thread error exception. |
EThreadDestroyCalled | class | Exception raised when a thread is destroyed illegally. |
EThreadExternalException | class | Exception raised when an invalid operation is attempted on an external thread. |
EWriteError | class | Exception raised when an error occurs during writing to a stream. |
IControlValueObserver | interface | |
IDesignerNotify | interface | Designer notification interface. |
IEditFormatLink | interface | |
IEditGridLinkObserver | interface | |
IEditLinkObserver | interface | |
IFPObserved | interface | Interface implemented by an object that can be observed. |
IFPObserver | interface | Interface for an object to observe other objects. |
IInterfaceComponentReference | interface | Interface for checking component references. |
IInterfaceList | interface | Interface for maintaining a list of interfaces. |
IInterfaceListEx | interface | |
IIteratorLinkObserver | interface | |
IMultiCastObserver | interface | |
IObserver | interface | |
IObserverTrack | interface | |
IPositionLinkObserver | interface | |
IPositionLinkObserver170 | interface | |
ISingleCastObserver | interface | |
IStreamPersist | interface | Persistence streaming interface. |
IStringsAdapter | interface | IStringsAdapter Interface declaration. |
IVCLComObject | interface | Com automation Object interface. |
ObservableMemberAttribute | class | |
TAbstractObjectReader | class | Abstract driver class to read stored component data. |
TAbstractObjectWriter | class | Abstract driver class for writing component data. |
TBasicAction | class | Abstract base class for all Actions. |
TBasicActionLink | class | Link between actions and action clients (e.g. controls). |
TBinaryObjectReader | class | Driver class descendant which reads component data stored in binary format. |
TBinaryObjectWriter | class | Driver class which stores component data in binary form. |
TBits | class | Class to store collections of bits (binary values that can be 0 or 1). |
TBytesStream | class | Stream of bytes. |
TCollection | class | Base class to manage collections of named objects. |
TCollectionEnumerator | class | Implements IEnumerator for the TCollection class. |
TCollectionItem | class | Basic object that is managed by a class. |
TComponent | class | Base class for all components that need owner-owned functionality. |
TComponentEnumerator | class | Implements IEnumerator for the TComponent class. |
TCustomMemoryStream | class | Abstract stream that stores its data in memory. |
TDataModule | class | Container for non-visual components. |
TFiler | class | Class responsible for streaming of components. |
TFileStream | class | Stream that stores its data in a named file on disk. |
TFPList | class | Class to manage collections of pointers. |
TFPListEnumerator | class | Implements IEnumerator for the TFPList class. |
THandleStream | class | Base class for streams that are identified by an OS handle. |
TIdentMapEntry | record | Record used when associating names with integer values. |
TInterfacedPersistent | class | TPersistent descendant which implements the IInterface interface. |
TInterfaceList | class | Standard implementation of the IInterfaceList interface. |
TInterfaceListEnumerator | class | Implements IEnumerator for the TInterfaceList class. |
TLinkObservers | class | |
TList | class | Class to manage collections of pointers. |
TListEnumerator | class | Implements IEnumerator for the TList class. |
TMemoryStream | class | Standard implementation of a stream that stores its data in memory. |
TObserverMapping | class | |
TObservers | class | |
TOwnedCollection | class | TCollection descendant which maintains owner information. |
TOwnerStream | class | Stream which uses a second stream as a source. |
TParser | class | Class to parse the contents of a stream containing text data. |
TPersistent | class | Base class for streaming system and persistent properties. |
TProxyAggregateStream | class | |
TProxyStream | class | Proxy stream for the IStream interface. |
TRawByteStringStream | class | TBytesStream descendent with some single-byte string methods. |
TReader | class | Generic reader object which reads component data from any given source. |
TRecall | class | Helper class for storing published properties. |
TResourceStream | class | Stream that reads its data from a resource object. |
TStream | class | Base class for streams. |
TStreamAdapter | class | Implements IStream for TStream descendants. |
TStringItem | record | The TStringItem is used to store the string and object items in a string list instance. It should never be used directly. |
TStringList | class | Standard implementation of the class. |
TStrings | class | Class to manage arrays or collections of strings. |
TStringsEnumerator | class | Implements IEnumerator for the TStrings class. |
TStringStream | class | Stream that stores its data in a string. |
TTextObjectWriter | class | Driver class which stores component data in text format. |
TThread | class | Abstract Thread class. |
TThreadList | class | Thread-safe list object. |
TWriter | class | Object to write component data to an arbitrary format. |
Procedures and functions
ActivateClassGroup | function | Activates a class group. |
BeginGlobalLoading | procedure | Not yet implemented. |
BinToHex | procedure | Convert a binary buffer to a hexadecimal string. |
Bounds | function | Returns a TRect structure with the bounding rect of the given location and size. |
CheckSynchronize | function | Check whether there are any synchronize calls in the synchronize queue. |
ClassGroupOf | function | Returns the class group to which an instance or class belongs. |
CollectionsEqual | function | Returns True if two collections are equal. |
EndGlobalLoading | procedure | Not yet implemented. |
ExtractStrings | function | Split a string in different words. |
FindClass | function | Returns the class pointer of a class with given name. |
FindGlobalComponent | function | Callback used when a component must be found. |
FindIdentToInt | function | Return the string to integer converter for an integer type. |
FindIntToIdent | function | Return the integer to string converter for an integer type. |
FindNestedComponent | function | Finds the component with name path starting at the indicated root component. |
GetClass | function | Returns the class pointer of a class with given name. |
GetFixupInstanceNames | procedure | Returns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName. |
GetFixupReferenceNames | procedure | Returns the names of elements that need to be resolved for the root component. |
GlobalFixupReferences | procedure | Called to resolve unresolved references after forms are loaded. |
GroupDescendentsWith | procedure | Provided for Delphi compatibility. |
HexToBin | function | Convert a hexadecimal string to a binary buffer. |
IdentToInt | function | Looks up an integer value in a integer-to-identifier map list. |
IfThen | function | |
InitComponentRes | function | Provided for Delphi compatibility only. |
InitInheritedComponent | function | Initializes a component descending from RootAncestor. |
IntToIdent | function | Looks up an identifier for an integer value in a identifier-to-integer map list. |
InvalidPoint | function | Check whether a point is invalid. |
IsUniqueGlobalComponentName | function | |
LineStart | function | Finds the start of a line in Buffer before BufPos. |
NotifyGlobalLoading | procedure | Not yet implemented. |
ObjectBinaryToText | procedure | Converts an object stream from a binary to a text format. |
ObjectResourceToText | procedure | Converts an object stream from a (windows) resource to a text format. |
ObjectTextToBinary | procedure | Converts an object stream from a text to a binary format. |
ObjectTextToResource | procedure | Converts an object stream from a text to a (windows) resource format. |
Point | function | Returns a TPoint record with the given coordinates. |
PointsEqual | function | Check whether two TPoint variables are equal. |
ReadComponentDeltaRes | function | |
ReadComponentRes | function | Read component properties from a resource in the current module. |
ReadComponentResEx | function | Read component properties from a resource in the specified module. |
ReadComponentResFile | function | Read component properties from a specified resource file. |
Rect | function | Returns a TRect record with the given coordinates. |
RedirectFixupReferences | procedure | Redirects references under the root object from OldRootName to NewRootName. |
RegisterClass | procedure | Registers a class with the streaming system. |
RegisterClassAlias | procedure | Registers a class alias with the streaming system. |
RegisterClasses | procedure | Registers multiple classes with the streaming system. |
RegisterComponents | procedure | Registers components for the component palette. |
RegisterFindGlobalComponentProc | procedure | Register a component searching handler. |
RegisterInitComponentHandler | procedure | Register a component initialization handler. |
RegisterIntegerConsts | procedure | Registers some integer-to-identifier mappings. |
RegisterNoIcon | procedure | Registers components that have no icon on the component palette. |
RegisterNonActiveX | procedure | Register non-activex component. |
RemoveFixupReferences | procedure | Removes references to rootname from the fixup list. |
RemoveFixups | procedure | Removes Instance from the fixup list. |
SmallPoint | function | Returns a TSmallPoint record with the given coordinates. |
StartClassGroup | procedure | Start new class group. |
TestStreamFormat | function | |
UnRegisterClass | procedure | Unregisters a class from the streaming system. |
UnRegisterClasses | procedure | Unregisters multiple classes from the streaming system. |
UnregisterFindGlobalComponentProc | procedure | Remove a previously registered component searching handler. |
UnRegisterModuleClasses | procedure | Unregisters classes registered by module. |
WriteComponentResFile | procedure | Write component properties to a specified resource file. |
Types
EListError | type | Exception raised when an error occurs in lists handling. |
HMODULE | type | Special type for handling modules. |
HRSRC | type | Type to manage resources. |
PBitsBase | type | |
PPointerList | type | Pointer to an array of pointers. |
PStringItem | type | Pointer to a record. |
PStringItemList | type | Pointer to a . |
TActionEvent | procedure type | |
TActiveXRegType | enumeration | Used when registering ActveX component types. |
TAlignment | enumeration | Type to specify text alignment in controls that display text. |
TAncestorNotFoundEvent | procedure type | This event occurs when an ancestor component cannot be found. |
TBasicActionClass | type | class reference. |
TBasicActionLinkClass | type | class reference. |
TBiDiMode | enumeration | BIDI description. |
TBitsBase | type | |
TBitsBaseSigned | type | |
TBitsOpCallback | procedure type | |
TBitsOpTruth | type | |
TCollectionItemClass | type | Class reference for . |
TCollectionNotification | enumeration | Collection change notification enumeration. |
TCollectionSortCompare | procedure type | Callback to sort collection items. |
TCollectionSortCompare_Context | procedure type | |
TComponentClass | type | Class of TComponent. |
TComponentName | type | Special type for component names. |
TComponentState | set | Indicates the state of the component during the streaming process. |
TComponentStyle | set | Describes the style of the component. |
TCreateComponentEvent | procedure type | Event handler type, occurs when a component instance must be created when a component is read from a stream. |
TDataModuleClass | type | Class pointer for TDataModule. |
TDuplicates | type | Type to describe what to do with duplicate values in a . |
TExceptionClass | type | Class of Exception. |
TFilerFlag | enumeration | Flags used by the class. |
TFilerFlags | set | Set of . |
TFindAncestorEvent | procedure type | Event that occurs w. |
TFindComponentClassEvent | procedure type | Event handler type, occurs when a component class pointer must be found when reading a component from a stream. |
TFindComponentClassExEvent | procedure type | |
TFindGlobalComponent | procedure type | Callback type to search for a component. |
TFindMethodEvent | procedure type | Occurs when the streaming process needs to locate a method. |
TFPObservedOperation | enumeration | Operation which is reported to an observer. |
TGetChildProc | procedure type | Callback used when obtaining child components. |
TGetDeltaStreamsEvent | procedure type | |
TGetStreamProc | procedure type | |
TGetStrProc | procedure type | Event for retrieving string values. |
THandle | type | Type to manage streams. |
THelpContext | type | Range type to specify help contexts. |
THelpEvent | procedure type | Special event for display of online help. |
THelpType | enumeration | Enumeration type specifying the kind of help requested. |
THintEvent | procedure type | |
TIdentToInt | procedure type | Callback for converting identifiers to integers. |
TIInterfaceArray | type | |
TInitComponentHandler | procedure type | Callback type for RegisterInitComponentHandler. |
TIntToIdent | procedure type | Callback for converting integers to identifiers. |
TIsUniqueGlobalComponentName | procedure type | |
TLeftRight | type | Subrange type based on TAlignment. |
TListAssignOp | enumeration | List assign operation. |
TListCallback | type | Method callback type for TFPList.ForEachCall. |
TListNotification | enumeration | Kind of list notification event. |
TListSortCompare | procedure type | Callback type for the list sort algorithm. |
TListStaticCallback | type | Static method callback type for TFPList.ForEachCall. |
TMissingNameValueSeparatorAction | enumeration | What to to with Name=value pairs if the separator is missing. |
TMissingNameValueSeparatorActions | set | Set of TMissingNameValueSeparatorAction. |
TNotifyCallBack | procedure type | Thread termination callback handler. |
TNotifyEvent | procedure type | Standard event handler type. |
TObjectTextEncoding | enumeration | Encoding of the object text file. |
TObserverGetCurrentEvent | procedure type | |
TObserverToggleEvent | procedure type | |
TOperation | enumeration | Operation of which a component is notified. |
TPersistentClass | type | Class reference type for . |
TPlatformIds | type | |
TPoint | type | Special type to handle a fake position. |
TPointerList | type | Type for an Array of pointers. |
TPropertyNotFoundEvent | procedure type | Callback for the event. |
TReadComponentsProc | procedure type | Callback type when reading a component from a stream. |
TReaderError | procedure type | Event handler type, called when an error occurs during the streaming. |
TReaderProc | procedure type | Reader procedure used by DefineProperties. |
TReadWriteStringPropertyEvent | procedure type | Callback for the event handler. |
TRect | type | Describes a rectangle. |
TReferenceNameEvent | procedure type | Occurs when a named object needs to be looked up. |
TSeekOrigin | enumeration | Specifies the origin of the method. |
TSetMethodPropertyEvent | procedure type | Callback for the event. |
TSetNameEvent | procedure type | Occurs when the reader needs to set a component's name. |
TShiftState | set | Indicates what special keys were pressed in combination with a normal key. |
TShiftStateEnum | enumeration | Keyboard/Mouse shift state enumerator. |
TShortCut | type | Enumeration type to identify shortcut key combinations. |
TSmallPoint | type | Type to describe point in a small plane. |
TStreamOriginalFormat | enumeration | |
TStreamOwnership | enumeration | Determines the ownership of a TStreamAdapter. |
TStreamProc | procedure type | Procedure type used in streaming. |
TStringItemList | type | Array of records. |
TStringListSortCompare | procedure type | Callback type used in stringlist compares. |
TStringsClass | type | Class of TStrings. |
TStringsFilterMethod | procedure type | Callback signature for TStrings.Filter. |
TStringsForEachMethod | procedure type | Callback signature for TStrings.Foreach. |
TStringsForEachMethodEx | procedure type | Callback signature for TStrings.Foreach. |
TStringsForEachMethodExObj | procedure type | Callback signature for TStrings.Foreach. |
TStringsMapMethod | procedure type | Reduce algorithm for TStrings.Map. |
TStringsOption | enumeration | Enumeration of options used in TStrings. |
TStringsOptions | set | Set of TStringsOption. |
TStringsReduceMethod | procedure type | Reduce algorithm for TStrings.Reduce. |
TStringsSortStyle | enumeration | Determines how the strings are sorted. |
TStringsSortStyles | set | Set of TStringsSortStyle. |
TSynchronizeProcVar | procedure type | Synchronize callback type. |
TThreadExecuteCallBack | procedure type | Signature of procedure to execute in a thread, without status reporting. |
TThreadExecuteHandler | type | Signature of method to execute in a thread, without status reporting. |
TThreadExecuteStatusCallBack | procedure type | Signature of procedure to execute in a thread, with status reporting. |
TThreadExecuteStatusHandler | procedure type | Signature of method to execute in a thread, with status reporting. |
TThreadMethod | procedure type | Procedure variable used when synchronizing threads. |
TThreadPriority | enumeration | Enumeration specifying the priority at which a thread runs. |
TThreadReportStatus | procedure type | Thread status report callback prototype. |
TThreadStatusNotifyCallBack | procedure type | Signature of thread status report callback. |
TThreadStatusNotifyEvent | procedure type | Signature of thread status report event handler. |
TTopBottom | type | Range of alignments. |
TValueType | enumeration | Enumerated type used to identify the kind of streamed property. |
TVerticalAlignment | enumeration | Vertical alignment type. |
TWriteMethodPropertyEvent | procedure type | Callback for the event. |
TWriterProc | procedure type | Writer procedure used by DefineProperties. |
Constants
dupAccept | constant | Duplicate values can be added to the list. |
dupError | constant | If an attempt is made to add a duplicate value to the list, an exception is raised. |
dupIgnore | constant | Duplicate values will not be added to the list, but no error will be triggered. |
FilerSignature | constant | Constant that is found at the start of a binary stream containing a streamed component. |
FilerSignature1 | constant | |
fmCreate | constant | creates a new file if needed. |
fmOpenRead | constant | opens a file with read-only access. |
fmOpenReadWrite | constant | opens a file with read-write access. |
fmOpenWrite | constant | opens a file with write-only access. |
MaxBitFlags | constant | Maximum number of bits in TBits collection. |
MaxListSize | constant | Maximum number of elements in list. |
NilHandle | constant | |
pfidAndroid | constant | |
pfidiOS | constant | |
pfidLinux | constant | |
pfidOSX | constant | |
pfidWindows | constant | |
pidAllPlatforms | constant | |
pidAndroidArm32 | constant | |
pidAndroidArm64 | constant | |
pidiOSDevice32 | constant | |
pidiOSDevice64 | constant | |
pidiOSSimulator32 | constant | |
pidiOSSimulator64 | constant | |
pidiOSSimulatorArm64 | constant | |
pidLinux32 | constant | |
pidLinux64 | constant | |
pidLinuxArm32 | constant | |
pidLinuxArm64 | constant | |
pidOSX32 | constant | |
pidOSX64 | constant | |
pidOSXArm64 | constant | |
pidWin32 | constant | |
pidWin64 | constant | |
pidWinARM32 | constant | |
pidWinArm64 | constant | |
pidWinIoT32 | constant | |
pidWinNX32 | constant | |
scAlt | constant | Indicates ALT key in a keyboard shortcut. |
scCommand | constant | |
scCtrl | constant | indicates CTRL key in a keyboard shortcut. |
scNone | constant | Indicates no special key is pressed in a keyboard shortcut. |
scShift | constant | Indicates Shift key in a keyboard shortcut. |
SGUIDObserved | constant | Observed interface GUID as a string. |
SGUIDObserver | constant | Observer interface GUID as a string. |
soFromBeginning | constant | Seek starts relative to the stream origin. |
soFromCurrent | constant | Seek starts relative to the current position in the stream. |
soFromEnd | constant | Seek starts relative to the stream end. |
ssCommand | constant | |
toEOF | constant | Value returned by when the end of the input stream was reached. |
toFloat | constant | Value returned by when a floating point value was found in the input stream. |
toInteger | constant | Value returned by when an integer was found in the input stream. |
toString | constant | Value returned by when a string was found in the input stream. |
toSymbol | constant | Value returned by when a symbol was found in the input stream. |
toWString | constant | Value returned by when a widestring was found in the input stream. |
Variables
AddDataModule | variable | Handler called when a new TDataModule instance is created. |
ApplicationHandleException | variable | Handler for exceptions when a TDataModule streaming error occurs. |
ApplicationShowException | variable | Unused. |
CreateVCLComObjectProc | variable | Called to create an instance of IVCLComObject. |
DelphiCompatibleStreams | variable | |
GlobalNameSpace | variable | Global namespace. |
IsUniqueGlobalComponentNameProc | variable | |
MainThreadID | variable | ID of main thread. Unused at this point. |
RegisterComponentsProc | variable | Callback procedure used when handling component registration. |
RegisterNoIconProc | variable | Callback procedure used when handling icon-less component registration. |
RemoveDataModule | variable | Handler called when a TDataModule instance is freed. |
WakeMainThread | variable | Handler which is called if a thread wants to synchronize with the main application thread. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
