aboutsummaryrefslogtreecommitdiff
path: root/lib/embed.h
blob: 566b14cfa61154f86bb5bcbd9679dab92149c311 (plain)
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
#pragma once

#include <span>
#include <string>
#include <unordered_map>
#include <frozen/unordered_map.h>
#include <frozen/string.h>

namespace embed {

enum Compression {
    None,
    Zstd
};

struct ResourceData {
    Compression compression = None;
    std::span<const unsigned char> dictionary;
};

class Resources {
public:
    explicit Resources(const ResourceData &info);
    ~Resources();

    [[nodiscard]]
    std::span<unsigned char> decompress(const std::span<const unsigned char> &entry);

private:
    const ResourceData m_info;
}; // class

}