12#ifndef OPENVPN_BUFFER_BUFHEX_H
13#define OPENVPN_BUFFER_BUFHEX_H
24inline std::string
render(
const T obj)
26 const ConstBuffer buf((
const unsigned char *)&obj,
sizeof(obj),
true);
31inline T
parse(
const std::string &hex,
const std::string &title)
34 Buffer buf((
unsigned char *)&obj,
sizeof(obj),
false);
43 if (buf.
size() !=
sizeof(obj))
report various types of exceptions or errors that may occur when working with buffers
const char * what() const noexcept override
size_t size() const
Returns the size of the buffer in T objects.
#define OPENVPN_EXCEPTION(C)
#define OPENVPN_THROW(exc, stuff)
std::string render(const T obj)
T parse(const std::string &hex, const std::string &title)
std::string render_hex_generic(const V &data, const bool caps=false)
void parse_hex(V &dest, const std::string &str)