Re: [Wing-007-technical] binary stream
Status: Pre-Alpha
Brought to you by:
renqilin
From: 任麒麟 <ren...@gm...> - 2009-04-14 00:39:12
|
Hi Stein, Wow! That's a good declaration. Thanks for the work. I just have a few personal comments: #1 How about using the following function to detect endianness at runtime? int BigEndianTest() { unsigned char EndianTest[2] = {1,0}; short x = *(short *)EndianTest; if( x == 1 ) return false; else return true; } #2. Instead of having a std::fstream inside a BinaryStream, I would putting a IBinaryBuffer* or what ever else inside a BinaryStream. As we disucssed before, a stream class contains a stream buffer (Same concept of std::iostream). For the first release, if you don't want to include Interface.h. You can make IBinaryBuffer a separate class and doesn't dervied from Interface. Then, we can attach a IBinaryBuffer* pointer to BinaryStream. By doing so we can also avoid including stl headers in public directory. Qilin. 2009/4/13 Stein Gunnar Grastveit <gra...@pv...> > Hi, > the binary stream will be something like this header file. > Is the macro that detect little/big endian in the old configure.h going > to be in this new cross platform edition? > > -steini > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Wing-007-technical mailing list > Win...@li... > https://lists.sourceforge.net/lists/listinfo/wing-007-technical > > |