Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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