36 std::ostream &
print(std::ostream &out)
const {
37 out <<
"[Location: file=" <<
filename <<
", line=" <<
line <<
"]";
44 return obj.
print(out);
47#define UT_LOCATION_HERE (ut::Location{__FILE__, __LINE__})
58 const char *pos = strchr(fmt,
'%');
59 if (pos !=
nullptr && pos[1] ==
'%') {
81template <
typename Head,
typename... Tail>
95 const std::string skipable(
"-+ #0123456789.*");
98 while (*pos !=
'\0' && skipable.find_first_of(*pos) != std::string::npos) {
108 is_ok = std::is_same<H, long long int>::value;
109 }
else if (pos[2] ==
'u' || pos[2] ==
'x') {
110 is_ok = std::is_same<H, unsigned long long int>::value;
114 }
else if (pos[1] ==
'd') {
115 is_ok = std::is_same<H, long int>::value;
116 }
else if (pos[1] ==
'u') {
117 is_ok = std::is_same<H, unsigned long int>::value;
118 }
else if (pos[1] ==
'x') {
119 is_ok = std::is_same<H, unsigned long int>::value;
120 }
else if (pos[1] ==
'f') {
121 is_ok = std::is_same<H, double>::value;
125 }
else if (pos[0] ==
'd') {
126 is_ok = std::is_same<H, int>::value;
127 }
else if (pos[0] ==
'u') {
128 is_ok = std::is_same<H, unsigned int>::value;
129 }
else if (pos[0] ==
'x') {
130 is_ok = std::is_same<H, unsigned int>::value;
131 }
else if (pos[0] ==
'X') {
132 is_ok = std::is_same<H, unsigned int>::value;
133 }
else if (pos[0] ==
'i') {
134 is_ok = std::is_same<H, int>::value;
135 }
else if (pos[0] ==
'f') {
136 is_ok = std::is_same<H, float>::value;
137 }
else if (pos[0] ==
'c') {
138 is_ok = std::is_same<H, char>::value;
139 }
else if (pos[0] ==
'p') {
140 is_ok = std::is_pointer<H>::value;
141 }
else if (pos[0] ==
's') {
142 is_ok = (std::is_same<H, char *>::value ||
143 std::is_same<H, char const *>::value ||
144 (std::is_array<H>::value &&
145 std::is_same<
typename std::remove_cv<
148 }
else if (pos[0] ==
'z') {
150 is_ok = std::is_same<H, size_t>::value;
151 }
else if (pos[1] ==
'x') {
152 is_ok = std::is_same<H, size_t>::value;
153 }
else if (pos[1] ==
'd') {
154 is_ok = std::is_same<H, ssize_t>::value;
181 std::ios_base::fmtflags ff = lhs.flags();
182 lhs << std::showbase << std::hex << rhs.
m_val;
constexpr pos_type Head
Definition: http_request.h:258
static bool verify_fmt_match(const char *fmt)
Verifies that the fmt format string does not require any arguments.
Definition: ut0core.h:69
static const char * get_first_format(const char *fmt)
Finds the first format specifier in fmt format string.
Definition: ut0core.h:57
std::ostream & operator<<(std::ostream &lhs, const hex &rhs)
This is an overload of the global operator<< for the user defined type ib::hex.
Definition: ut0core.h:180
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
required string type
Definition: replication_group_member_actions.proto:34
This is a wrapper class, used to print any unsigned integer type in hexadecimal format.
Definition: ut0core.h:169
const uintmax_t m_val
Definition: ut0core.h:171
hex(uintmax_t t)
Definition: ut0core.h:170
const char * filename
Definition: ut0core.h:34
size_t line
Definition: ut0core.h:35
std::ostream & print(std::ostream &out) const
Definition: ut0core.h:36
std::ostream & operator<<(std::ostream &out, const ut::Location &obj)
Definition: ut0core.h:43
Debug utilities for Innobase.