📄 mpq_libmpq.h
字号:
#ifndef MPQ_H
#define MPQ_H
//#include "SFmpqapi.h"
#include "libmpq/mpq.h"
// C++ files
#include <string>
#include <set>
//#include <stdlib.h>
//#include <crtdbg.h>
//#include <wx/string.h>
// TODO: Modify MPQFile to check for an existing local file first before reading from the archive.
class MPQArchive
{
//MPQHANDLE handle;
mpq_archive mpq_a;
public:
MPQArchive(const char* filename);
~MPQArchive();
void close();
};
class MPQFile
{
//MPQHANDLE handle;
bool eof;
unsigned char *buffer;
size_t pointer, size;
// disable copying
MPQFile(const MPQFile &f) {}
void operator=(const MPQFile &f) {}
public:
MPQFile(const char* filename); // filenames are not case sensitive
~MPQFile();
size_t read(void* dest, size_t bytes);
size_t getSize();
size_t getPos();
unsigned char* getBuffer();
unsigned char* getPointer();
bool isEof();
void seek(int offset);
void seekRelative(int offset);
void close();
static bool exists(const char* filename);
};
inline void flipcc(char *fcc)
{
char t;
t=fcc[0];
fcc[0]=fcc[3];
fcc[3]=t;
t=fcc[1];
fcc[1]=fcc[2];
fcc[2]=t;
}
inline bool defaultFilterFunc(std::string) { return true; }
void getFileLists(std::set<std::string> &dest, bool filterfunc(std::string) = defaultFilterFunc);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -