summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCompress/BrotliDictionary.h
blob: d987dfccb7c5cd800f8a7110109fc0f52bf82636 (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
/*
 * Copyright (c) 2022, Michiel Visser <opensource@webmichiel.nl>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/ByteBuffer.h>

namespace Compress {

class BrotliDictionary {
public:
    enum TransformationOperation {
        Identity,
        FermentFirst,
        FermentAll,
        OmitFirst,
        OmitLast,
    };
    struct Transformation {
        StringView prefix;
        TransformationOperation operation;
        u8 operation_data;
        StringView suffix;
    };

    static ErrorOr<ByteBuffer> lookup_word(size_t index, size_t length);
};

}