- Timestamp:
- Sep 28, 2018 3:08:24 PM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp
r74478 r74526 485 485 if (RT_SUCCESS(rc)) 486 486 { 487 RTCString strRoot = lstURI. RootToString();487 RTCString strRoot = lstURI.GetRootEntries(); 488 488 size_t cbRoot = strRoot.length() + 1; /* Include termination */ 489 489 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r69749 r74526 562 562 int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags, 563 563 #ifdef DEBUG 564 "all.e.l. f",564 "all.e.l.l2.l3.f", 565 565 "VBOXTRAY_LOG", 566 566 #else … … 568 568 "VBOXTRAY_RELEASE_LOG", 569 569 #endif 570 RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT ,570 RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT | RTLOGDEST_USER, 571 571 vboxTrayLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime, 572 572 RTErrInfoInitStatic(&ErrInfo), pszLogFile); -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r74472 r74526 410 410 * Enter the main loop of retieving files + directories. 411 411 */ 412 DnDURIObject objFile(DnDURIObject:: File);412 DnDURIObject objFile(DnDURIObject::Type_File); 413 413 414 414 char szPathName[RTPATH_MAX] = { 0 }; … … 510 510 uint32_t fCreationMode = (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR; 511 511 #endif 512 rc = objFile.OpenEx(strPathAbs, DnDURIObject:: File, DnDURIObject::Target, fOpen, fCreationMode);512 rc = objFile.OpenEx(strPathAbs, DnDURIObject::Type_File, DnDURIObject::View_Target, fOpen, fCreationMode); 513 513 if (RT_SUCCESS(rc)) 514 514 { … … 866 866 Assert(cbData); 867 867 868 rc = lstURI. RootFromURIData(pvData, cbData, 0 /* fFlags */);868 rc = lstURI.SetFromURIData(pvData, cbData, 0 /* fFlags */); 869 869 if (RT_SUCCESS(rc)) 870 870 rc = vbglR3DnDHGRecvURIData(pCtx, &dataHdr, &droppedFiles); … … 879 879 } 880 880 881 RTCString strData = lstURI. RootToString(droppedFiles.GetDirAbs());881 RTCString strData = lstURI.GetRootEntries(droppedFiles.GetDirAbs()); 882 882 Assert(!strData.isEmpty()); 883 883 … … 1562 1562 static int vbglR3DnDGHSendDir(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject *pObj) 1563 1563 { 1564 AssertPtrReturn(pObj, VERR_INVALID_POINTER);1565 AssertPtrReturn(pCtx, VERR_INVALID_POINTER);1566 AssertReturn(pObj->GetType() == DnDURIObject:: Directory, VERR_INVALID_PARAMETER);1564 AssertPtrReturn(pObj, VERR_INVALID_POINTER); 1565 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1566 AssertReturn(pObj->GetType() == DnDURIObject::Type_Directory, VERR_INVALID_PARAMETER); 1567 1567 1568 1568 RTCString strPath = pObj->GetDestPath(); … … 1598 1598 static int vbglR3DnDGHSendFile(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject *pObj) 1599 1599 { 1600 AssertPtrReturn(pCtx, VERR_INVALID_POINTER);1601 AssertPtrReturn(pObj, VERR_INVALID_POINTER);1602 AssertReturn(pObj->GetType() == DnDURIObject:: File, VERR_INVALID_PARAMETER);1603 AssertReturn(pObj->IsOpen(), VERR_INVALID_STATE);1600 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1601 AssertPtrReturn(pObj, VERR_INVALID_POINTER); 1602 AssertReturn(pObj->GetType() == DnDURIObject::Type_File, VERR_INVALID_PARAMETER); 1603 AssertReturn(pObj->IsOpen(), VERR_INVALID_STATE); 1604 1604 1605 1605 uint32_t cbBuf = _64K; /** @todo Make this configurable? */ … … 1700 1700 switch (pObj->GetType()) 1701 1701 { 1702 case DnDURIObject:: Directory:1702 case DnDURIObject::Type_Directory: 1703 1703 rc = vbglR3DnDGHSendDir(pCtx, pObj); 1704 1704 break; 1705 1705 1706 case DnDURIObject:: File:1706 case DnDURIObject::Type_File: 1707 1707 rc = vbglR3DnDGHSendFile(pCtx, pObj); 1708 1708 break; … … 1771 1771 * URI list the host needs to know upfront to set up the drag'n drop operation. 1772 1772 */ 1773 RTCString strRootDest = lstURI. RootToString();1773 RTCString strRootDest = lstURI.GetRootEntries(); 1774 1774 if (strRootDest.isNotEmpty()) 1775 1775 { … … 1779 1779 /* The total size also contains the size of the meta data. */ 1780 1780 uint64_t cbTotal = cbURLIist; 1781 cbTotal += lstURI. TotalBytes();1781 cbTotal += lstURI.GetTotalBytes(); 1782 1782 1783 1783 /* We're going to send an URI list in text format. */ … … 1791 1791 dataHdr.pvMetaFmt = (void *)szMetaFmt; 1792 1792 dataHdr.cbMetaFmt = cbMetaFmt; 1793 dataHdr.cObjects = lstURI. TotalCount();1793 dataHdr.cObjects = lstURI.GetTotalCount(); 1794 1794 1795 1795 rc = vbglR3DnDGHSendDataInternal(pCtx, -
trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp
r69753 r74526 5 5 6 6 /* 7 * Copyright (C) 2014-201 7Oracle Corporation7 * Copyright (C) 2014-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 , m_hDir(NULL) { } 39 39 40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fFlags)40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 41 41 : m_fOpen(0) 42 42 , m_hDir(NULL) … … 101 101 } 102 102 103 int DnDDroppedFiles::OpenEx(const char *pszPath, uint32_t fFlags)103 int DnDDroppedFiles::OpenEx(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 104 104 { 105 105 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); … … 168 168 } 169 169 170 int DnDDroppedFiles::OpenTemp( uint32_t fFlags)170 int DnDDroppedFiles::OpenTemp(DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */) 171 171 { 172 172 AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); /* Flags not supported yet. */ -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r69758 r74526 5 5 6 6 /* 7 * Copyright (C) 2014-201 7Oracle Corporation7 * Copyright (C) 2014-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 } 49 49 50 int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, uint32_tfFlags)50 int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, DNDURILISTFLAGS fFlags) 51 51 { 52 52 AssertPtrReturn(pcszSource, VERR_INVALID_POINTER); … … 64 64 pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode)); 65 65 66 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject:: File, pcszSource, pcszTarget);66 DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::Type_File, pcszSource, pcszTarget); 67 67 if (pObjFile) 68 68 { … … 70 70 { 71 71 /** @todo Add a standard fOpen mode for this list. */ 72 rc = pObjFile->Open(DnDURIObject:: Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);72 rc = pObjFile->Open(DnDURIObject::View_Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode); 73 73 } 74 74 … … 90 90 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode)); 91 91 92 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject:: Directory, pcszSource, pcszTarget,92 DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Type_Directory, pcszSource, pcszTarget, 93 93 objInfo.Attr.fMode, 0 /* Size */); 94 94 if (pObjDir) … … 112 112 113 113 int DnDURIList::appendPathRecursive(const char *pcszSrcPath, 114 const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, uint32_t fFlags) 114 const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, 115 DNDURILISTFLAGS fFlags) 115 116 { 116 117 AssertPtrReturn(pcszSrcPath, VERR_INVALID_POINTER); … … 118 119 AssertPtrReturn(pcszDstPath, VERR_INVALID_POINTER); 119 120 120 LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu \n",121 pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase ));121 LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu, fFlags=0x%x\n", 122 pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase, fFlags)); 122 123 123 124 RTFSOBJINFO objInfo; … … 278 279 } 279 280 280 int DnDURIList::AppendNativePath(const char *pszPath, uint32_tfFlags)281 int DnDURIList::AppendNativePath(const char *pszPath, DNDURILISTFLAGS fFlags) 281 282 { 282 283 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); … … 307 308 308 309 int DnDURIList::AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths, 309 uint32_tfFlags)310 DNDURILISTFLAGS fFlags) 310 311 { 311 312 AssertPtrReturn(pszNativePaths, VERR_INVALID_POINTER); … … 318 319 319 320 int DnDURIList::AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths, 320 uint32_tfFlags)321 DNDURILISTFLAGS fFlags) 321 322 { 322 323 int rc = VINF_SUCCESS; … … 334 335 } 335 336 336 int DnDURIList::AppendURIPath(const char *pszURI, uint32_tfFlags)337 int DnDURIList::AppendURIPath(const char *pszURI, DNDURILISTFLAGS fFlags) 337 338 { 338 339 AssertPtrReturn(pszURI, VERR_INVALID_POINTER); … … 385 386 386 387 int DnDURIList::AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths, 387 uint32_tfFlags)388 DNDURILISTFLAGS fFlags) 388 389 { 389 390 AssertPtrReturn(pszURIPaths, VERR_INVALID_POINTER); … … 396 397 397 398 int DnDURIList::AppendURIPathsFromList(const RTCList<RTCString> &lstURI, 398 uint32_tfFlags)399 DNDURILISTFLAGS fFlags) 399 400 { 400 401 int rc = VINF_SUCCESS; … … 447 448 } 448 449 449 int DnDURIList:: RootFromURIData(const void *pvData, size_t cbData, uint32_tfFlags)450 int DnDURIList::SetFromURIData(const void *pvData, size_t cbData, DNDURILISTFLAGS fFlags) 450 451 { 451 452 Assert(fFlags == 0); RT_NOREF1(fFlags); … … 493 494 } 494 495 495 RTCString DnDURIList:: RootToString(const RTCString &strPathBase /* = "" */,496 RTCString DnDURIList::GetRootEntries(const RTCString &strPathBase /* = "" */, 496 497 const RTCString &strSeparator /* = "\r\n" */) const 497 498 { -
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
r69500 r74526 6 6 7 7 /* 8 * Copyright (C) 2014-201 7Oracle Corporation8 * Copyright (C) 2014-2018 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 37 37 38 38 DnDURIObject::DnDURIObject(void) 39 : m_Type( Unknown)39 : m_Type(Type_Unknown) 40 40 , m_fOpen(false) 41 41 , m_fMode(0) … … 46 46 } 47 47 48 DnDURIObject::DnDURIObject(Type type,48 DnDURIObject::DnDURIObject(Type enmType, 49 49 const RTCString &strSrcPath /* = 0 */, 50 50 const RTCString &strDstPath /* = 0 */, 51 51 uint32_t fMode /* = 0 */, uint64_t cbSize /* = 0 */) 52 : m_Type( type)52 : m_Type(enmType) 53 53 , m_strSrcPath(strSrcPath) 54 54 , m_strTgtPath(strDstPath) … … 74 74 switch (m_Type) 75 75 { 76 case File:76 case Type_File: 77 77 { 78 78 RTFileClose(u.m_hFile); … … 81 81 } 82 82 83 case Directory:83 case Type_Directory: 84 84 break; 85 85 … … 102 102 switch (m_Type) 103 103 { 104 case File:104 case Type_File: 105 105 Assert(m_cbProcessed <= m_cbSize); 106 106 fComplete = m_cbProcessed == m_cbSize; 107 107 break; 108 108 109 case Directory:109 case Type_Directory: 110 110 fComplete = true; 111 111 break; … … 124 124 } 125 125 126 int DnDURIObject::Open( Dest enmDest, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */)127 { 128 return OpenEx( enm Dest ==Source126 int DnDURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */) 127 { 128 return OpenEx( enmView == View_Source 129 129 ? m_strSrcPath : m_strTgtPath 130 , m_Type, enm Dest, fOpen, fMode, 0 /* fFlags */);131 } 132 133 int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, Dest enmDest,134 uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, uint32_t fFlags /* = 0*/)130 , m_Type, enmView, fOpen, fMode, 0 /* fFlags */); 131 } 132 133 int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, View enmView, 134 uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */) 135 135 { 136 136 Assert(fFlags == 0); RT_NOREF1(fFlags); 137 137 int rc = VINF_SUCCESS; 138 138 139 switch (enm Dest)140 { 141 case Source:139 switch (enmView) 140 { 141 case View_Source: 142 142 m_strSrcPath = strPath; 143 143 break; 144 144 145 case Target:145 case View_Target: 146 146 m_strTgtPath = strPath; 147 147 break; … … 155 155 && fOpen) /* Opening mode specified? */ 156 156 { 157 LogFlowThisFunc((" enmType=%RU32, strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n",158 enmType, strPath.c_str(), fOpen, enmType, enmDest));157 LogFlowThisFunc(("strPath=%s, enmType=%RU32, enmView=%RU32, fOpen=0x%x, fMode=0x%x, fFlags=0x%x\n", 158 strPath.c_str(), enmType, enmView, fOpen, fFlags)); 159 159 switch (enmType) 160 160 { 161 case File:161 case Type_File: 162 162 { 163 163 if (!m_fOpen) … … 207 207 } 208 208 209 case Directory:209 case Type_Directory: 210 210 rc = VINF_SUCCESS; 211 211 break; … … 294 294 switch (m_Type) 295 295 { 296 case File:297 { 298 rc = OpenEx(m_strSrcPath, File,Source,296 case Type_File: 297 { 298 rc = OpenEx(m_strSrcPath, Type_File, View_Source, 299 299 /* Use some sensible defaults. */ 300 300 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */); … … 319 319 } 320 320 321 case Directory:321 case Type_Directory: 322 322 { 323 323 rc = VINF_SUCCESS; … … 346 346 Close(); 347 347 348 m_Type = Unknown;348 m_Type = Type_Unknown; 349 349 m_strSrcPath = ""; 350 350 m_strTgtPath = ""; … … 365 365 switch (m_Type) 366 366 { 367 case File:368 { 369 rc = OpenEx(m_strTgtPath, File,Target,367 case Type_File: 368 { 369 rc = OpenEx(m_strTgtPath, Type_File, View_Target, 370 370 /* Use some sensible defaults. */ 371 371 RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_WRITE, 0 /* fFlags */); … … 379 379 } 380 380 381 case Directory:381 case Type_Directory: 382 382 { 383 383 rc = VINF_SUCCESS; -
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r74439 r74526 6 6 7 7 /* 8 * Copyright (C) 2011-201 7Oracle Corporation8 * Copyright (C) 2011-2018 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 166 166 int fromURIList(const DnDURIList &lstURI) 167 167 { 168 return fromString(lstURI. RootToString());168 return fromString(lstURI.GetRootEntries()); 169 169 } 170 170 … … 390 390 public: 391 391 392 int createIntermediate(DnDURIObject::Type enmType = DnDURIObject:: Unknown)392 int createIntermediate(DnDURIObject::Type enmType = DnDURIObject::Type_Unknown) 393 393 { 394 394 reset(); … … 564 564 switch (Obj.GetType()) 565 565 { 566 case DnDURIObject:: Directory:567 case DnDURIObject:: File:566 case DnDURIObject::Type_Directory: 567 case DnDURIObject::Type_File: 568 568 rc = VINF_SUCCESS; 569 569 break; … … 647 647 rc = lstURI.AppendURIPathsFromList(lstURIOrg, DNDURILIST_FLAGS_KEEP_OPEN); 648 648 if (RT_SUCCESS(rc)) 649 cObjToProcess = lstURI. TotalCount();649 cObjToProcess = lstURI.GetTotalCount(); 650 650 } 651 651 } … … 659 659 LogFlowFuncEnter(); 660 660 661 int rc = lstURI. RootFromURIData(Data.getData(), Data.getSize(), 0 /* uFlags */);661 int rc = lstURI.SetFromURIData(Data.getData(), Data.getSize(), 0 /* uFlags */); 662 662 if (RT_SUCCESS(rc)) 663 663 { 664 const size_t cRootCount = lstURI. RootCount();664 const size_t cRootCount = lstURI.GetRootCount(); 665 665 LogFlowFunc(("cRootCount=%zu, cObjToProcess=%RU64\n", cRootCount, cObjToProcess)); 666 666 if (cRootCount > cObjToProcess) … … 675 675 const char *pszDroppedFilesDir = droppedFiles.GetDirAbs(); 676 676 677 Utf8Str strURIs = lstURI. RootToString(RTCString(pszDroppedFilesDir));677 Utf8Str strURIs = lstURI.GetRootEntries(RTCString(pszDroppedFilesDir)); 678 678 size_t cbData = strURIs.length(); 679 679 680 LogFlowFunc(("%zu root URIs (%zu bytes)\n", lstURI. RootCount(), cbData));680 LogFlowFunc(("%zu root URIs (%zu bytes)\n", lstURI.GetRootCount(), cbData)); 681 681 682 682 int rc; -
trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
r74499 r74526 693 693 GuestDnDURIObjCtx &objCtx = pCtx->mURI.getObj(0); /** @todo Fill in context ID. */ 694 694 695 rc = objCtx.createIntermediate(DnDURIObject:: Directory);695 rc = objCtx.createIntermediate(DnDURIObject::Type_Directory); 696 696 if (RT_FAILURE(rc)) 697 697 return rc; … … 827 827 828 828 /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */ 829 rc = pObj->OpenEx(pszPathAbs, DnDURIObject:: File, DnDURIObject::Target,829 rc = pObj->OpenEx(pszPathAbs, DnDURIObject::Type_File, DnDURIObject::View_Target, 830 830 RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE, 831 831 (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR); -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r74495 r74526 944 944 { 945 945 LogRel2(("DnD: Opening host file for transferring to guest: %s\n", strPathSrc.c_str())); 946 rc = pObj->OpenEx(strPathSrc, DnDURIObject:: File, DnDURIObject::Source,946 rc = pObj->OpenEx(strPathSrc, DnDURIObject::Type_File, DnDURIObject::View_Source, 947 947 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */); 948 948 if (RT_FAILURE(rc)) … … 1341 1341 1342 1342 LogFlowFunc(("URI root objects: %zu, total bytes (raw data to transfer): %zu\n", 1343 pURI->getURIList(). RootCount(), pURI->getURIList().TotalBytes()));1343 pURI->getURIList().GetRootCount(), pURI->getURIList().GetTotalBytes())); 1344 1344 1345 1345 /* … … 1355 1355 */ 1356 1356 const uint32_t cbMeta = pData->getMeta().getSize(); 1357 pData->setEstimatedSize(pURI->getURIList(). TotalBytes() + cbMeta /* cbTotal */,1358 cbMeta /* cbMeta */);1357 pData->setEstimatedSize(pURI->getURIList().GetTotalBytes() + cbMeta /* cbTotal */, 1358 cbMeta /* cbMeta */); 1359 1359 1360 1360 /*
Note:
See TracChangeset
for help on using the changeset viewer.