MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / remove

Method remove

libcppcryptfs/filename/casecache.cpp:374–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374bool 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
419bool CaseCache::remove(LPCWSTR path)
420{

Callers 3

CryptMoveFileInternalFunction · 0.45
delete_directoryFunction · 0.45

Calls 5

get_file_streamFunction · 0.85
touppercaseFunction · 0.85
findMethod · 0.80
eraseMethod · 0.80

Tested by

no test coverage detected