I'm doing a bit of a file-format converting, and looking at some Delphi code I was able to get my hands on to decode the original format.
It's a binary file, and I have the function for how the information is written and read from this file, so most of the things are clear. I am however stumped on something.
Within the file there is a line where we read in a bunch of bits into Array[i]:
S.ReadBuffer(Array[i], sizeOf(Array[i]));
Now, I saw this thread, but I'm not sure the same applies to formats written through Delphi (although I would assume so?). How could I tell the actual sizeof for Array[i]? Just by counting the variables in the array I get 168 bits, but how do I properly pad them? Is there a way to get this information from stream declarations?
And I guess another question about this whole format is - do the parts of the struct (struct corresponding to Array[i]) get written in their declared order? What if it's a struct within a struct?
If it matters, I'm decoding it using a Matlab script (for now).
EDIT: Here is the structure declaration:
UsegDef = Record
tinc: extended;
cinc: extended;
tA: LongInt;
tB: LongInt;
tC: LongInt;
Arr: Array of seg;
end;
seg = Record
val: smallint;
time: longword;
typ: byte;
end;