| 18224 | } |
| 18225 | |
| 18226 | static const char* DebugItemPathQuery_GetResultAsPath(ImGuiDebugItemPathQuery* query, bool hex_encode_non_ascii_chars) |
| 18227 | { |
| 18228 | ImGuiTextBuffer* buf = &query->ResultPathBuf; |
| 18229 | buf->resize(0); |
| 18230 | for (int stack_n = 0; stack_n < query->Results.Size; stack_n++) |
| 18231 | { |
| 18232 | char level_desc[256]; |
| 18233 | DebugItemPathQuery_FormatLevelInfo(query, stack_n, false, level_desc, IM_COUNTOF(level_desc)); |
| 18234 | buf->append(stack_n == 0 ? "//" : "/"); |
| 18235 | for (const char* p = level_desc; *p != 0; ) |
| 18236 | { |
| 18237 | unsigned int c; |
| 18238 | const char* p_next = p + ImTextCharFromUtf8(&c, p, NULL); |
| 18239 | if (c == '/') |
| 18240 | buf->append("\\"); |
| 18241 | if (c < 256 || !hex_encode_non_ascii_chars) |
| 18242 | buf->append(p, p_next); |
| 18243 | else for (; p < p_next; p++) |
| 18244 | buf->appendf("\\x%02x", (unsigned char)*p); |
| 18245 | p = p_next; |
| 18246 | } |
| 18247 | } |
| 18248 | return buf->c_str(); |
| 18249 | } |
| 18250 | |
| 18251 | // ID Stack Tool: Display UI |
| 18252 | void ImGui::ShowIDStackToolWindow(bool* p_open) |
no test coverage detected