Re: directly serializing structs
On Jun 27, 4:03 pm, Dave Rahardja
<drahardja_atsign_pobox_dot_...@pobox.com> wrote:
On Tue, 26 Jun 2007 03:30:54 -0500, "JohnQ"
<johnqREMOVETHISprogram...@yahoo.com> wrote:
"James Kanze" <james.ka...@gmail.com> wrote in message
news:1182688051.946308.66190@p77g2000hsh.googlegroups.com...
On Jun 23, 11:58 am, "JohnQ" <johnqREMOVETHISprogram...@yahoo.com>
wrote:
(Note too that "endianness" isn't a good word, since it suggests
two possible arrangements. At least three are widespread.)
But that one is called "middle ENDIAN" right? If so, that makes "endiann=
ess"
I've never heard it called anything:-). It just is. (There are
also word addressed machines, where it makes no sense to speak
of "endian".)
I think the final takeaway of this thread may be this: define your
serialization schema down to the bit level, in a separate document from y=
our
internal program design. Then, provide an interface that allows you to
serialize and unserialize your internal data structures. Then, provide a
compiler/platform specific library to perform the conversions. Then, repl=
ace
or conditional-compile the conversion library as needed as your program g=
ets
ported from one compiler/platform to another.
That's true to a point. In practice, there's no need for any
compiler/platform specific code (except, perhaps, for
performance reasons when dealing with floating point).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34