MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / removeByPath

Method removeByPath

src/RecentBooksStore.cpp:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60bool RecentBooksStore::removeByPath(const std::string& path) {
61 auto it =
62 std::find_if(recentBooks.begin(), recentBooks.end(), [&](const RecentBook& book) { return book.path == path; });
63 if (it == recentBooks.end()) {
64 return false;
65 }
66 recentBooks.erase(it);
67 if (!saveToFile()) {
68 LOG_ERR("RBS", "Failed to persist removal of recent book: %s", path.c_str());
69 }
70 return true;
71}
72
73void RecentBooksStore::updatePath(const std::string& oldPath, const std::string& newPath,
74 const std::string& oldCachePath, const std::string& newCachePath) {

Callers 2

loopMethod · 0.80
promptRemoveBookMethod · 0.80

Calls 2

endMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected