| 104 | |
| 105 | template <typename T> |
| 106 | const T* reinterpret_data(std::span<const char> data, size_t& offset, size_t count = 1) { |
| 107 | if (offset + (sizeof(T) * count) > data.size()) { |
| 108 | return nullptr; |
| 109 | } |
| 110 | |
| 111 | size_t original_offset = offset; |
| 112 | offset += sizeof(T) * count; |
| 113 | return reinterpret_cast<const T*>(data.data() + original_offset); |
| 114 | } |
| 115 | |
| 116 | bool check_magic(const FileHeader* header) { |
| 117 | static const char good_magic[] = {'N','6','4','R','S','Y','M','S'}; |
nothing calls this directly
no outgoing calls
no test coverage detected