MCPcopy Create free account
hub / github.com/KDE/kdevelop / items

Method items

kdevplatform/language/duchain/codemodel.cpp:352–374  ·  view source on GitHub ↗

FIXME: this API is unsafe, we should return a KDevVarLengthArray of values instead

Source from the content-addressed store, hash-verified

350
351// FIXME: this API is unsafe, we should return a KDevVarLengthArray of values instead
352void CodeModel::items(const IndexedString& file, uint& count, const CodeModelItem*& items) const
353{
354 ifDebug(qCDebug(LANGUAGE) << "items" << file.str(); )
355
356 CodeModelRepositoryItem item;
357 item.file = file;
358 CodeModelRequestItem request(item);
359
360 LockedItemRepository::read<CodeModel>([&](const CodeModelRepo& repo) {
361 uint index = repo.findIndex(item);
362
363 if (index) {
364 const CodeModelRepositoryItem* repositoryItem = repo.itemFromIndex(index);
365 ifDebug(qCDebug(LANGUAGE) << "found index" << index << repositoryItem->itemsSize();)
366 count = repositoryItem->itemsSize();
367 items = repositoryItem->items();
368 } else {
369 ifDebug(qCDebug(LANGUAGE) << "found no index";)
370 count = 0;
371 items = nullptr;
372 }
373 });
374}
375
376CodeModel& CodeModel::self()
377{

Callers 4

addItemMethod · 0.45
updateItemMethod · 0.45
removeItemMethod · 0.45
updateDocumentMethod · 0.45

Calls 3

strMethod · 0.80
findIndexMethod · 0.45
itemFromIndexMethod · 0.45

Tested by

no test coverage detected