2007-07-07 19:04:15 +03:00
|
|
|
#ifndef CSNDHANDLER_H
|
|
|
|
#define CSNDHANDLER_H
|
|
|
|
|
2007-07-07 07:30:36 +03:00
|
|
|
#include <vector>
|
|
|
|
#include <fstream>
|
2008-03-20 10:51:53 +02:00
|
|
|
#include <map>
|
2007-07-31 08:24:10 +03:00
|
|
|
struct MemberFile
|
|
|
|
{
|
|
|
|
std::ifstream * ifs;
|
|
|
|
int length;
|
|
|
|
};
|
2007-07-07 07:30:36 +03:00
|
|
|
class CSndHandler
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const int CHUNK;
|
|
|
|
struct Entry
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
int size, offset;
|
|
|
|
};
|
|
|
|
std::ifstream file;
|
|
|
|
int readNormalNr (int pos, int bytCon);
|
|
|
|
bool opened;
|
|
|
|
public:
|
|
|
|
std::vector<Entry> entries;
|
2008-03-20 10:51:53 +02:00
|
|
|
std::map<std::string, int> fimap; // map of wav file and index
|
2007-07-07 07:30:36 +03:00
|
|
|
~CSndHandler();
|
|
|
|
CSndHandler(std::string fname);
|
|
|
|
void extract(std::string srcfile, std::string dstfile, bool caseSens=true); //saves selected file
|
2008-03-20 10:51:53 +02:00
|
|
|
unsigned char * extract (std::string srcfile, int & size); //return selecte file data, NULL if file doesn't exist
|
2007-07-07 07:30:36 +03:00
|
|
|
void extract(int index, std::string dstfile); //saves selected file
|
2007-07-31 08:24:10 +03:00
|
|
|
MemberFile getFile(std::string name);//nie testowane - sprawdzic
|
2007-07-07 07:30:36 +03:00
|
|
|
unsigned char * extract (int index, int & size); //return selecte file - NIE TESTOWANE
|
|
|
|
};
|
2007-07-31 08:24:10 +03:00
|
|
|
class CVidHandler
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const int CHUNK;
|
|
|
|
struct Entry
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
int size, offset, something;
|
|
|
|
};
|
|
|
|
std::ifstream file;
|
|
|
|
int readNormalNr (int pos, int bytCon);
|
|
|
|
bool opened;
|
|
|
|
public:
|
|
|
|
std::vector<Entry> entries;
|
|
|
|
~CVidHandler();
|
|
|
|
CVidHandler(std::string fname);
|
2007-08-08 22:28:56 +03:00
|
|
|
std::ifstream & extract(std::string srcfile);
|
2007-07-31 08:24:10 +03:00
|
|
|
void extract(std::string srcfile, std::string dstfile, bool caseSens=true); //saves selected file
|
2007-08-08 22:28:56 +03:00
|
|
|
unsigned char * extract (std::string srcfile, int & size); //return selecte file,
|
2007-07-31 08:24:10 +03:00
|
|
|
void extract(int index, std::string dstfile); //saves selected file
|
|
|
|
MemberFile getFile(std::string name); //nie testowane - sprawdzic
|
|
|
|
};
|
|
|
|
|
2007-07-07 19:04:15 +03:00
|
|
|
|
2008-07-16 21:26:15 +03:00
|
|
|
#endif //CSNDHANDLER_H
|