BrotliDictionary.h 592 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, Michiel Visser <opensource@webmichiel.nl>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteBuffer.h>
  8. namespace Compress {
  9. class BrotliDictionary {
  10. public:
  11. enum TransformationOperation {
  12. Identity,
  13. FermentFirst,
  14. FermentAll,
  15. OmitFirst,
  16. OmitLast,
  17. };
  18. struct Transformation {
  19. StringView prefix;
  20. TransformationOperation operation;
  21. u8 operation_data;
  22. StringView suffix;
  23. };
  24. static ErrorOr<ByteBuffer> lookup_word(size_t index, size_t length);
  25. };
  26. }