AW: [lazarus] LFM Files

Sebastian Günther sguenther at gmx.de
Thu Oct 12 17:57:13 EDT 2000


Robert Scott Horning wrote:
> 
> I'm curious in how the DFM/LFM format is incompatible with a 64 bit OS (or 128 bit
> OS like on a Sony Play Station, ect.)?  I guess this would be in reference to the
> binary DFM file format, which I'll admit will have some problems as you mention.
> What would a text-editor readable format of the DFM offer that would be counter to
> an OS or CPU which is greater than 32 bits?

You are right, only the binary format is a problem (and a big mess). But
as normally DFM files are binary files I referred to binary files,
sorry.


But here is the description for the binary DFM format, to end the
discussion (hopefully):

-----

DFM files consist of:

|- Header
|- Form: Binary serialised object



DFM Header
----------
Byte    Value 255 ($FF)
Byte    Value 10
Byte    Value 0
? Byte  Null terminated string: Resource name, in DFM's this is always
	the type of the form in upper case.
2 Bytes $1030
4 Bytes Size of binary serialisation in bytes


Binary serialisation
--------------------

- Signature
   4 Bytes: "TPF0"
- Form object
  |- Properties
  |- Sub objects
     |- Properties
     ...


Objects
-------
- Header
   ONLY when ffInherited and/or ffChildPos would be set to 1:
   Byte    TFilerFlags
           Bit Meaning
           0   ffInherited
           1   ffChildPos
           2-3 unused (0)
           4-7 always 1  (==> presence indicator for this byte!)
           When ffChildPos is set:
               Int     ChildPos (Index of child in array)
   SStr    Class name
   SStr    Object name
- Properties
   For each property:
   SStr    Property name
   Value: TValueType, followed by the value itself
       vaString
         Simple ShortString (length byte + string)
       vaLString
         ???
       Identifer
         Simple ShortString (length byte + string)
       Integer
         Byte -> vaInt8, vaInt16, vaInt32, followed by 1/2/4 value bytes
       Float
       vaSet
         List of ShortStrings, terminated by an empty string
       ListBegin / Values / ListEnd
       Binary
         4 Bytes length of data, followed by the binary data
       vaCollection
         |-List of:
         |    (Optional) Integer: Order
         |    ListBegin
         |    Property list
         |    ListEnd
         |-ListEnd (0 byte)
- List End
   Byte    vaNull (0)
- Sub objects
   -> recursively (Header, Properties, Sub-sub objects etc.)
- List End
   Byte    vaNull (0)

-----


- Sebastian






More information about the Lazarus mailing list