Changeset 71213 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Mar 5, 2018 8:30:44 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestSessionImpl.h
r69500 r71213 5 5 6 6 /* 7 * Copyright (C) 2012-201 7Oracle Corporation7 * Copyright (C) 2012-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 70 70 } 71 71 72 const ComObjPtr<Progress>& GetProgressObject() const {return mProgress;} 73 74 protected: 75 76 int getGuestProperty(const ComObjPtr<Guest> &pGuest, 77 const Utf8Str &strPath, Utf8Str &strValue); 72 const ComObjPtr<Progress>& GetProgressObject() const { return mProgress; } 73 74 protected: 75 76 /** @name Directory handling primitives. 77 * @{ */ 78 int directoryCreate(const com::Utf8Str &strPath, DirectoryCreateFlag_T enmDirecotryCreateFlags, uint32_t uMode, bool fFollowSymlinks); 79 /** @} */ 80 81 /** @name File handling primitives. 82 * @{ */ 83 int fileCopyToGuestEx(const Utf8Str &strSource, const Utf8Str &strDest, FileCopyFlag_T enmFileCopyFlags, PRTFILE pFile, uint64_t cbOffset, uint64_t cbSize); 84 int fileCopyToGuest(const Utf8Str &strSource, const Utf8Str &strDest, FileCopyFlag_T enmFileCopyFlags); 85 /** @} */ 86 87 /** @name Guest property handling primitives. 88 * @{ */ 89 int getGuestProperty(const ComObjPtr<Guest> &pGuest, const Utf8Str &strPath, Utf8Str &strValue); 90 /** @} */ 91 92 /** @name Path handling primitives. 93 * @{ */ 94 int pathConstructOnGuest(const Utf8Str &strSourceRoot, const Utf8Str &strSource, const Utf8Str &strDest, Utf8Str &strOut); 95 /** @} */ 96 78 97 int setProgress(ULONG uPercent); 79 98 int setProgressSuccess(void); 80 99 HRESULT setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg); 100 81 101 inline void setTaskDesc(const Utf8Str &strTaskDesc) throw() 82 102 { … … 85 105 86 106 HRESULT createAndSetProgressObject(); 107 87 108 protected: 88 109 89 110 Utf8Str mDesc; 90 GuestSession *mSession; 111 /** The guest session object this task is working on. */ 112 ComObjPtr<GuestSession> mSession; 91 113 /** Progress object for getting updated when running 92 114 * asynchronously. Optional. */ … … 116 138 117 139 /** 140 * Task for copying directories from guest to the host. 141 */ 142 class SessionTaskCopyDirFrom : public GuestSessionTask 143 { 144 public: 145 146 SessionTaskCopyDirFrom(GuestSession *pSession, 147 const Utf8Str &strSource, const Utf8Str &strDest, const Utf8Str &strFilter, DirectoryCopyFlags_T enmDirCopyFlags); 148 virtual ~SessionTaskCopyDirFrom(void); 149 int Run(void); 150 151 protected: 152 153 int directoryCopyToHost(const Utf8Str &strSource, const Utf8Str &strFilter, const Utf8Str &strDest, bool fRecursive, bool fFollowSymlinks, 154 const Utf8Str &strSubDir /* For recursion. */); 155 protected: 156 157 Utf8Str mSource; 158 Utf8Str mDest; 159 Utf8Str mFilter; 160 DirectoryCopyFlags_T mDirCopyFlags; 161 }; 162 163 /** 164 * Task for copying directories from host to the guest. 165 */ 166 class SessionTaskCopyDirTo : public GuestSessionTask 167 { 168 public: 169 170 SessionTaskCopyDirTo(GuestSession *pSession, 171 const Utf8Str &strSource, const Utf8Str &strDest, const Utf8Str &strFilter, DirectoryCopyFlags_T enmDirCopyFlags); 172 virtual ~SessionTaskCopyDirTo(void); 173 int Run(void); 174 175 protected: 176 177 int directoryCopyToGuest(const Utf8Str &strSource, const Utf8Str &strFilter, const Utf8Str &strDest, bool fRecursive, bool fFollowSymlinks, 178 const Utf8Str &strSubDir /* For recursion. */); 179 protected: 180 181 Utf8Str mSource; 182 Utf8Str mDest; 183 Utf8Str mFilter; 184 DirectoryCopyFlags_T mDirCopyFlags; 185 }; 186 187 /** 118 188 * Task for copying files from host to the guest. 119 189 */ 120 class SessionTaskCopy To : public GuestSessionTask121 { 122 public: 123 124 SessionTaskCopy To(GuestSession *pSession,125 const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags);126 SessionTaskCopy To(GuestSession *pSession,127 PRTFILE pSourceFile, size_t cbSourceOffset, uint64_t cbSourceSize,128 const Utf8Str &strDest, uint32_t uFlags);129 virtual ~SessionTaskCopy To(void);190 class SessionTaskCopyFileTo : public GuestSessionTask 191 { 192 public: 193 194 SessionTaskCopyFileTo(GuestSession *pSession, 195 const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags); 196 SessionTaskCopyFileTo(GuestSession *pSession, 197 PRTFILE pSourceFile, size_t cbSourceOffset, uint64_t cbSourceSize, 198 const Utf8Str &strDest, uint32_t uFlags); 199 virtual ~SessionTaskCopyFileTo(void); 130 200 int Run(void); 131 201 … … 143 213 * Task for copying files from guest to the host. 144 214 */ 145 class SessionTaskCopyF rom : public GuestSessionTask146 { 147 public: 148 149 SessionTaskCopyF rom(GuestSession *pSession,215 class SessionTaskCopyFileFrom : public GuestSessionTask 216 { 217 public: 218 219 SessionTaskCopyFileFrom(GuestSession *pSession, 150 220 const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags); 151 virtual ~SessionTaskCopyF rom(void);221 virtual ~SessionTaskCopyFileFrom(void); 152 222 int Run(void); 153 223 … … 223 293 }; 224 294 225 int i_addProcessArguments(ProcessArguments &aArgumentsDest, 226 const ProcessArguments &aArgumentsSource); 227 int i_copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO, 228 Utf8Str const &strFileSource, const Utf8Str &strFileDest, 229 bool fOptional, uint32_t *pcbSize); 230 int i_runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo); 295 int addProcessArguments(ProcessArguments &aArgumentsDest, const ProcessArguments &aArgumentsSource); 296 int copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO, Utf8Str const &strFileSource, const Utf8Str &strFileDest, bool fOptional, uint32_t *pcbSize); 297 int runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo); 231 298 232 299 /** Files to handle. */ … … 423 490 * @todo r=bird: Most of these are public for no real reason... 424 491 * @{ */ 492 int i_copyToGuestCreateDir(const com::Utf8Str &aDestination, uint32_t fFlags, int *pGuestRc); 425 493 int i_closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc); 426 494 inline bool i_directoryExists(uint32_t uDirID, ComObjPtr<GuestDirectory> *pDir);
Note:
See TracChangeset
for help on using the changeset viewer.