| 155 | } |
| 156 | |
| 157 | std::string escape_path_for_report(const std::string& s) { |
| 158 | std::string out; |
| 159 | out.reserve(s.size()); |
| 160 | constexpr char hex[] = "0123456789abcdef"; |
| 161 | for (unsigned char c : s) { |
| 162 | if (c >= 0x20 && c < 0x7f) { |
| 163 | out.push_back(static_cast<char>(c)); |
| 164 | } else { |
| 165 | out += "\\x"; |
| 166 | out.push_back(hex[c >> 4]); |
| 167 | out.push_back(hex[c & 0xf]); |
| 168 | } |
| 169 | } |
| 170 | return out; |
| 171 | } |
| 172 | |
| 173 | bool pagecache_path_is_pseudo_fs(std::string_view fs) { |
| 174 | static constexpr std::string_view kPseudo[] = { |
no test coverage detected