[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'Classes' (#fcl)

# TWriter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Object to write component data to an arbitrary format.

## Declaration

`type TWriter = class(TFiler)`
`protected`
`procedure SetRoot(); override;` |  | Sets the root component
`procedure WriteBinary();` |  | Writes binary data to the stream.
`procedure WriteProperty();` |  | Writes one property to the stream.
`procedure WriteProperties();` |  | Writes the published properties to the stream.
`public`
`procedure Create();` |  | Creates a new Writer with a stream and bufsize.
`destructor Destroy; override;` |  | Destroys the writer instance.
`procedure DefineProperty(); override;` |  | Callback used when defining and streaming custom properties.
`procedure DefineBinaryProperty(); override;` |  | Callback used when defining and streaming custom properties.
`procedure WriteBoolean();` |  | Write boolean value to the stream.
`procedure WriteCollection();` |  | Write a collection to the stream.
`procedure WriteComponent();` |  | Stream a component to the stream.
`procedure WriteChar();` |  | Write a character to the stream.
`procedure WriteDescendent();` |  | Write a descendent component to the stream.
`procedure WriteFloat();` |  | Write a float to the stream.
`procedure WriteSingle();` |  | Write a single-type real to the stream.
`procedure WriteDate();` |  | Write a date to the stream.
`procedure WriteIdent();` |  | Write an identifier to the stream.
`procedure WriteInteger();` |  | Write an integer to the stream.
`procedure WriteListBegin;` |  | Write a start-of-list marker to the stream.
`procedure WriteListEnd;` |  | Write an end-of-list marker to the stream.
`procedure WriteRootComponent();` |  | Write a root component to the stream.
`procedure WriteString();` |  | Write a string to the stream.
`property RootAncestor: TComponent; [rw]` |  | Ancestor of root component.
`property OnFindAncestor: TFindAncestorEvent; [rw]` |  | Event occurring when an ancestor component must be found.
`property Driver: TAbstractObjectWriter; [r]` |  | Driver used when writing to the stream.
`end;`

## Inheritance

`TWriter` |  | Object to write component data to an arbitrary format.
`TFiler` |  | Class responsible for streaming of components.
`TObject`