VCF::VFFOutputStream Class Reference
The VFFOutputStream class is used to support writing a component ( and it's child components) to a stream. More...
#include <vcf/FoundationKit/VFFOutputStream.h>
Inheritance diagram for VCF::VFFOutputStream:

Public Member Functions | |
| VFFOutputStream (OutputStream *stream) | |
| virtual | ~VFFOutputStream () |
| virtual void | seek (const uint64 &offset, const SeekType &offsetFrom) |
| virtual uint64 | getSize () |
| returns the size of the stream. | |
| virtual uchar * | getBuffer () |
| returns a pointer to the buffer that holds the stream memory | |
| virtual uint64 | getCurrentSeekPos () |
| this is a global offset from the beggining of the stream | |
| virtual uint64 | write (const unsigned char *bytesToWrite, uint64 sizeOfBytes) |
| void | writeComponent (Component *component) |
| String | getTabString () |
| void | setSaveUnNamedComponents (const bool &val) |
| void | setWriteComponentClassID (const bool &val) |
Protected Member Functions | |
| String | binToHex (Persistable *persistableObject) |
| virtual void | getComponentHeader (Component *component, String &className, String &classID, String &fallBackClassName) |
| This virtual method gets called by writeComponent() and is used to prepare the "header" of a component section. | |
| void | writeObject (Component *component, Object *object, const String &objectPropertyName) |
| void | writeProperty (Component *component, Property *property) |
| void | writeDelegates (Component *component) |
| String | generateDelegateString (DelegateProperty *delegateProperty, CallBack *handler) |
Protected Attributes | |
| OutputStream * | stream_ |
| int32 | tabLevel_ |
| bool | saveUnNamedComponents_ |
| bool | writeComponentClassID_ |
Detailed Description
The VFFOutputStream class is used to support writing a component ( and it's child components) to a stream.The output is text data, and is human readable. It's loosely based on Borland's DFM file format that was used in Delphi 3.0 (I have no idea if Borland still uses this or not).
The VFF (Visual Form File) output is a hierarchical set of "blocks", with each block representing an object (component). Each block contains a set of properties, and an optional sub-block that lists the events of the component. Each child component is represented by another block nested inside the main block. There is only one "root" block for a given output stream.
A block starts with "object", and ends with "end". Each object has the name of the object followed by a colon (':'), the class name of the object followed by a comma (',') and the class UUID of the object (though this may be left blank). The class UUID is in single quotes. For example:
object Foo1 : Foo, '1234556777' end
Each object block has a list of 0 or more properties that are written out as name/value pairs. The exact syntax is defined as the name of the property followed by an equals sign ('='), followed by the value of the property. For example:
object Foo1 : Foo, '1234556777'
tag = 12
end
object Foo1 : Foo, '1234556777'
toolTipText = 'Some helpful text'
end
object Foo1 : Foo, '1234556777'
doubleBuffered = true
end
Some properties may themselves be complex object that are also written out using name/value pairs. For example, a Control component has a Font object that is it's "font" property. The Font class has several of it's own properties. When this occurs these "sub" properties are written using the name of the property followed by a period ('.') and the name of the sub property. For example:
object Foo1 : Foo, '1234556777'
font.italic = true
font.color.red = 0.02341
font.color.green = 0.02341
font.color.blue = 0.02341
end
Some properties may point to another object that is itself a component (a component property) and part of the "graph" of objects being written out. In this case the object is referred to by it's name, preceded by the "at" sign ('@'). For example:
object Foo1 : Foo, '1234556777'
border = @EtchedBorder1
end
object Foo1 : Foo, '1234556777'
border = null
end
Some properties may actually be made of binary data. In this case the data is prefixed with the open curly bracket ('{') and terminated with the close curly bracket ('}'). Each byte of data is written out as a pair of hexadecimal numbers, effectively doubling the actual storage space required to save the data. Thus if the data in question is 8 bytes long, it will take 16 characters to represent it. An example of some binary data of 12 bytes:
object Foo1 : Foo, '1234556777'
data = {00FFACFE0201104043092FA2}
end
Properties that are enumeration values are written out using the name of the enumeration value as text. For example
object Foo1 : Foo, '1234556777'
alignment = AlignNone
end
A component may have event handlers attached to it's delegates. This list of delegates and attached event handlers is a sub block inside the main object block and is optional. It startes with "delegates" and ends with "end". The block may have 0 or more delegates listed. Each listed delegate has the name of the delegate, followed by an equals sign ('=') and a list of 1 or more event handlers. The list of event handlers is preceded by the open square bracket ('['), and completed with the closed square bracket (']'). Each event handler is separated by a comma (','). A fully qualified event handler is made up of the name of the source component followed by the "at" sign ('@') and the name of the event handler instance itself. For example:
object Foo1 : Foo, '1234556777'
delegates
ComponentDeleted = [
sdasd.vff@VFFDocument::rootFrameDestroyed]
end
end
- See also:
- ClassRegistry
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
|
|
|
||||||||||||
|
|
|
|
returns a pointer to the buffer that holds the stream memory
Implements VCF::Stream. |
|
||||||||||||||||||||
|
This virtual method gets called by writeComponent() and is used to prepare the "header" of a component section. You can override this and "customize" how this data appears. The default implementation simply retrieves the class name and UUID from the component's Class instance. |
|
|
this is a global offset from the beggining of the stream
Implements VCF::Stream. |
|
|
returns the size of the stream. The size represents the number of bytes that have been written, or read to/from the stream Implements VCF::Stream. |
|
|
|
|
||||||||||||
|
Implements VCF::Stream. |
|
|
|
|
|
|
|
||||||||||||
|
Implements VCF::OutputStream. |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/VFFOutputStream.h
