[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: MS Office filters & Suns
From:       Harri Porten <porten () tu-harburg ! de>
Date:       2000-06-12 17:08:16
[Download RAW message or body]

Werner Trobin wrote:
> 
> OLE 2 documents are built like a directory structure which
> holds streams (=files). KLaola (the class which encodes
> the document) knows nothing about the contents of the
> streams. In case of WinWord, for example, the streams
> contain enormous amounts of short, int,... numbers,
> text, and so on.

Is this MS data always of the same Endianess ?

> This data stream is read from the disk and holds the
> information in little endian format. I split the
> document up and memcpy(!) the streams to buffers which
> are passed on to the real filters. The filter library

The individual filter do know what data type the read, right ?

> has to ensure that the data is read correctly.
> 
> In KLaola I can't do anything else but a memcpy, because
> I don't know if I copy a long, char, short, int,...

Seems to me as if the only solution would be a differentiation between
endianess on each reading of a critical data type. Something like:

int readInt(int i;)
{
#ifdef WORDS_BIGENDIAN
   int j;
   // swap bytes
   return ; 
#else
   return i;
#endif
}

Looks very painfull :(

Harri.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic