Changeset 71251 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 7, 2018 11:20:00 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r71231 r71251 219 219 } 220 220 221 const char*GetSource() const222 { 223 return mSource .c_str();224 } 225 226 const char*GetFilter() const227 { 228 return mFilter .c_str();221 Utf8Str GetSource() const 222 { 223 return mSource; 224 } 225 226 Utf8Str GetFilter() const 227 { 228 return mFilter; 229 229 } 230 230 … … 1767 1767 RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, RTGETOPTINIT_FLAGS_OPTS_FIRST); 1768 1768 1769 Utf8Str strSource;1770 1769 const char *pszDst = NULL; 1771 1770 bool fDryRun = false; … … 1853 1852 for (unsigned long s = 0; s < vecSources.size(); s++) 1854 1853 { 1855 char *pszSrc = RTStrDup(vecSources[s].GetSource()); 1856 AssertPtrBreakStmt(pszSrc, vrc = VERR_NO_MEMORY); 1857 const char *pszFilter = vecSources[s].GetFilter(); 1858 RT_NOREF(pszFilter); 1859 /* pszFilter can be NULL if not set. */ 1854 Utf8Str strSrc = vecSources[s].GetSource(); 1855 Utf8Str strFilter = vecSources[s].GetFilter(); 1856 RT_NOREF(strFilter); 1857 /* strFilter can be NULL if not set. */ 1860 1858 1861 1859 if (fHostToGuest) 1862 1860 { 1863 if (RTFileExists( pszSrc))1861 if (RTFileExists(strSrc.c_str())) 1864 1862 { 1865 1863 SafeArray<FileCopyFlag_T> copyFlags; 1866 rc = pCtx->pGuestSession->FileCopyToGuest(Bstr( pszSrc).raw(), Bstr(pszDst).raw(),1864 rc = pCtx->pGuestSession->FileCopyToGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), 1867 1865 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1868 1866 } 1869 else if (RTDirExists( pszSrc))1867 else if (RTDirExists(strSrc.c_str())) 1870 1868 { 1871 1869 SafeArray<DirectoryCopyFlag_T> copyFlags; 1872 1870 copyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); 1873 rc = pCtx->pGuestSession->DirectoryCopyToGuest(Bstr( pszSrc).raw(), Bstr(pszDst).raw(),1871 rc = pCtx->pGuestSession->DirectoryCopyToGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), 1874 1872 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1875 1873 } 1876 1874 else if (pCtx->cVerbose) 1877 RTPrintf("Warning: \"%s\" does not exist or is not a file/directory, skipping ...\n", pszSrc);1875 RTPrintf("Warning: \"%s\" does not exist or is not a file/directory, skipping ...\n", strSrc.c_str()); 1878 1876 } 1879 1877 else 1880 1878 { 1881 SafeArray<FileCopyFlag_T> copyFlags; 1882 rc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(pszSrc).raw(), Bstr(pszDst).raw(), 1883 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1879 if ( strSrc.endsWith("/") 1880 || strSrc.endsWith("\\")) 1881 { 1882 SafeArray<DirectoryCopyFlag_T> copyFlags; 1883 copyFlags.push_back(DirectoryCopyFlag_CopyIntoExisting); 1884 rc = pCtx->pGuestSession->DirectoryCopyFromGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), 1885 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1886 } 1887 else 1888 { 1889 SafeArray<FileCopyFlag_T> copyFlags; 1890 rc = pCtx->pGuestSession->FileCopyFromGuest(Bstr(strSrc).raw(), Bstr(pszDst).raw(), 1891 ComSafeArrayAsInParam(copyFlags), pProgress.asOutParam()); 1892 } 1884 1893 } 1885 1894 }
Note:
See TracChangeset
for help on using the changeset viewer.