MCPcopy Create free account
hub / github.com/fmtlib/fmt / normalize_libcxx_inline_namespaces

Function normalize_libcxx_inline_namespaces

include/fmt/std.h:167–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165
166#if FMT_USE_RTTI
167inline auto normalize_libcxx_inline_namespaces(string_view demangled_name_view,
168 char* begin) -> string_view {
169 // Normalization of stdlib inline namespace names.
170 // libc++ inline namespaces.
171 // std::__1::* -> std::*
172 // std::__1::__fs::* -> std::*
173 // libstdc++ inline namespaces.
174 // std::__cxx11::* -> std::*
175 // std::filesystem::__cxx11::* -> std::filesystem::*
176 if (demangled_name_view.starts_with("std::")) {
177 char* to = begin + 5; // std::
178 for (const char *from = to, *end = begin + demangled_name_view.size();
179 from < end;) {
180 // This is safe, because demangled_name is NUL-terminated.
181 if (from[0] == '_' && from[1] == '_') {
182 const char* next = from + 1;
183 while (next < end && *next != ':') next++;
184 if (next[0] == ':' && next[1] == ':') {
185 from = next + 2;
186 continue;
187 }
188 }
189 *to++ = *from++;
190 }
191 demangled_name_view = {begin, detail::to_unsigned(to - begin)};
192 }
193 return demangled_name_view;
194}
195
196template <class OutputIt>
197auto normalize_msvc_abi_name(string_view abi_name_view, OutputIt out)

Callers 1

write_demangled_nameFunction · 0.85

Calls 2

to_unsignedFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected