Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/DIA/DIAEnumInjectedSources.cpp
35294 views
//==- DIAEnumSourceFiles.cpp - DIA Source File Enumerator impl ---*- C++ -*-==//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h"9#include "llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h"10#include "llvm/DebugInfo/PDB/PDBSymbol.h"1112using namespace llvm;13using namespace llvm::pdb;1415DIAEnumInjectedSources::DIAEnumInjectedSources(16CComPtr<IDiaEnumInjectedSources> DiaEnumerator)17: Enumerator(DiaEnumerator) {}1819uint32_t DIAEnumInjectedSources::getChildCount() const {20LONG Count = 0;21return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;22}2324std::unique_ptr<IPDBInjectedSource>25DIAEnumInjectedSources::getChildAtIndex(uint32_t Index) const {26CComPtr<IDiaInjectedSource> Item;27if (S_OK != Enumerator->Item(Index, &Item))28return nullptr;2930return std::unique_ptr<IPDBInjectedSource>(new DIAInjectedSource(Item));31}3233std::unique_ptr<IPDBInjectedSource> DIAEnumInjectedSources::getNext() {34CComPtr<IDiaInjectedSource> Item;35ULONG NumFetched = 0;36if (S_OK != Enumerator->Next(1, &Item, &NumFetched))37return nullptr;3839return std::unique_ptr<IPDBInjectedSource>(new DIAInjectedSource(Item));40}4142void DIAEnumInjectedSources::reset() { Enumerator->Reset(); }434445