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 559B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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();
  13. int open(const char *f);
  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