Changeset 28915 in vbox for trunk/src/VBox/Runtime/r3/posix/pathhost-posix.cpp
- Timestamp:
- Apr 29, 2010 6:12:35 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60863
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/pathhost-posix.cpp
r28912 r28915 177 177 178 178 179 int rtPathToNative(char **ppszNativePath, const char *pszPath)179 int rtPathToNative(char const **ppszNativePath, const char *pszPath, const char *pszBasePath) 180 180 { 181 181 *ppszNativePath = NULL; … … 185 185 { 186 186 if (g_fPassthruUtf8 || !*pszPath) 187 *ppszNativePath = (char *)pszPath;187 *ppszNativePath = pszPath; 188 188 else 189 189 rc = rtStrConvert(pszPath, strlen(pszPath), "UTF-8", 190 ppszNativePath, 0, g_szFsCodeset,190 (char **)ppszNativePath, 0, g_szFsCodeset, 191 191 2, g_enmUtf8ToFsIdx); 192 192 } 193 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 193 194 return rc; 194 195 } 195 196 196 197 197 int rtPathToNativeEx(char **ppszNativePath, const char *pszPath, const char *pszBasePath) 198 { 199 /* We don't query the FS for codeset preferences yet, so nothing special to do here. */ 200 NOREF(pszBasePath); 201 return rtPathToNative(ppszNativePath, pszPath); 202 } 203 204 205 void rtPathFreeNative(char *pszNativePath, const char *pszPath) 198 void rtPathFreeNative(char const *pszNativePath, const char *pszPath) 206 199 { 207 200 if ( pszNativePath != pszPath 208 201 && pszNativePath) 209 RTStrFree( pszNativePath);210 } 211 212 213 int rtPathFromNative(c har **ppszPath, const char *pszNativePath)202 RTStrFree((char *)pszNativePath); 203 } 204 205 206 int rtPathFromNative(const char **ppszPath, const char *pszNativePath, const char *pszBasePath) 214 207 { 215 208 *ppszPath = NULL; … … 235 228 else 236 229 rc = rtStrConvert(pszNativePath, strlen(pszNativePath), g_szFsCodeset, 237 ppszPath, 0, "UTF-8",230 (char **)ppszPath, 0, "UTF-8", 238 231 2, g_enmFsToUtf8Idx); 239 232 } 233 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 240 234 return rc; 241 235 } 242 236 243 237 244 int rtPathFromNativeEx(char **ppszPath, const char *pszNativePath, const char *pszBasePath) 245 { 246 /* We don't query the FS for codeset preferences yet, so nothing special to do here. */ 247 NOREF(pszBasePath); 248 return rtPathFromNative(ppszPath, pszNativePath); 249 } 250 238 void rtPathFreeIprt(const char *pszPath, const char *pszNativePath) 239 { 240 if ( pszPath != pszNativePath 241 && !pszPath) 242 RTStrFree((char *)pszPath); 243 } 244 245 246 int rtPathFromNativeCopy(char *pszPath, size_t cbPath, const char *pszNativePath, const char *pszBasePath) 247 { 248 int rc = RTOnce(&g_OnceInitPathConv, rtPathConvInitOnce, NULL, NULL); 249 if (RT_SUCCESS(rc)) 250 { 251 if (g_fPassthruUtf8 || !*pszNativePath) 252 rc = RTStrCopyEx(pszPath, cbPath, pszNativePath, RTSTR_MAX); 253 else if (cbPath) 254 rc = rtStrConvert(pszNativePath, strlen(pszNativePath), g_szFsCodeset, 255 &pszPath, cbPath, "UTF-8", 256 2, g_enmFsToUtf8Idx); 257 else 258 rc = VERR_BUFFER_OVERFLOW; 259 } 260 261 NOREF(pszBasePath); /* We don't query the FS for codeset preferences. */ 262 return rc; 263 } 264
Note:
See TracChangeset
for help on using the changeset viewer.