Please find attached the changes to add zlib support. This enables to read and write gzip-ed/zlib-ed xml data. The changes were made against version 2.5.3.
There are some glitches with the pre-processor flag, there is also a bug when compiling with MinGW g++ V3.4.2. Therefore, I upload the revised version again. You need to compile with -D=WITH_ZLIB
Currently, read of gzipped-xml data seems to work fine, writing is only partially working. Specifically, the method
void TiXmlText::gzPrint( gzFile cfile, int depth ) const
seems to produce just an empty field, I do not know why.
The problem is solved. Compile with -D=WITH_ZLIB, and you can save an gzipped xml-file with
SaveFile(char *filename, int compression);
compression be any integer from 0 (no compression) to 9 (most compression). SaveFile(filename, 0) is the same as SaveFile(filename);
LoadFile(filename) will load compressed and uncompressed XML-files.
Log in to post a comment.