VirtualBox

Changeset 34845 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Dec 8, 2010 5:43:25 PM (14 years ago)
Author:
vboxsync
Message:

iprt: Added RTManifestEntryExists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/manifest2.cpp

    r34536 r34845  
    10331033
    10341034    /*
    1035      * Only add one if it does not already exist.
     1035     * Look it up before removing it.
    10361036     */
    10371037    PRTMANIFESTENTRY pEntry;
     
    10461046
    10471047    return rc;
     1048}
     1049
     1050
     1051RTDECL(bool) RTManifestEntryExists(RTMANIFEST hManifest, const char *pszEntry)
     1052{
     1053    RTMANIFESTINT *pThis = hManifest;
     1054    AssertPtrReturn(pThis, false);
     1055    AssertReturn(pThis->u32Magic == RTMANIFEST_MAGIC, false);
     1056    AssertPtr(pszEntry);
     1057
     1058    bool    fNeedNormalization;
     1059    size_t  cchEntry;
     1060    int rc = rtManifestValidateNameEntry(pszEntry, &fNeedNormalization, &cchEntry);
     1061    AssertRCReturn(rc, false);
     1062
     1063    /*
     1064     * Check if it exists.
     1065     */
     1066    PRTMANIFESTENTRY pEntry;
     1067    rc = rtManifestGetEntry(pThis, pszEntry, fNeedNormalization, cchEntry, &pEntry);
     1068    return RT_SUCCESS_NP(rc);
    10481069}
    10491070
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette