예제 #1
0
vector<DirEntry>::iterator DirEntryList::_find(const Key &key) {
    auto found = _findLowerBound(key);
    if (found == _entries.end() || found->key != key) {
        throw fspp::fuse::FuseErrnoException(ENOENT);
    }
    return found;
}
예제 #2
0
void DirEntryList::remove(const Key &key) {
    auto lowerBound = _findLowerBound(key);
    auto upperBound = std::find_if(lowerBound, _entries.end(), [&key] (const DirEntry &entry) {
        return entry.key() != key;
    });
    _entries.erase(lowerBound, upperBound);
}