25#include "../abi/string.hpp"
26#include "../abi/vector.hpp"
27#include "../compat.hpp"
28#include "../range.hpp"
29#include "common_types.hpp"
36namespace essence::io {
58 [[nodiscard]] ES_API(CPPESSENCE) abi::vector<std::
byte>
as_bytes(
59 std::span<const std::
byte> buffer, std::int32_t level) const;
67 [[nodiscard]] ES_API(CPPESSENCE) abi::
string
68 as_string(std::span<const std::
byte> buffer, std::int32_t level) const;
76 std::span<const std::
byte> buffer) const;
83 [[nodiscard]] ES_API(CPPESSENCE) abi::
string inverse_as_string(std::span<const std::
byte> buffer) const;
92 abi::vector<std::
byte>
as_bytes(Range&& range, std::int32_t level)
const {
93 return as_bytes(as_const_byte_span(range), level);
102 template <
byte_like_contiguous_range Range>
103 abi::string
as_string(Range&& range, std::int32_t level)
const {
104 return as_string(as_const_byte_span(range), level);
112 template <
byte_like_contiguous_range Range>
122 template <
byte_like_contiguous_range Range>
130 std::unique_ptr<impl> impl_;
A general compresser.
Definition compresser.hpp:40
ES_API(CPPESSENCE) abi ES_API(CPPESSENCE) abi ES_API(CPPESSENCE) abi ES_API(CPPESSENCE) abi abi::vector< std::byte > as_bytes(Range &&range, std::int32_t level) const
Compresses a byte buffer.
Definition compresser.hpp:92
abi::string as_string(Range &&range, std::int32_t level) const
Compresses a byte buffer as a string.
Definition compresser.hpp:103
ES_API(CPPESSENCE) explicit compresser(compression_mode mode)
Creates an instance.
abi::string inverse_as_string(Range &&range) const
Decompresses a byte buffer as a string.
Definition compresser.hpp:123
abi::vector< std::byte > inverse_as_bytes(Range &&range) const
Decompress a byte buffer.
Definition compresser.hpp:113