< index < 11. Compression toolkit < 11.5 Getting data from the buffer |
===================================== |
C++ : TCODZip::~TCODZip() C : void TCOD_zip_delete(TCOD_zip_t zip)
Parameter | Description |
---|---|
zip | In the C version, the buffer handler, returned by the constructor. |
C++ : TCODZip *zip = new TCODZip(); zip->loadFromFile("myCompressedFile.gz"); char c=zip->getChar(); int i=zip->getInt(); float f= zip->getFloat(); const char *s=strdup(zip->getString()); // we duplicate the string to be able to use it after the buffer deletion zip->getData(nbBytes, dataPtr); delete zip; C : TCOD_zip_t zip=TCOD_zip_new(); TCOD_zip_load_from_file(zip,"myCompressedFile.gz"); char c=TCOD_zip_get_char(zip); int i=TCOD_zip_get_int(zip); float f=TCOD_zip_get_float(zip); const char *s=strdup(TCOD_zip_get_string(zip)); TCOD_zip_get_data(zip,nbBytes, dataPtr); TCOD_zip_delete(zip);