Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#44 zlib support

open
nobody
None
6
2009-04-15
2009-04-09
Alois Schloegl
No

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.

Discussion

  • Alois Schloegl
    Alois Schloegl
    2009-04-15

    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.

    Alois

     
  • Alois Schloegl
    Alois Schloegl
    2009-04-15

    • priority: 5 --> 6
     
  • Alois Schloegl
    Alois Schloegl
    2009-04-15

     
    Attachments
  • Alois Schloegl
    Alois Schloegl
    2009-04-15

     
    Attachments
  • Alois Schloegl
    Alois Schloegl
    2009-04-15

    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.