Re: [Wing-007-technical] Making wing modules platform-independent ---- much tougher than I expected
Status: Pre-Alpha
Brought to you by:
renqilin
|
From: Stein G. G. <gra...@pv...> - 2009-04-07 15:04:59
|
Hi, I been reading a little bit about binary files, and binary data. I thin we need: binaryString biofstream The binaryString will hold a string containing binary data ( big endian or little endian based on system, detected in configuration.h ). And sizeof( int, float ... ) is defined in types.h? To put 50 bytes in a struct I think it should be done through a binaryString to be sure the data is encoded for the current system. And for read/write I guess we are going to use the types defined in types.h ? And always store files as little endian? -steini On Tue, 2009-04-07 at 20:03 +0800, 任麒麟 wrote: > Hi Stein, > > Thank you for the comments. Yes we are going to replace fstream with > our own binary stream class. For text streams, we will continue to use > std::iostream. > > I did a search on google, and I saw many people are working on > creating their iostream, in order to support endianness and a stable > binary format. I hope the C++ standard committee will improve binary > iostream in their next version of C++ standard. :) > Here is an example: > http://groups.google.com/group/comp.lang.c > ++.moderated/msg/958518518f57dda1?pli=1 > > I also agree with your priority on modules. Strings in wing are > defined at: > > WingSDK/Include/Framework/StringUtility.h // basic C functions. Unify > the ascii string functions and unicode functions to avoid finger ache. > WingSDK/Include/Framework/AsciiString.h > WingSDK/Include/Framework/UnicodeString.h > WingSDK/Include/Framework/String.h > Source/Framework/String.cpp > Source/Framework/String.inl > Source/Framework/StringUtility.cpp > Source/Framework/StringUtility.inl > > Kmp fast string search algorithm is implemented at: > > Source/Internal/Framework/KmpStringSearch.h > Source/Framework/KmpStringSearch.cpp > > I provided some functions to unify the ascii string and unicode string > operations. Moving them to sandbox in a platform-independetn form may > takes time. > > The reason of using our own string instead of std::string is to avoid > data loss between different modules that are compiled with different > version of stl, and avoid crash due to releasing the memory allocated > in another module. > > You can compile the sandbox code by: Build/gnu/Makefile > > If you want to add files to project, you can modify > Build/framework.lua or Build/framework_usage.lua, then execute > Build/GenerateProjects.sh to generate the make file. In order to run > that script, you may need to download the external library for linux > at: https://sourceforge.net/project/showfiles.php?group_id=160056 > > Qilin. > > 2009/4/7 Stein Gunnar Grastveit <gra...@pv...> > Hi, > > "Is there anybody has some thoughts on iostream, log system, > string, > threads and file/directory?" > > > I think this should be the priority for these. > 1. string > 2. file/directory > 3. iostream > 4. log system > 5. threads. > > This is because I think first we will need a string, and to > make a io > system that works with our string, we'll need file access. > > But there are some fileIO and string implementation on svn > (not > cross-platform). Is it those file we need to improve and make > them > cross-platform? > > I'll like to start working on some of these problems, and help > get the > framework cross-platform. But I need to know where to begin > and what it > should support. > > Are we going to replace iostream, fstream etc? > > -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 |