#ifndef __CLODHANDLER_H__ #define __CLODHANDLER_H__ #include "../global.h" #include #include #include #include "../nodrze.h" /* * CLodhandler.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ struct SDL_Surface; class CDefHandler; class CDefEssential; namespace boost{ namespace iostreams { class mapped_file_source; }}; namespace NLoadHandlerHelp { const int dmHelp=0, dmNoExtractingMask=1; //std::string P1,P2,CurDir; const int fCHUNK = 50000; }; struct Entry { // Info extracted from LOD file int offset, //from beginning realSize, //size without compression size; //and with std::string nameStr; bool operator<(const std::string & comp) const { return nameStr entries; unsigned int totalFiles; std::string myDir; //load files from this dir instead of .lod file CLodHandler(): mmlod(NULL), totalFiles(0) {}; int readNormalNr (const unsigned char* bufor, int bytCon, bool cyclic=false); //lod header reading helper int infs(const unsigned char * in, int size, int realSize, std::ofstream & out, int wBits=15); //zlib fast handler int infs2(const unsigned char * in, int size, int realSize, unsigned char*& out, int wBits=15); //zlib fast handler unsigned char * giveFile(std::string defName, int * length=NULL); //returns pointer to the decompressed data - it must be deleted when no longer needed! std::string getTextFile(std::string name); //extracts one file void extract(std::string FName); void extractFile(std::string FName, std::string name); //extracts a specific file void init(const std::string lodFile, const std::string dirName); const unsigned char *dataptr(); // Returns ptr to FLOD data array }; #endif // __CLODHANDLER_H__