HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gzip.hpp
1// Copyright Take Vos 2020.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../URL.hpp"
8#include "../byte_string.hpp"
9#include "../resource_view.hpp"
10#include <cstddef>
11
12namespace hi::inline v1 {
13
14bstring gzip_decompress(std::span<std::byte const> bytes, std::size_t max_size = 0x01000000);
15
16inline bstring gzip_decompress(URL const &url, std::size_t max_size = 0x01000000)
17{
18 return gzip_decompress(as_span<std::byte const>(*url.loadView()), max_size);
19}
20
21} // namespace hi::inline v1