-
Notifications
You must be signed in to change notification settings - Fork 0
/
blorb.h
45 lines (35 loc) · 796 Bytes
/
blorb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// vim: set ft=cpp:
#ifndef ZTERP_BLORB_H
#define ZTERP_BLORB_H
#include <exception>
#include <map>
#include <memory>
#include <utility>
#include "iff.h"
#include "io.h"
#include "types.h"
class Blorb {
public:
class InvalidFile : std::exception {
};
enum class Usage {
Pict,
Snd,
Exec,
Data,
};
struct Chunk {
Chunk(IFF::TypeID type_, uint32_t offset_, uint32_t size_) :
type(type_), offset(offset_), size(size_)
{
}
const IFF::TypeID type;
const uint32_t offset;
const uint32_t size;
};
explicit Blorb(const std::shared_ptr<IO> &io);
const Chunk *find(Usage usage, uint32_t number);
private:
std::map<std::pair<Usage, uint32_t>, Chunk> m_chunks;
};
#endif