Right now, I find myself looking up the structure 'Foobar', and going
to its #defineFields method, scrolling down to find the final size,
then doing the math myself. It would be nice if I could either have a
call (like Foobar size) or just define fields in order w/o having to
worry about the offsets. Is either of these possible?
Note: I know I can create a class method #size for my own structures,
but I would like to do this with other structures that I didn't write
> On 27 Aug 2006 08:58:32 -0700, "Jeff M." <[hidden email]> wrote:
> >Is there a standard method of getting the final size of an
> >ExternalStructure without instantiating one?
> Send #byteSize to the class. From the method's comment ...
> "Answer the size (in bytes) of the structure the receiver represents"
BTW, you don't normally have to specify an offset -- the framework will work it
out for itself. The only time when you /do/ have to (as far as I know) is when
you are creating the equivalent of C unions or are messing with memory layouts
which cannot be expressed (even non-portably) as C structure definitions.
(Most, probably all, of the code in the image which does specify offsets
explicitly for ordinary structs has been automatically generated -- providing a
set of unhappily misleading examples)