forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecoder.h
47 lines (36 loc) · 887 Bytes
/
decoder.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
46
47
// Aseprite Document IO Library
// Copyright (c) 2018 Igara Studio S.A.
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DIO_DECODER_H_INCLUDED
#define DIO_DECODER_H_INCLUDED
#pragma once
#include <cstdint>
#include <cstring>
namespace doc {
class Document;
}
namespace dio {
class DecodeDelegate;
class FileInterface;
class Decoder {
public:
Decoder();
virtual ~Decoder();
virtual void initialize(DecodeDelegate* delegate, FileInterface* f);
virtual bool decode() = 0;
protected:
DecodeDelegate* delegate() { return m_delegate; }
FileInterface* f() { return m_f; }
uint8_t read8();
uint16_t read16();
uint32_t read32();
size_t readBytes(uint8_t* buf, size_t n);
private:
DecodeDelegate* m_delegate;
FileInterface* m_f;
};
} // namespace dio
#endif