VirtualBox

Changeset 19926 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 22, 2009 11:37:39 PM (16 years ago)
Author:
vboxsync
Message:

IPRT: Added RTPathAppend.

File:
1 edited

Legend:

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

    r19924 r19926  
    299299 * such as:
    300300 * <ul>
    301  * <li>On DOS-like platforms, both |\| and |/| separator chars are considered
     301 * <li>On DOS-like platforms, both separator chars (|\| and |/|) are considered
    302302 *     to be equal.
    303303 * <li>On platforms with case-insensitive file systems, mismatching characters
     
    305305 * </ul>
    306306 *
    307  * File system details are currently ignored. This means that you won't get
    308  * case-insensitive compares on unix systems when a path goes into a case-insensitive
    309  * filesystem like FAT, HPFS, HFS, NTFS, JFS, or similar. For NT, OS/2 and similar
    310  * you'll won't get case-sensitive compares on a case-sensitive file system.
    311  *
    312  * @param   pszPath1    Path to compare (must be an absolute path).
    313  * @param   pszPath2    Path to compare (must be an absolute path).
    314  *
    315307 * @returns @< 0 if the first path less than the second path.
    316308 * @returns 0 if the first path identical to the second path.
    317309 * @returns @> 0 if the first path greater than the second path.
     310 *
     311 * @param   pszPath1    Path to compare (must be an absolute path).
     312 * @param   pszPath2    Path to compare (must be an absolute path).
     313 *
     314 * @remarks File system details are currently ignored. This means that you won't
     315 *          get case-insentive compares on unix systems when a path goes into a
     316 *          case-insensitive filesystem like FAT, HPFS, HFS, NTFS, JFS, or
     317 *          similar. For NT, OS/2 and similar you'll won't get case-sensitve
     318 *          compares on a case-sensitive file system.
    318319 */
    319320RTDECL(int) RTPathCompare(const char *pszPath1, const char *pszPath2);
     
    322323 * Checks if a path starts with the given parent path.
    323324 *
    324  * This means that either the path and the parent path matches completely, or that
    325  * the path is to some file or directory residing in the tree given by the parent
    326  * directory.
     325 * This means that either the path and the parent path matches completely, or
     326 * that the path is to some file or directory residing in the tree given by the
     327 * parent directory.
    327328 *
    328329 * The path comparison takes platform-dependent details into account,
    329330 * see RTPathCompare() for details.
     331 *
     332 * @returns |true| when \a pszPath starts with \a pszParentPath (or when they
     333 *          are identical), or |false| otherwise.
    330334 *
    331335 * @param   pszPath         Path to check, must be an absolute path.
     
    333337 *                          No trailing directory slash!
    334338 *
    335  * @returns |true| when \a pszPath starts with \a pszParentPath (or when they
    336  *          are identical), or |false| otherwise.
    337  *
    338  * @remark  This API doesn't currently handle root directory compares in a manner
    339  *          consistent with the other APIs. RTPathStartsWith(pszSomePath, "/") will
    340  *          not work if pszSomePath isn't "/".
     339 * @remarks This API doesn't currently handle root directory compares in a
     340 *          manner consistant with the other APIs. RTPathStartsWith(pszSomePath,
     341 *          "/") will not work if pszSomePath isn't "/".
    341342 */
    342343RTDECL(bool) RTPathStartsWith(const char *pszPath, const char *pszParentPath);
     344
     345/**
     346 * Appends one partial path to another.
     347 *
     348 * The main purpose of this function is to deal correctly with leading and
     349 * trailing slashes.
     350 *
     351 * @returns IPRT status code.
     352 * @retval  VERR_PATH
     353 *
     354 * @param   pszPath         The path to append pszAppend to. This serves as both
     355 *                          input and output. This can be empty, in which case
     356 *                          pszAppend is just copied over.
     357 * @param   cchPathDst      The size of the buffer pszPath points to. This
     358 *                          should NOT be strlen(pszPath).
     359 * @param   pszAppend       The partial path to append to pszPath. This can be
     360 *                          NULL, in which case nothing is done.
     361 *
     362 * @remarks On OS/2, Window and similar systems, concatenating a drive letter
     363 *          specifier with a root prefixed path will result in an absolute path.
     364 *          Meaning, RTPathAppend(strcpy(szBuf, "C:"), sizeof(szBuf), "/bar")
     365 *          will result in "C:/bar". (This follows directly from the behavior
     366 *          when pszPath is empty.)
     367 */
     368RTDECL(int) RTPathAppend(char *pszPath, size_t cchPathDst, const char *pszAppend);
    343369
    344370
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