GPBDecoder.h 703 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * GamePlayFile.h
  3. */
  4. #ifndef GPBDECODER_H_
  5. #define GPBDECODER_H_
  6. #include <iostream>
  7. #include <list>
  8. #include <assert.h>
  9. #include "FileIO.h"
  10. namespace gameplay
  11. {
  12. /**
  13. * This class is used for decoding a GPB file for the purpose of debugging.
  14. */
  15. class GPBDecoder
  16. {
  17. public:
  18. /**
  19. * Constructor.
  20. */
  21. GPBDecoder(void);
  22. /**
  23. * Destructor.
  24. */
  25. ~GPBDecoder(void);
  26. void readBinary(const std::string& filepath);
  27. bool validateHeading();
  28. void readRefs();
  29. void readRef();
  30. bool read(unsigned int* ptr);
  31. std::string readString(FILE* fp);
  32. private:
  33. FILE* _file;
  34. FILE* _outFile;
  35. };
  36. }
  37. #endif