- Timestamp:
- Jun 1, 2017 6:39:08 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
include/iprt/mangling.h (modified) (3 diffs)
-
include/iprt/vfs.h (modified) (2 diffs)
-
include/iprt/vfslowlevel.h (modified) (1 diff)
-
src/VBox/Runtime/Makefile.kmk (modified) (1 diff)
-
src/VBox/Runtime/common/vfs/vfsbase.cpp (modified) (2 diffs)
-
src/VBox/Runtime/common/vfs/vfsfss2dir.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/mangling.h
r67180 r67186 2311 2311 # define RTVfsDirOpenDir RT_MANGLER(RTVfsDirOpenDir) 2312 2312 # define RTVfsDirOpenFile RT_MANGLER(RTVfsDirOpenFile) 2313 # define RTVfsDirOpenFileAsIoStream RT_MANGLER(RTVfsDirOpenFileAsIoStream) 2313 2314 # define RTVfsDirQueryPathInfo RT_MANGLER(RTVfsDirQueryPathInfo) 2314 2315 # define RTVfsDirReadEx RT_MANGLER(RTVfsDirReadEx) … … 2333 2334 # define RTVfsFileWrite RT_MANGLER(RTVfsFileWrite) 2334 2335 # define RTVfsFileWriteAt RT_MANGLER(RTVfsFileWriteAt) 2336 # define RTVfsFsStreamToPrivate RT_MANGLER(RTVfsFsStreamToPrivate) 2335 2337 # define RTVfsFsStrmAdd RT_MANGLER(RTVfsFsStrmAdd) 2336 2338 # define RTVfsFsStrmEnd RT_MANGLER(RTVfsFsStrmEnd) … … 2341 2343 # define RTVfsFsStrmRetain RT_MANGLER(RTVfsFsStrmRetain) 2342 2344 # define RTVfsFsStrmRetainDebug RT_MANGLER(RTVfsFsStrmRetainDebug) 2345 # define RTVfsFsStrmToDir RT_MANGLER(RTVfsFsStrmToDir) 2346 # define RTVfsFsStrmToNormalDir RT_MANGLER(RTVfsFsStrmToNormalDir) 2347 # define RTVfsFsStrmToDirUndo RT_MANGLER(RTVfsFsStrmToDirUndo) 2343 2348 # define RTVfsIoStreamToPrivate RT_MANGLER(RTVfsIoStreamToPrivate) 2344 2349 # define RTVfsIoStrmFlush RT_MANGLER(RTVfsIoStrmFlush) -
trunk/include/iprt/vfs.h
r67180 r67186 448 448 * @param fOpen RTFILE_O_XXX flags. 449 449 * @param phVfsFile Where to return the file. 450 * @sa RTVfsDirOpenFileAsIoStream 450 451 */ 451 452 RTDECL(int) RTVfsDirOpenFile(RTVFSDIR hVfsDir, const char *pszPath, uint64_t fOpen, PRTVFSFILE phVfsFile); 453 454 /** 455 * Convenience wrapper around RTVfsDirOpenFile that returns an I/O stream. 456 * 457 * @returns IPRT status code. 458 * @param hVfsDir The VFS directory start walking the @a pszPath 459 * relative to. 460 * @param pszPath Path to the file. 461 * @param fOpen RTFILE_O_XXX flags. 462 * @param phVfsIos Where to return the I/O stream handle of the file. 463 * @sa RTVfsDirOpenFile 464 */ 465 RTDECL(int) RTVfsDirOpenFileAsIoStream(RTVFSDIR hVfsDir, const char *pszPath, uint64_t fOpen, PRTVFSIOSTREAM phVfsIos); 452 466 453 467 /** … … 1315 1329 PRTVFSFILE phVfsFile); 1316 1330 1331 1332 /** 1333 * Create a file system stream for writing to a directory. 1334 * 1335 * This is just supposed to be a drop in replacement for the TAR creator stream 1336 * that instead puts the files and stuff in a directory instead of a TAR 1337 * archive. In addition, it has an undo feature for simplying cleaning up after 1338 * a botched run 1339 * 1340 * @returns IPRT status code. 1341 * @param hVfsBaseDir The base directory. 1342 * @param fFlags RTVFSFSS2DIR_F_XXX 1343 * @param phVfsFss Where to return the FSS handle. 1344 * @sa RTVfsFsStrmToNormalDir, RTVfsFsStrmToDirUndo 1345 */ 1346 RTDECL(int) RTVfsFsStrmToDir(RTVFSDIR hVfsBaseDir, uint32_t fFlags, PRTVFSFSSTREAM phVfsFss); 1347 1348 /** 1349 * Create a file system stream for writing to a normal directory. 1350 * 1351 * This is just supposed to be a drop in replacement for the TAR creator stream 1352 * that instead puts the files and stuff in a directory instead of a TAR 1353 * archive. In addition, it has an undo feature for simplying cleaning up after 1354 * a botched run 1355 * 1356 * @returns IPRT status code. 1357 * @param pszBaseDir The base directory. Must exist. 1358 * @param fFlags RTVFSFSS2DIR_F_XXX 1359 * @param phVfsFss Where to return the FSS handle. 1360 * @sa RTVfsFsStrmToDir, RTVfsFsStrmToDirUndo 1361 */ 1362 RTDECL(int) RTVfsFsStrmToNormalDir(const char *pszBaseDir, uint32_t fFlags, PRTVFSFSSTREAM phVfsFss); 1363 1364 /** @name RTVFSFSS2DIR_F_XXX - Flags for RTVfsFsStrmToNormalDir 1365 * @{ */ 1366 /** Overwrite existing files (default is to not overwrite anything). */ 1367 #define RTVFSFSS2DIR_F_OVERWRITE_FILES RT_BIT_32(0) 1368 /** Valid bits. */ 1369 #define RTVFSFSS2DIR_F_VALID_MASK UINT32_C(0x00000001) 1370 /** @} */ 1371 1372 /** 1373 * Deletes files, directories, symlinks and stuff created by a FSS returned by 1374 * RTVfsFsStrmToNormalDir or RTVfsFsStrmToDir. 1375 * 1376 * @returns IPRT status code. 1377 * @param hVfsFss The write-to-directory FSS handle. 1378 */ 1379 RTDECL(int) RTVfsFsStrmToDirUndo(RTVFSFSSTREAM hVfsFss); 1380 1381 1382 1317 1383 /** @} */ 1318 1384 -
trunk/include/iprt/vfslowlevel.h
r67166 r67186 490 490 RTDECL(int) RTVfsNewFsStream(PCRTVFSFSSTREAMOPS pFsStreamOps, size_t cbInstance, RTVFS hVfs, RTVFSLOCK hLock, bool fReadOnly, 491 491 PRTVFSFSSTREAM phVfsFss, void **ppvInstance); 492 493 /** 494 * Gets the private data of an filesystem stream. 495 * 496 * @returns Pointer to the private data. NULL if the handle is invalid in some 497 * way. 498 * @param hVfsFss The FS stream handle. 499 * @param pFsStreamOps The FS stream operations. This servers as a 500 * sort of password. 501 */ 502 RTDECL(void *) RTVfsFsStreamToPrivate(RTVFSFSSTREAM hVfsFss, PCRTVFSFSSTREAMOPS pFsStreamOps); 492 503 493 504 -
trunk/src/VBox/Runtime/Makefile.kmk
r67132 r67186 608 608 common/vfs/vfsbase.cpp \ 609 609 common/vfs/vfschain.cpp \ 610 common/vfs/vfsfss2dir.cpp \ 610 611 common/vfs/vfsiosmisc.cpp \ 611 612 common/vfs/vfsmemory.cpp \ -
trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp
r67166 r67186 2087 2087 2088 2088 2089 RTDECL(void *) RTVfsFsStreamToPrivate(RTVFSFSSTREAM hVfsFss, PCRTVFSFSSTREAMOPS pFsStreamOps) 2090 { 2091 RTVFSFSSTREAMINTERNAL *pThis = hVfsFss; 2092 AssertPtrReturn(pThis, NULL); 2093 AssertReturn(pThis->uMagic == RTVFSFSSTREAM_MAGIC, NULL); 2094 if (pThis->pOps != pFsStreamOps) 2095 return NULL; 2096 return pThis->Base.pvThis; 2097 } 2098 2089 2099 2090 2100 /* … … 2364 2374 2365 2375 2376 RTDECL(int) RTVfsDirOpenFileAsIoStream(RTVFSDIR hVfsDir, const char *pszPath, uint64_t fOpen, PRTVFSIOSTREAM phVfsIos) 2377 { 2378 RTVFSFILE hVfsFile; 2379 int rc = RTVfsDirOpenFile(hVfsDir, pszPath, fOpen, &hVfsFile); 2380 if (RT_SUCCESS(rc)) 2381 { 2382 *phVfsIos = RTVfsFileToIoStream(hVfsFile); 2383 AssertStmt(*phVfsIos != NIL_RTVFSIOSTREAM, rc = VERR_INTERNAL_ERROR_2); 2384 RTVfsFileRelease(hVfsFile); 2385 } 2386 return rc; 2387 } 2388 2389 2390 2366 2391 RTDECL(int) RTVfsDirQueryPathInfo(RTVFSDIR hVfsDir, const char *pszPath, PRTFSOBJINFO pObjInfo, 2367 2392 RTFSOBJATTRADD enmAddAttr, uint32_t fFlags)
Note:
See TracChangeset
for help on using the changeset viewer.

