Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

binary.h 560B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*!
  2. * \file include/utils/binary.h
  3. * \brief Binary file reading utilities
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _UTILS_BINARY_H_
  8. #define _UTILS_BINARY_H_
  9. #include <fstream>
  10. class BinaryFile {
  11. public:
  12. BinaryFile(const char *f);
  13. ~BinaryFile();
  14. long long tell();
  15. void seek(long long pos);
  16. int8_t read8();
  17. uint8_t readU8();
  18. int16_t read16();
  19. uint16_t readU16();
  20. int32_t read32();
  21. uint32_t readU32();
  22. int64_t read64();
  23. uint64_t readU64();
  24. float readFloat();
  25. private:
  26. std::ifstream file;
  27. };
  28. #endif