Exemple #1
0
void DirEntryList::remove(const string &name) {
    auto found = _findByName(name);
    if (found == _entries.end()) {
        throw fspp::fuse::FuseErrnoException(ENOENT);
    }
    _entries.erase(found);
}
Exemple #2
0
boost::optional<const DirEntry&> DirEntryList::get(const string &name) const {
    auto found = _findByName(name);
    if (found == _entries.end()) {
        return boost::none;
    }
    return *found;
}
Exemple #3
0
shared_ptr<HtmlAttribute> HtmlAttributes::get(const String &name) const
{
	iterator i = _findByName(name);
	if(i != m_attributes.end())
		return *i;

	return nullptr;
}
Exemple #4
0
void DirEntryList::rename(const blockstore::Key &key, const std::string &name, std::function<void (const blockstore::Key &key)> onOverwritten) {
    auto foundSameName = _findByName(name);
    if (foundSameName != _entries.end() && foundSameName->key() != key) {
        _checkAllowedOverwrite(foundSameName->type(), _findByKey(key)->type());
        onOverwritten(foundSameName->key());
        _entries.erase(foundSameName);
    }

    _findByKey(key)->setName(name);
}
Exemple #5
0
void DirEntryList::addOrOverwrite(const string &name, const Key &blobKey, fspp::Dir::EntryType entryType, mode_t mode,
                       uid_t uid, gid_t gid, timespec lastAccessTime, timespec lastModificationTime,
                       std::function<void (const blockstore::Key &key)> onOverwritten) {
    auto found = _findByName(name);
    if (found != _entries.end()) {
        onOverwritten(found->key());
        _overwrite(found, name, blobKey, entryType, mode, uid, gid, lastAccessTime, lastModificationTime);
    } else {
        _add(name, blobKey, entryType, mode, uid, gid, lastAccessTime, lastModificationTime);
    }
}
Exemple #6
0
void HtmlAttributes::remove(const String &name)
{
	iterator i = _findByName(name);
	if(i != m_attributes.end())
		m_attributes.erase(i);
}
Exemple #7
0
bool HtmlAttributes::exists(const String &name) const
{
	return _findByName(name) != m_attributes.end();
}
Exemple #8
0
bool DirEntryList::_hasChild(const string &name) const {
    return _entries.end() != _findByName(name);
}