38 std::string
str()
const;
41 std::ostream &
print(std::ostream &out)
const {
42 out <<
"[Location: file=" <<
filename <<
", line=" <<
line <<
"]";
49 auto pos =
path.find_last_of(
'/');
50 return path.substr(pos);
55 sout <<
"{type: Location, basename: " <<
basename() <<
", line: " <<
line
69 return obj.
print(out);
72#define UT_LOCATION_HERE (ut::Location{__FILE__, __LINE__})
83 const char *pos = strchr(fmt,
'%');
84 if (pos !=
nullptr && pos[1] ==
'%') {
106template <
typename Head,
typename... Tail>
112 if (pos ==
nullptr) {
120 const std::string skipable(
"-+ #0123456789.*");
123 while (*pos !=
'\0' && skipable.find_first_of(*pos) != std::string::npos) {
133 is_ok = std::is_same<H, long long int>::value;
134 }
else if (pos[2] ==
'u' || pos[2] ==
'x') {
135 is_ok = std::is_same<H, unsigned long long int>::value;
139 }
else if (pos[1] ==
'd') {
140 is_ok = std::is_same<H, long int>::value;
141 }
else if (pos[1] ==
'u') {
142 is_ok = std::is_same<H, unsigned long int>::value;
143 }
else if (pos[1] ==
'x') {
144 is_ok = std::is_same<H, unsigned long int>::value;
145 }
else if (pos[1] ==
'f') {
146 is_ok = std::is_same<H, double>::value;
150 }
else if (pos[0] ==
'd') {
151 is_ok = std::is_same<H, int>::value;
152 }
else if (pos[0] ==
'u') {
153 is_ok = std::is_same<H, unsigned int>::value;
154 }
else if (pos[0] ==
'x') {
155 is_ok = std::is_same<H, unsigned int>::value;
156 }
else if (pos[0] ==
'X') {
157 is_ok = std::is_same<H, unsigned int>::value;
158 }
else if (pos[0] ==
'i') {
159 is_ok = std::is_same<H, int>::value;
160 }
else if (pos[0] ==
'f') {
161 is_ok = std::is_same<H, float>::value;
162 }
else if (pos[0] ==
'c') {
163 is_ok = std::is_same<H, char>::value;
164 }
else if (pos[0] ==
'p') {
165 is_ok = std::is_pointer<H>::value;
166 }
else if (pos[0] ==
's') {
167 is_ok = (std::is_same<H, char *>::value ||
168 std::is_same<H, char const *>::value ||
169 (std::is_array<H>::value &&
170 std::is_same<
typename std::remove_cv<
173 }
else if (pos[0] ==
'z') {
175 is_ok = std::is_same<H, size_t>::value;
176 }
else if (pos[1] ==
'x') {
177 is_ok = std::is_same<H, size_t>::value;
178 }
else if (pos[1] ==
'd') {
179 is_ok = std::is_same<H, ssize_t>::value;
206 std::ios_base::fmtflags ff = lhs.flags();
207 lhs << std::showbase << std::hex << rhs.
m_val;
static char * path
Definition: mysqldump.cc:148
constexpr pos_type Head
Definition: http_request.h:257
Definition: ha_prototypes.h:341
static bool verify_fmt_match(const char *fmt)
Verifies that the fmt format string does not require any arguments.
Definition: ut0core.h:94
static const char * get_first_format(const char *fmt)
Finds the first format specifier in fmt format string.
Definition: ut0core.h:82
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:205
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:47
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2869
required string type
Definition: replication_group_member_actions.proto:33
This is a wrapper class, used to print any unsigned integer type in hexadecimal format.
Definition: ut0core.h:194
const uintmax_t m_val
Definition: ut0core.h:196
hex(uintmax_t t)
Definition: ut0core.h:195
const char * filename
Definition: ut0core.h:36
size_t line
Definition: ut0core.h:37
std::ostream & print(std::ostream &out) const
Definition: ut0core.h:41
std::string str() const
Definition: ut0core.h:60
std::string to_json() const
Definition: ut0core.h:53
std::string basename() const
Definition: ut0core.h:47
std::ostream & operator<<(std::ostream &out, const ut::Location &obj)
Definition: ut0core.h:68
Debug utilities for Innobase.