Esempio n. 1
0
int vtkDCMParser::FindElement(unsigned short group, unsigned short element)
{
  if(file_in == NULL)
    return 0;

  SeekFirstElement();
  return FindNextElement(group, element);
}
Esempio n. 2
0
unsigned int Element::GetNumElements(string element_name)
{
  unsigned int number_of_elements=0;
  Element* el=FindElement(element_name);
  while (el) {
    number_of_elements++;
    el=FindNextElement(element_name);
  }
  return number_of_elements;
}
Esempio n. 3
0
HRESULT
FindFirstElement(
    IN      IAppHostElementCollection *         pCollection,
    OUT     ENUM_INDEX *                        pIndex,
    OUT     IAppHostElement **                  pElement
    )
{
    HRESULT hr;

    hr = pCollection->get_Count(&pIndex->Count);

    if (FAILED(hr))
    {
        DBGERROR_HR(hr);
        return hr;
    }

    VariantInit(&pIndex->Index);
    pIndex->Index.vt = VT_UI4;
    pIndex->Index.ulVal = 0;

    return FindNextElement(pCollection, pIndex, pElement);
}
Esempio n. 4
0
HRESULT
ClearElementFromAllSites(
    IN      IAppHostAdminManager *      pAdminMgr,
    IN      CONST WCHAR *               szConfigPath,
    IN      CONST WCHAR *               szElementName
    )
{
    HRESULT hr;
    CComPtr<IAppHostElementCollection> pSitesCollection;
    CComPtr<IAppHostElement> pSiteElement;
    CComPtr<IAppHostChildElementCollection> pChildCollection;
    ENUM_INDEX index;
    BOOL found;

    //
    // Enumerate the sites, remove the specified elements.
    //

    hr = GetSitesCollection(
             pAdminMgr,
             szConfigPath,
             &pSitesCollection
             );

    if (FAILED(hr))
    {
        DBGERROR_HR(hr);
        goto exit;
    }

    for (hr = FindFirstElement(pSitesCollection, &index, &pSiteElement) ;
         SUCCEEDED(hr) ;
         hr = FindNextElement(pSitesCollection, &index, &pSiteElement))
    {
        if (hr == S_FALSE)
        {
            hr = S_OK;
            break;
        }

        hr = pSiteElement->get_ChildElements(&pChildCollection);

        if (FAILED(hr))
        {
            DBGERROR_HR(hr);
            goto exit;
        }

        if (pChildCollection)
        {
            hr = ClearChildElementsByName(
                    pChildCollection,
                    szElementName,
                    &found
                    );

            if (FAILED(hr))
            {
                DBGERROR_HR(hr);
                goto exit;
            }
        }

        pSiteElement.Release();
    }

exit:

    return hr;

}