1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-14 06:32:45 +01:00
openrw/rwengine/include/BinaryStream.hpp

44 lines
649 B
C++
Raw Normal View History

#pragma once
#ifndef _BINARYSTREAM_HPP_
#define _BINARYSTREAM_HPP_
#include <string>
#include <memory>
namespace RW
{
class BinaryStream
{
private:
struct nativeSectionHeader_t
{
uint32_t ID;
uint32_t size;
uint32_t version;
};
public:
enum {
STRUCT = 0x0001,
EXTENSION = 0x0003,
TEXTURE_NATIVE = 0x0015,
TEXTURE_DICTIONARY = 0x0016,
};
struct sectionHeader_t {
uint32_t ID;
uint32_t size;
uint32_t version;
uint8_t *data = nullptr;
sectionHeader_t *next = nullptr;
} *rootHeader;
static std::unique_ptr<BinaryStream> parse(std::string filename);
static std::string sectionIdString(uint32_t id);
};
}
#endif