39 std::string
str()
const;
42 std::ostream &
print(std::ostream &out)
const {
43 out <<
"[Location: file=" <<
filename <<
", line=" <<
line <<
"]";
50 auto pos =
path.find_last_of(
'/');
51 return path.substr(pos);
56 sout <<
"{type: Location, basename: " <<
basename() <<
", line: " <<
line
70 return obj.
print(out);
73#define UT_LOCATION_HERE (ut::Location{__FILE__, __LINE__})
84 const char *pos = strchr(fmt,
'%');
85 if (pos !=
nullptr && pos[1] ==
'%') {
107template <
typename Head,
typename... Tail>
113 if (pos ==
nullptr) {
121 const std::string skipable(
"-+ #0123456789.*");
124 while (*pos !=
'\0' && skipable.find_first_of(*pos) != std::string::npos) {
134 is_ok = std::is_same<H, long long int>::value;
135 }
else if (pos[2] ==
'u' || pos[2] ==
'x') {
136 is_ok = std::is_same<H, unsigned long long int>::value;
140 }
else if (pos[1] ==
'd') {
141 is_ok = std::is_same<H, long int>::value;
142 }
else if (pos[1] ==
'u') {
143 is_ok = std::is_same<H, unsigned long int>::value;
144 }
else if (pos[1] ==
'x') {
145 is_ok = std::is_same<H, unsigned long int>::value;
146 }
else if (pos[1] ==
'f') {
147 is_ok = std::is_same<H, double>::value;
151 }
else if (pos[0] ==
'd') {
152 is_ok = std::is_same<H, int>::value;
153 }
else if (pos[0] ==
'u') {
154 is_ok = std::is_same<H, unsigned int>::value;
155 }
else if (pos[0] ==
'x') {
156 is_ok = std::is_same<H, unsigned int>::value;
157 }
else if (pos[0] ==
'X') {
158 is_ok = std::is_same<H, unsigned int>::value;
159 }
else if (pos[0] ==
'i') {
160 is_ok = std::is_same<H, int>::value;
161 }
else if (pos[0] ==
'f') {
162 is_ok = std::is_same<H, float>::value;
163 }
else if (pos[0] ==
'c') {
164 is_ok = std::is_same<H, char>::value;
165 }
else if (pos[0] ==
'p') {
166 is_ok = std::is_pointer<H>::value;
167 }
else if (pos[0] ==
's') {
168 is_ok = (std::is_same<H, char *>::value ||
169 std::is_same<H, char const *>::value ||
170 (std::is_array<H>::value &&
171 std::is_same<
typename std::remove_cv<
174 }
else if (pos[0] ==
'z') {
176 is_ok = std::is_same<H, size_t>::value;
177 }
else if (pos[1] ==
'x') {
178 is_ok = std::is_same<H, size_t>::value;
179 }
else if (pos[1] ==
'd') {
180 is_ok = std::is_same<H, ssize_t>::value;
207 std::ios_base::fmtflags ff = lhs.flags();
208 lhs << std::showbase << std::hex << rhs.
m_val;
static char * path
Definition: mysqldump.cc:149
constexpr pos_type Head
Definition: method.h:45
Definition: ha_prototypes.h:342
static bool verify_fmt_match(const char *fmt)
Verifies that the fmt format string does not require any arguments.
Definition: ut0core.h:95
static const char * get_first_format(const char *fmt)
Finds the first format specifier in fmt format string.
Definition: ut0core.h:83
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:206
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2870
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:195
const uintmax_t m_val
Definition: ut0core.h:197
hex(uintmax_t t)
Definition: ut0core.h:196
const char * filename
Definition: ut0core.h:37
size_t line
Definition: ut0core.h:38
std::ostream & print(std::ostream &out) const
Definition: ut0core.h:42
std::string str() const
Definition: ut0core.h:61
std::string to_json() const
Definition: ut0core.h:54
std::string basename() const
Definition: ut0core.h:48
std::ostream & operator<<(std::ostream &out, const ut::Location &obj)
Definition: ut0core.h:69
Debug utilities for Innobase.