CSndHandler.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef CSNDHANDLER_H
  2. #define CSNDHANDLER_H
  3. #include <vector>
  4. #include <fstream>
  5. struct MemberFile
  6. {
  7. std::ifstream * ifs;
  8. int length;
  9. };
  10. class CSndHandler
  11. {
  12. protected:
  13. const int CHUNK;
  14. struct Entry
  15. {
  16. std::string name;
  17. int size, offset;
  18. };
  19. std::ifstream file;
  20. int readNormalNr (int pos, int bytCon);
  21. bool opened;
  22. public:
  23. std::vector<Entry> entries;
  24. ~CSndHandler();
  25. CSndHandler(std::string fname);
  26. void extract(std::string srcfile, std::string dstfile, bool caseSens=true); //saves selected file
  27. unsigned char * extract (std::string srcfile, int & size); //return selecte file
  28. void extract(int index, std::string dstfile); //saves selected file
  29. MemberFile getFile(std::string name);//nie testowane - sprawdzic
  30. unsigned char * extract (int index, int & size); //return selecte file - NIE TESTOWANE
  31. };
  32. class CVidHandler
  33. {
  34. protected:
  35. const int CHUNK;
  36. struct Entry
  37. {
  38. std::string name;
  39. int size, offset, something;
  40. };
  41. std::ifstream file;
  42. int readNormalNr (int pos, int bytCon);
  43. bool opened;
  44. public:
  45. std::vector<Entry> entries;
  46. ~CVidHandler();
  47. CVidHandler(std::string fname);
  48. std::ifstream & extract(std::string srcfile);
  49. void extract(std::string srcfile, std::string dstfile, bool caseSens=true); //saves selected file
  50. unsigned char * extract (std::string srcfile, int & size); //return selecte file,
  51. void extract(int index, std::string dstfile); //saves selected file
  52. MemberFile getFile(std::string name); //nie testowane - sprawdzic
  53. };
  54. #endif //CSNDHANDLER_H