16 char* c =
reinterpret_cast<char*
>(&ret);
24 return (a | (b << 8));
30 return (a | (b << 16));
36 return (a | (b << 32));
41 char* a =
reinterpret_cast<char*
>(&val);
44 char* b =
reinterpret_cast<char*
>(&ret);
46 for (
int i = 0; i < 4; i++)
58 #define ISBIGENDIAN() ((*reinterpret_cast<const char *>(&bigendiandetection)) == 0)
62 for (
unsigned int i = 0; i < (n / 2); i++) {
72 char* p =
reinterpret_cast<char*
>(&ret);
79 char* p =
reinterpret_cast<char*
>(&ret);
87 char* p =
reinterpret_cast<char*
>(&ret);
95 char* p =
reinterpret_cast<char*
>(&ret);
113 if (
file.is_open()) {
118 file.open(f, std::ios_base::in | std::ios_base::binary);
119 return (
file ? 0 : 1);
184 for (
int i = 0; i < c; i++) {
virtual void read(char *d, int c)=0
#define assertLessThanEqual(x, y)
virtual void seek(long long pos=0)
Binary file reading utilities.
virtual void read(char *d, int c)
virtual void seek(long long pos=0)
static void swapByteOrder(char *d, unsigned int n)
BinaryMemory(const char *d=nullptr, long long max=-1)
virtual float readFloat()
virtual uint16_t readU16()
#define assertGreaterThanEqual(x, y)
#define assertEqual(x, y)
virtual uint32_t readU32()
#define assertGreaterThan(x, y)
static const int bigendiandetection
virtual uint64_t readU64()
virtual void read(char *d, int c)
int open(const char *d=nullptr, long long max=-1)
int open(std::string f="")
BinaryFile(std::string f="")