VirtualBox

Changeset 85311 in vbox for trunk


Ignore:
Timestamp:
Jul 13, 2020 4:07:10 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139289
Message:

IPRT: Added RTPathFindCommon[Ex] + testcases.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r85154 r85311  
    16801680# define RTPathFilenameEx                               RT_MANGLER(RTPathFilenameEx)
    16811681# define RTPathFilenameExUtf16                          RT_MANGLER(RTPathFilenameExUtf16)
     1682# define RTPathFindCommon                               RT_MANGLER(RTPathFindCommon)
     1683# define RTPathFindCommonEx                             RT_MANGLER(RTPathFindCommonEx)
    16821684# define RTPathGetCurrent                               RT_MANGLER(RTPathGetCurrent)
    16831685# define RTPathGetCurrentDrive                          RT_MANGLER(RTPathGetCurrentDrive)
  • trunk/include/iprt/path.h

    r85121 r85311  
    519519RTDECL(char *) RTPathFilenameEx(const char *pszPath, uint32_t fFlags);
    520520RTDECL(PRTUTF16) RTPathFilenameExUtf16(PCRTUTF16 pwszPath, uint32_t fFlags);
     521
     522/**
     523 * Finds the common path in a given set of paths, extended version.
     524 *
     525 * Note: This does not check paths for existience or other things (e.g. symlinks).
     526 *
     527 * @returns Length (in characters) of the common path, 0 if not found.
     528 * @param   papcszPaths         Array of paths to find common path for.
     529 * @param   cPaths              Number of paths in \a papcszPaths.
     530 * @param   szSeparator         Path separator to use for comparision.
     531 */
     532RTDECL(size_t) RTPathFindCommonEx(const char * const *papcszPaths, size_t cPaths, char szSeparator);
     533
     534/**
     535 * Finds the common path in a given set of paths.
     536 *
     537 * Uses the system's native slash as separator.
     538 * Note: This does not check paths for existience or other things (e.g. symlinks).
     539 *
     540 * @returns Length (in characters) of the common path, 0 if not found.
     541 * @param   papcszPaths         Array of paths to find common path for.
     542 * @param   cPaths              Number of paths in \a papcszPaths.
     543 * @param   szSeparator         Path separator to use for comparision.
     544 */
     545RTDECL(size_t) RTPathFindCommon(const char * const *papcszPaths, size_t cPaths);
    521546
    522547/**
  • trunk/src/VBox/Runtime/Makefile.kmk

    r85154 r85311  
    548548        common/path/RTPathFilename.cpp \
    549549        common/path/RTPathFilenameUtf16.cpp \
     550        common/path/RTPathFindCommon.cpp \
    550551        common/path/RTPathGlob.cpp \
    551552        common/path/RTPathHasExt.cpp \
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r85154 r85311  
    101101        tstOnce \
    102102        tstRTPath \
     103        tstRTPathFindCommon \
    103104        tstRTPathGlob \
    104105        tstRTPathQueryInfo \
     
    569570tstRTPath_SOURCES = tstRTPath.cpp
    570571
     572tstRTPathFindCommon_TEMPLATE = VBOXR3TSTEXE
     573tstRTPathFindCommon_SOURCES = tstRTPathFindCommon.cpp
     574
    571575tstRTPathGlob_TEMPLATE = VBOXR3TSTEXE
    572576tstRTPathGlob_SOURCES = tstRTPathGlob.cpp
Note: See TracChangeset for help on using the changeset viewer.

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