Electroneum
epee::to_hex Struct Reference

#include <hex.h>

Static Public Member Functions

static std::string string (const span< const std::uint8_t > src)
 
static epee::wipeable_string wipeable_string (const span< const std::uint8_t > src)
 
template<typename T >
static epee::wipeable_string wipeable_string (const T &pod)
 
template<std::size_t N>
static std::array< char, N *2 > array (const std::array< std::uint8_t, N > &src) noexcept
 
static void buffer (std::ostream &out, const span< const std::uint8_t > src)
 Append src as hex to out. More...
 
static void formatted (std::ostream &out, const span< const std::uint8_t > src)
 Append < + src + > as hex to out. More...
 

Detailed Description

Definition at line 43 of file hex.h.

Member Function Documentation

◆ array()

template<std::size_t N>
static std::array<char, N * 2> epee::to_hex::array ( const std::array< std::uint8_t, N > &  src)
inlinestaticnoexcept
Returns
An array containing hex of src.

Definition at line 53 of file hex.h.

54  {
55  std::array<char, N * 2> out{{}};
56  static_assert(N <= 128, "keep the stack size down");
57  buffer_unchecked(out.data(), {src.data(), src.size()});
58  return out;
59  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer()

void epee::to_hex::buffer ( std::ostream &  out,
const span< const std::uint8_t src 
)
static

Append src as hex to out.

Definition at line 71 of file hex.cpp.

72  {
73  write_hex(std::ostreambuf_iterator<char>{out}, src);
74  }
Here is the caller graph for this function:

◆ formatted()

void epee::to_hex::formatted ( std::ostream &  out,
const span< const std::uint8_t src 
)
static

Append < + src + > as hex to out.

Definition at line 76 of file hex.cpp.

77  {
78  out.put('<');
79  buffer(out, src);
80  out.put('>');
81  }
static void buffer(std::ostream &out, const span< const std::uint8_t > src)
Append src as hex to out.
Definition: hex.cpp:71
Here is the call graph for this function:
Here is the caller graph for this function:

◆ string()

std::string epee::to_hex::string ( const span< const std::uint8_t src)
static
Returns
A std::string containing hex of src.

Definition at line 68 of file hex.cpp.

68 { return convert<std::string>(src); }
Here is the caller graph for this function:

◆ wipeable_string() [1/2]

epee::wipeable_string epee::to_hex::wipeable_string ( const span< const std::uint8_t src)
static
Returns
A epee::wipeable_string containing hex of src.

Definition at line 69 of file hex.cpp.

69 { return convert<epee::wipeable_string>(src); }
Here is the caller graph for this function:

◆ wipeable_string() [2/2]

template<typename T >
static epee::wipeable_string epee::to_hex::wipeable_string ( const T pod)
inlinestatic

Definition at line 49 of file hex.h.

49 { return wipeable_string(span<const uint8_t>((const uint8_t*)&pod, sizeof(pod))); }
unsigned char uint8_t
Definition: stdint.h:124
static epee::wipeable_string wipeable_string(const span< const std::uint8_t > src)
Definition: hex.cpp:69
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this struct was generated from the following files: