| 372 | } |
| 373 | |
| 374 | bool CaseCache::remove(LPCWSTR path, LPCWSTR file) |
| 375 | { |
| 376 | if (get_file_stream(file, NULL, NULL)) |
| 377 | return true; |
| 378 | |
| 379 | wstring ucdir; |
| 380 | wstring ucfile; |
| 381 | |
| 382 | if (!touppercase(path, ucdir)) |
| 383 | return false; |
| 384 | |
| 385 | if (!touppercase(file, ucfile)) |
| 386 | return false; |
| 387 | |
| 388 | bool bRet = true; |
| 389 | |
| 390 | lock(); |
| 391 | |
| 392 | try { |
| 393 | |
| 394 | auto it = m_map.find(ucdir); |
| 395 | |
| 396 | if (it == m_map.end()) { |
| 397 | bRet = false; |
| 398 | } else { |
| 399 | CaseCacheNode *node = it->second; |
| 400 | |
| 401 | auto nit = node->m_files.find(ucfile); |
| 402 | |
| 403 | if (nit == node->m_files.end()) { |
| 404 | bRet = false; |
| 405 | } else { |
| 406 | node->m_files.erase(nit); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | } catch (...) { |
| 411 | bRet = false; |
| 412 | } |
| 413 | |
| 414 | unlock(); |
| 415 | |
| 416 | return bRet; |
| 417 | } |
| 418 | |
| 419 | bool CaseCache::remove(LPCWSTR path) |
| 420 | { |
no test coverage detected