void FileMap::addUnknownChannel(const eString& chanId) { isDirty = initDone; if (!isUnknown(chanId)) unknown.insert(chanId); if (isIgnored(chanId)) removeIgnoredChannel(chanId); if (isMapped(chanId)) removeMappedChannel(chanId); eString s = (isUnknown(chanId) && !isIgnored(chanId) && !isMapped(chanId)) ? "succeeded" : "failed"; std::cout << "Adding unknown " << chanId << ": " << s << std::endl; }
void applyExtraImage(MCONTACT hContact) { int ignore = isIgnored(hContact, IGNOREEVENT_ALL); if (ignore == 1) ExtraIcon_SetIconByName(hExtraIcon, hContact, "ignore_full"); else if (ignore == 0) ExtraIcon_Clear(hExtraIcon, hContact); else if (isIgnored(hContact, IGNOREEVENT_MESSAGE)) ExtraIcon_SetIconByName(hExtraIcon, hContact, "ignore_mess"); else ExtraIcon_SetIconByName(hExtraIcon, hContact, "ignore_part"); }
/** * @brief Adds a single file/directorie to the list of * watches. Path and corresponding watchdescriptor * will be stored in the directorieMap. This is done * because events on watches just return this * watchdescriptor. * * @param path that will be watched * */ void Inotify::watchFile(fs::path filePath) { if (fs::exists(filePath)) { mError = 0; int wd = 0; if (!isIgnored(filePath.string())) { wd = inotify_add_watch(mInotifyFd, filePath.string().c_str(), mEventMask); } if (wd == -1) { mError = errno; std::stringstream errorStream; if (mError == 28) { errorStream << "Failed to watch! " << strerror(mError) << ". Please increase number of watches in " "\"/proc/sys/fs/inotify/max_user_watches\"."; throw std::runtime_error(errorStream.str()); } errorStream << "Failed to watch! " << strerror(mError) << ". Path: " << filePath.string(); throw std::runtime_error(errorStream.str()); } mDirectorieMap.left.insert({wd, filePath}); } else { throw std::invalid_argument( "Can´t watch Path! Path does not exist. Path: " + filePath.string()); } }
void PlayersListModel::checkFriendIgnore(const QModelIndex &mi) { setData(mi, isFriend(mi.data().toString()), Friend); setData(mi, isIgnored(mi.data().toString()), Ignore); updateIcon(mi); updateSortData(mi); }
void Snapshot::dump() const { ALOGD("Snapshot %p, flags %x, prev %p, height %d, ignored %d, hasComplexClip %d", this, flags, previous.get(), getViewportHeight(), isIgnored(), clipRegion && !clipRegion->isEmpty()); ALOGD(" ClipRect (at %p) %.1f %.1f %.1f %.1f", clipRect, clipRect->left, clipRect->top, clipRect->right, clipRect->bottom); ALOGD(" Transform (at %p):", transform); transform->dump(); }
void FileMap::addMappedChannel(const eString& chanId, const eString& ref) { isDirty = initDone; std::cout << "Adding map " << chanId << ", " << ref << std::endl; if (isMapped(chanId)) removeMappedChannel(chanId); if (isIgnored(chanId)) removeIgnoredChannel(chanId); if (isUnknown(chanId)) removeUnknownChannel(chanId); mapped.insert(chanId); map[chanId] = ref; }
void Snapshot::dump() const { ALOGD("Snapshot %p, flags %x, prev %p, height %d, ignored %d, hasComplexClip %d", this, flags, previous, getViewportHeight(), isIgnored(), !mClipArea->isSimple()); const Rect& clipRect(mClipArea->getClipRect()); ALOGD(" ClipRect %.1f %.1f %.1f %.1f, clip simple %d", clipRect.left, clipRect.top, clipRect.right, clipRect.bottom, mClipArea->isSimple()); ALOGD(" Transform (at %p):", transform); transform->dump(); }
void CompositionObj::addChild(Component c, std::string name) { if (isIgnored()) return; children[name] = c; // Creating default forwards, this can be overridden by addEventForwards addEventForwards(name, "failed", "failed"); addEventForwards(name, "success", "failed"); addEventForwards(name, "aborted", "failed"); addEventForwards(name, "internal_error", "failed"); addEventForwards(name, "fatal_error", "failed"); }
void CompositionObj::replaceChild(Component c, std::string name) { if (isIgnored()) return; if (children.find(name) == children.end()) { std::cout << "Availilble children: " << std::endl; for (auto c : children) { std::cout << "\t-" << c.first << std::endl; } throw std::runtime_error("Cannot replace child, the requested child does not exist so far: " + name); } children[name] = c; }
bool BTShapeManager::buildShapeStream(Ogre::String streamName, File const &rootFile, BTShapeStream *&streamPtr) { BTShapeStreamMap::iterator it; // already built ? if(nullptr != (streamPtr = getBTShapeStream(streamName))) return true; BTShapeStream stream; stream.mName = streamName; // walk the file hierarchy depth first, using the fringe as buffer. std::list<BTFileNode> fringe; fringe.push_front(BTFileNode(true)); fringe.push_front(BTFileNode(rootFile)); unsigned int currentIndex = 0; std::stack<unsigned int> stack; while(fringe.size()) { BTFileNode file = fringe.front(); fringe.pop_front(); if(isIgnored(file)) continue; if(file.isGuard()) { // popped back to root ? if(stack.size() == 0) break; stream.mData[stack.top()].end = currentIndex; stack.pop(); continue; } // push the token to the stream stream.mData.push_back( {file.shapeTokenType(), currentIndex, 0, file.descriptor().fullPath()}); // add childNodes to fringe for them to be processed next. std::vector<BTFileNode> childNodes = file.childNodes(); fringe.insert(fringe.begin(), childNodes.begin(), childNodes.end()); stack.push(currentIndex); ++currentIndex; } mStreamMap[streamName] = stream; streamPtr = &(mStreamMap[streamName]); return true; }
INT_PTR isIgnored(MCONTACT hContact, int type) { int all = 0, filtered = 0; if (type != IGNOREEVENT_ALL) return CallService(MS_IGNORE_ISIGNORED, hContact, (LPARAM)type); for (int i = 1; i < nII; i++) if (isIgnored(hContact, ii[i].type)) ii[i].filtered ? filtered++ : all++; return (all + filtered == _countof(ii) - 1) ? 1 : (all > 0 ? -1 : 0); }
bool PlayersListModel::isFlagSet(const QString & nickname, StateFlag flagType) { QModelIndex mi = nicknameIndex(nickname); if(mi.isValid()) return mi.data(flagType).toBool(); else if(flagType == Friend) return isFriend(nickname); else if(flagType == Ignore) return isIgnored(nickname); else return false; }
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) { if (!getLangOpts().CPlusPlus || !getLangOpts().CXXExceptions) return; Finder->addMatcher( functionDecl(anyOf(isNoThrow(), cxxDestructorDecl(), cxxConstructorDecl(isMoveConstructor()), cxxMethodDecl(isMoveAssignmentOperator()), hasName("main"), hasName("swap"), isEnabled(FunctionsThatShouldNotThrow)), throws(unless(isIgnored(IgnoredExceptions)))) .bind("thrower"), this); }
void Inotify::filterEvents( std::vector<inotify::FileSystemEvent>& events, std::queue<FileSystemEvent>& eventQueue) { for (auto eventIt = events.begin(); eventIt < events.end();) { FileSystemEvent currentEvent = *eventIt; if (isOnTimeout(currentEvent.eventTime)) { eventIt = events.erase(eventIt); mOnEventTimeout(currentEvent); } else if (isIgnored(currentEvent.path.string())) { eventIt = events.erase(eventIt); } else { mLastEventTime = currentEvent.eventTime; eventQueue.push(currentEvent); eventIt++; } } }
bool Updater::checkLocalFile(vfs::Path installPath, const ReleaseFile& releaseFile) { vfs::Path localFile = vfs::Directory(installPath).getFilePath(releaseFile.file); //Logger::warning( " Checking for file " + releaseFile.file.toString() + ": "); // check ignore list if( isIgnored( releaseFile.file.canonical().toString() ) ) { Logger::warning("IGNORED"); return true; // ignore this file } if (!localFile.exist()) { Logger::warning("MISSING"); return false; } // File exists // Compare file size std::size_t fileSize = vfs::NFile::size(localFile); if (fileSize != releaseFile.filesize) { Logger::warning("SIZE MISMATCH"); return false; } // Size is matching // Check CRC if not disabled if (!_options.isSet("no-crc")) { unsigned int existingCrc = CRC::GetCrcForFile(localFile); if (existingCrc != releaseFile.crc) { Logger::warning("CRC MISMATCH"); return false; } } Logger::warning("EQUALE"); return true; }
int GvField::io(AStream &a, const GvName &name) { char c; if (a.IsInput()) { setDefault(FALSE); c = a.Skip(); if (c == IGNORE_CHAR) { c = a.getc(); setDefault(TRUE); setIgnored(TRUE); } else { setIgnored(FALSE); if (!ioValue(a)) { a.Error("Couldn't read value for field \"%s\"", name.getString()); return FALSE; } c = a.Skip(); if (c == IGNORE_CHAR) { c = a.getc(); setIgnored(TRUE); } } } else { // write if (isDefault()) { a.putc(IGNORE_CHAR); } else { ioValue(a); if (isIgnored()) a.putc(IGNORE_CHAR); } } return TRUE; }
void eatIgnored() { bool stop(false); while (!stop){ while (isIgnored(pickChar())) eatChar(); if (_ignore_flag == ignoreFlag::None) return; stop = true; if (_ignore_flag == ignoreFlag::CppC) { if (pickString(sizeof("//") - 1) == "//") { eatString(sizeof("//") - 1); while (stream_cursor != stream_buffer.end() || pickChar() != '\n') eatChar(); stop = false; } if (pickString(sizeof("/*") - 1) == "/*") {eatString(sizeof("/*") - 1); while (pickString(sizeof("*/")-1) != "*/") eatChar(); eatString(sizeof("/*") - 1); stop = false; } } } }
void FileMap::removeIgnoredChannel(const eString& chanId) { ignored.erase(chanId); eString s = isIgnored(chanId) ? "failed" : "succeeded"; std::cout << "Removing ignore " << chanId << ": " << s << std::endl; }
bool Solid::StorageAccess::isIgnored() const { Q_D(const StorageAccess); return_SOLID_CALL(Ifaces::StorageAccess *, d->backendObject(), true, isIgnored()); }