TStreamTemplates Class

type TStreamTemplates = class(TPersistent);

Streamable list of lists.

The class handles storing, loading, decoding and encoding of a list of streams. The list of streams is stored in the Templates property. Each stream holds another list of objects. This lists are of TStreamedList type. When the user sets the TemplateIndex or the TemplateName property, the appropriate stream is decoded to Template property, where individual objects contained in the list can be accessed. All changes to those objects are retained and Templates property is kept up-to-date. For TStreamTemplates to handle user defined type of objects, a new class should be derived from TStreamedList type.

Properties

NameTypeDescription
OwnerTComponentReturns the owner object.
TemplateTStreamedListHolds a list of objects.
TemplateIndexIntegerSet TemplateIndex to decode the stream at position TemplateIndex to Template property.
TemplateNamestringSet TemplateName to decode the stream with name TemplateName to Template property.
TemplatesTStringStreamListHolds the list of streams containing data to be decoded to the Template property.

Methods

NameDescription
AddCopyTemplateAdd a new template named S to the list of templates and set TemplateIndex to point to the template added.
AddTemplateAdd a new template (TMemoryStream) named S to the list.
ClearClears the Templates and Template properties.
ConsolidateCall this method to ensure that Template and Templates properties are synchronized.
DeleteDelete the template at position Index from the Templates property.
LoadFromFileLoad the object from the file.
LoadFromStreamLoad all data from the stream.
SaveToFileSave the object to the file.
SaveToStreamSave all data to the stream.
UpdateCalls the Template.Update method.