VirtualBox

Ignore:
Timestamp:
Apr 29, 2010 6:12:35 PM (15 years ago)
Author:
vboxsync
Message:

iprt: More path conversion avoidance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/pathhost-generic.cpp

    r28912 r28915  
    3737
    3838
    39 int rtPathToNative(char **ppszNativePath, const char *pszPath)
     39int rtPathToNative(char const **ppszNativePath, const char *pszPath, const char *pszBasePath)
    4040{
    41     *ppszNativePath = (char *)pszPath;
     41    *ppszNativePath = pszPath;
     42    NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */
    4243    return VINF_SUCCESS;
    4344}
    4445
    4546
    46 int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath)
    47 {
    48     /* We don't query the FS for codeset preferences yet, so nothing special to do here. */
    49     NOREF(pszBasePath);
    50     return rtPathToNative(ppszNativePath, pszPath);
    51 }
    52 
    53 
    54 void rtPathFreeNative(char *pszNativePath, const char *pszPath)
     47void rtPathFreeNative(char const *pszNativePath, const char *pszPath)
    5548{
    5649    Assert(pszNativePath == pszPath || !pszNativePath);
     
    5952
    6053
    61 int rtPathFromNative(char **ppszPath, const char *pszNativePath)
     54int rtPathFromNative(const char **ppszPath, const char *pszNativePath, const char *pszBasePath)
    6255{
    6356    int rc = RTStrValidateEncodingEx(pszNativePath, RTSTR_MAX, 0 /*fFlags*/);
    6457    if (RT_SUCCESS(rc))
    65         rc = RTStrDupEx(ppszPath, pszNativePath);
     58        *ppszPath = pszNativePath;
     59    NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */
    6660    return rc;
    6761}
    6862
    6963
    70 int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath)
     64void rtPathFreeIprt(const char *pszPath, const char *pszNativePath)
    7165{
    72     /* We don't query the FS for codeset preferences yet, so nothing special to do here. */
    73     NOREF(pszBasePath);
    74     return rtPathFromNative(ppszPath, pszNativePath);
     66    Assert(pszPath == pszNativePath || !pszPath);
     67    NOREF(pszPath); NOREF(pszNativePath);
    7568}
    7669
     70
     71int rtPathFromNativeCopy(char *pszPath, size_t cbPath, const char *pszNativePath, const char *pszBasePath)
     72{
     73    int rc = RTStrValidateEncodingEx(pszNativePath, RTSTR_MAX, 0 /*fFlags*/);
     74    if (RT_SUCCESS(rc))
     75        rc = RTStrCopyEx(pszPath, cbPath, pszNativePath, RTSTR_MAX);
     76    NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */
     77    return rc;
     78}
     79
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