kea-custom-hooks
FeM custom hooks libraries for Kea DHCP
bytea_utils.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstddef>
9#include <cstdint>
10#include <string>
11#include <string_view>
12
13#include <vector>
14
15namespace util
16{
17using byte_string = std::basic_string<std::byte>;
18using byte_string_view = std::basic_string_view<std::byte>;
19
25byte_string to_bytestr(const std::vector<uint8_t>& bytea);
26
30std::vector<uint8_t> to_bytea(byte_string_view bytestr);
31} // namespace util
std::basic_string< std::byte > byte_string
Definition: bytea_utils.hpp:17
std::vector< uint8_t > to_bytea(byte_string_view str)
Convert a byte string to a byte array.
Definition: bytea_utils.cpp:18
std::basic_string_view< std::byte > byte_string_view
Definition: bytea_utils.hpp:18
byte_string to_bytestr(const std::vector< uint8_t > &bytea)
Convert a byte array to a byte string.
Definition: bytea_utils.cpp:7