| 245 | } |
| 246 | |
| 247 | QueryFile *MessageHandler::findFile(const std::string &path, int *out_file_id) { |
| 248 | QueryFile *ret = nullptr; |
| 249 | auto it = db->name2file_id.find(lowerPathIfInsensitive(path)); |
| 250 | if (it != db->name2file_id.end()) { |
| 251 | QueryFile &file = db->files[it->second]; |
| 252 | if (file.def) { |
| 253 | ret = &file; |
| 254 | if (out_file_id) |
| 255 | *out_file_id = it->second; |
| 256 | return ret; |
| 257 | } |
| 258 | } |
| 259 | if (out_file_id) |
| 260 | *out_file_id = -1; |
| 261 | return ret; |
| 262 | } |
| 263 | |
| 264 | std::pair<QueryFile *, WorkingFile *> MessageHandler::findOrFail(const std::string &path, ReplyOnce &reply, |
| 265 | int *out_file_id, bool allow_unopened) { |
nothing calls this directly
no test coverage detected