diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-08-14 23:45:02 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-08-14 23:45:02 +0800 |
commit | 92f17580846c88108aab023092c23e6bcdcf2f75 (patch) | |
tree | 0b05ee9215e46c02482e545989a8f92041bcc4f6 /include/smdatapack.hpp | |
parent | fff589be8d4a363c01c698c052fc43de806f5055 (diff) | |
download | bullet-lab-remix-92f17580846c88108aab023092c23e6bcdcf2f75.tar.xz |
SMELT is finally finished! Add the SMELT library for future use.
Add .gitignore.
Diffstat (limited to 'include/smdatapack.hpp')
-rw-r--r-- | include/smdatapack.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/include/smdatapack.hpp b/include/smdatapack.hpp new file mode 100644 index 0000000..ace7c81 --- /dev/null +++ b/include/smdatapack.hpp @@ -0,0 +1,57 @@ +// -*- C++ -*- +/* + * Simple MultimEdia LiTerator(SMELT) + * by Chris Xiong 2015 + * api level 1 + * DaTaPack format support header + * + * WARNING: This library is in development and interfaces would be very + * unstable. + * + */ +#ifndef SMDTP_H +#define SMDTP_H +#include "smelt.hpp" +#include <cstdlib> +#include <zlib.h> +#include <string> +#include <map> +class smFileInfo +{ +public: + char *path,*data; + DWORD size,offset,crc; +}; +class smDtpFileR +{ +private: + int fcnt; + gzFile file; + std::map<std::string,smFileInfo> m; + + bool enmemory; + DWORD msize; + char *cp,*bp; +public: + bool openDtp(const char* path); + bool openDtpFromMemory(char* ptr,DWORD size); + void closeDtp(); + char* getFirstFile(); + char* getLastFile(); + char* getNextFile(const char* path); + char* getPrevFile(const char* path); + char* getFilePtr(const char* path); + void releaseFilePtr(const char* path); + DWORD getFileSize(const char* path); +}; +class smDtpFileW +{ +private: + smFileInfo files[256]; + int fcnt; +public: + smDtpFileW(); + bool addFile(const char* path,const char* realpath); + bool writeDtp(const char* path); +}; +#endif |