On 12/08/2010 17:19, Geoffrey Hutchison wrote: >> I'm surprised if there is no GPL library which can achieve the same in more >> portable and >> less convoluted way. > > Boost has a number of file filtering methods, including line endings, gzip, > and bzip2 compression/decompression. Along the way, we've tried to minimize > external dependencies, but I suspect in the near future, we will want to use > many features in boost. > >> Or there is some deep meaning to this contortionist's way to convert >> "\r\n" into "\n" by having race conditions for object deallocation that >> I completely missed? > > This isn't a race condition. This is an issue of a double-delete. There's no > threading involved, only discussion of a bug which was missed in the design > phase. > > -Geoff
I too was surprised at not being able to find a *simple* GPL way to convert line endings and compress/decompress on the fly, i.e. using istreams/ostreams. The somewhat heavyweight Boost iostream libraries are certainly possible. They are based on the concepts of James Kanze from whom the code in lineend.h was modified. Jonathan de Halleux, who wrote the compression/decompression stream we use, is also acknowledged. Using the technology pre-packaged would be an advantage, but at the expense of an external dependency. Other suggestions would be welcome. I think it probable that the current problem arises elsewhere in the code which parses XML, which is depressingly complicated and perhaps over-engineered. This seemed to be necessary in order to initialise a C XML parser, libxml2, _after_ the input stream had been opened, and to deconstruct it later. I think is important that the user interface is the same for all formats. Bolting new features on while maintaining an existing structure is likely to lead to more complicated code. I whole-heartedly support extending OB's use of shared pointers. When developing in C++ an excessive amount of time is wasted worrying about deallocation and memory leaks. Chris ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ OpenBabel-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-devel
