14#ifndef LIBCWD_BUF2STR_H
15#define LIBCWD_BUF2STR_H
21#if __cpp_concepts >= 201907L
58 buf2str(
char const* buf,
size_t size) : buf_(buf), size_(size) { }
60#if __cpp_concepts >= 201907L
63 requires requires(T
const& t) {
64 { t.data() } -> std::convertible_to<char const*>;
65 { t.size() } -> std::convertible_to<size_t>;
67 buf2str(T
const& view) : buf_(view.data()), size_(view.size())
78 size_t size = __buf2str.size_;
79 for (
char const* p1 = __buf2str.buf_; size > 0; --size, ++p1)
Definition of utility class char2str.
friend std::ostream & operator<<(std::ostream &os, buf2str const &__buf2str)
Write the contents of the buffer represented by __buf2str to the ostream os, escaping non-printable c...
Definition buf2str.h:76
buf2str(char const *buf, size_t size)
Construct buf2str object with attributes buf and size.
Definition buf2str.h:58
Print a char to a debug ostream, escaping non-printable characters as needed.
Definition char2str.h:43