/// This function will acquire mutexes! void CppModelManager::dumpModelManagerConfiguration(const QString &logFileId) { const Snapshot globalSnapshot = snapshot(); const QString globalSnapshotTitle = QString::fromLatin1("Global/Indexing Snapshot (%1 Documents)").arg(globalSnapshot.size()); CppCodeModelInspector::Dumper dumper(globalSnapshot, logFileId); dumper.dumpProjectInfos(projectInfos()); dumper.dumpSnapshot(globalSnapshot, globalSnapshotTitle, /*isGlobalSnapshot=*/ true); dumper.dumpWorkingCopy(workingCopy()); dumper.dumpMergedEntities(headerPaths(), definedMacros()); }
bool DependencyTable::isValidFor(const Snapshot &snapshot) const { const int documentCount = snapshot.size(); if (documentCount != files.size()) return false; for (Snapshot::const_iterator it = snapshot.begin(); it != snapshot.end(); ++it) { QHash<QString, QStringList>::const_iterator i = includesPerFile.find(it.key()); if (i == includesPerFile.end()) return false; if (i.value() != it.value()->includedFiles()) return false; } return true; }
Bool SignerReal::notarize( PublicKey pubkey, Signature signature, const void* data, Size size, Monitor& monitor ) { if (!check_interface(monitor)) return false; eprovider::TheKey thepubkey = creator.getCreatureCurrentTheKey(pubkey); Image signimage = signature.encode(monitor); Snapshot signblock = signimage.snapshot(); Bool result; RECOVER_CALL( (iface->notarizeStart(session, signblock.get(), signblock.size(), signblock.encid(), thepubkey, error)) ); RECOVER_CALL( (iface->notarizeProcess(session, data, size, error)) ); RECOVER_CALL( (result = iface->notarizeStop(session, error)) ); return result; }
void DependencyTable::build(const Snapshot &snapshot) { includesPerFile.clear(); files.clear(); fileIndex.clear(); includes.clear(); includeMap.clear(); const int documentCount = snapshot.size(); files.resize(documentCount); includeMap.resize(documentCount); int i = 0; for (Snapshot::const_iterator it = snapshot.begin(); it != snapshot.end(); ++it, ++i) { files[i] = it.key(); fileIndex[it.key()] = i; } for (int i = 0; i < files.size(); ++i) { const QString fileName = files.at(i); if (Document::Ptr doc = snapshot.document(files.at(i))) { QBitArray bitmap(files.size()); QList<int> directIncludes; const QStringList documentIncludes = doc->includedFiles(); includesPerFile.insert(fileName, documentIncludes); foreach (const QString &includedFile, documentIncludes) { int index = fileIndex.value(includedFile); if (index == -1) continue; else if (! directIncludes.contains(index)) directIncludes.append(index); bitmap.setBit(index, true); } includeMap[i] = bitmap; includes[i] = directIncludes; }
Bool SignerReal::notarize( PublicKey pubkey, Signature signature, Digest hash, Monitor& monitor ) { if (!check_interface(monitor)) return false; eprovider::TheKey thepubkey = creator.getCreatureCurrentTheKey(pubkey); Size hashsize; RECOVER_CALL(hashsize = iface->getMaxHashSize(thepubkey, error)); Padder curpad = padder; if (pubkey.getPadder(Monitor())) { curpad = pubkey.getPadder(monitor); } else if (signature.getPadder(Monitor())) { curpad = signature.getPadder(monitor); } else { //TODO: find default padder } if (curpad.ok() && hashsize.bits()) hash = curpad.pad(hash, hashsize, monitor); if (!monitor) return Bool(); Data hashblock = hash.asData(); Image signimage = signature.encode(monitor); Snapshot signblock = signimage.snapshot(); Bool result; RECOVER_CALL( (result = iface->notarizeHash(session,hashblock.get(), hashblock.size(), signblock.get(), signblock.size(), signblock.encid(), thepubkey, error)) ); return result; }