Files
tp/include/JSystem/JGadget/binary.h
T
Erin Moon c70d485d35 normalize header guards to {tu_name}_H_ (#87)
i previously had a bad habit of using double underscores in include
guard macro names, which are implementation-reserved per
the C++98 standard (see 17.4.3.1.2 Global names).

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-18 14:02:51 -05:00

38 lines
876 B
C++

#ifndef JSYSTEM_JGADGET_BINARY_H_
#define JSYSTEM_JGADGET_BINARY_H_
#include "dolphin/types.h"
namespace JGadget {
namespace binary {
inline u32 align_roundUp(u32 arg0, u32 uAlign) {
return (arg0 + uAlign - 1) & ~(uAlign - 1);
}
struct TParseData {
TParseData(const void* pContent) : raw(pContent) {}
const void* getRaw() const { return raw; }
const void* raw;
};
template <int T>
struct TParseData_aligned : public TParseData {
TParseData_aligned(const void* pContent) : TParseData(pContent) {}
};
// Base for header and/or block parsing
struct TParse_header_block {
virtual ~TParse_header_block();
virtual int parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 arg2) = 0;
virtual int parseBlock_next(const void** ppData_inout, u32* puData_out, u32 arg2) = 0;
};
} // namespace binary
} // namespace JGadget
#endif