Changeset 78390 in vbox for trunk/src/VBox/GuestHost/SharedClipboard/ClipboardURIObject.cpp
- Timestamp:
- May 6, 2019 1:49:30 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardURIObject.cpp
r78307 r78390 1 1 /* $Id$ */ 2 2 /** @file 3 * DnD- URI object class. For handling creation/reading/writing to files and directories on host or guest side.3 * Shared Clipboard - URI object class. For handling creation/reading/writing to files and directories on host or guest side. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 201 4-2019 Oracle Corporation7 * Copyright (C) 2019 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define LOG_GROUP LOG_GROUP_ GUEST_DND23 #include <VBox/GuestHost/ DragAndDrop.h>22 #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD 23 #include <VBox/GuestHost/SharedClipboard-uri.h> 24 24 25 25 #include <iprt/dir.h> … … 33 33 34 34 35 DnDURIObject::DnDURIObject(void)35 SharedClipboardURIObject::SharedClipboardURIObject(void) 36 36 : m_enmType(Type_Unknown) 37 37 , m_enmView(View_Unknown) … … 40 40 } 41 41 42 DnDURIObject::DnDURIObject(Type enmType,43 const RTCString &strSrcPathAbs /* = 0 */,44 const RTCString &strDstPathAbs /* = 0 */)42 SharedClipboardURIObject::SharedClipboardURIObject(Type enmType, 43 const RTCString &strSrcPathAbs /* = 0 */, 44 const RTCString &strDstPathAbs /* = 0 */) 45 45 : m_enmType(enmType) 46 46 , m_enmView(View_Unknown) … … 69 69 } 70 70 71 DnDURIObject::~DnDURIObject(void)71 SharedClipboardURIObject::~SharedClipboardURIObject(void) 72 72 { 73 73 closeInternal(); … … 78 78 * 79 79 */ 80 void DnDURIObject::closeInternal(void)80 void SharedClipboardURIObject::closeInternal(void) 81 81 { 82 82 LogFlowThisFuncEnter(); … … 109 109 * This also closes the internal handles associated with the object (to files / ...). 110 110 */ 111 void DnDURIObject::Close(void)111 void SharedClipboardURIObject::Close(void) 112 112 { 113 113 closeInternal(); … … 119 119 * @return File / directory mode. 120 120 */ 121 RTFMODE DnDURIObject::GetMode(void) const121 RTFMODE SharedClipboardURIObject::GetMode(void) const 122 122 { 123 123 switch (m_enmType) … … 140 140 * Returns the bytes already processed (read / written). 141 141 * 142 * Note: Only applies if the object is of type DnDURIObject::Type_File.142 * Note: Only applies if the object is of type SharedClipboardURIObject::Type_File. 143 143 * 144 144 * @return Bytes already processed (read / written). 145 145 */ 146 uint64_t DnDURIObject::GetProcessed(void) const146 uint64_t SharedClipboardURIObject::GetProcessed(void) const 147 147 { 148 148 if (m_enmType == Type_File) … … 155 155 * Returns the file's logical size (in bytes). 156 156 * 157 * Note: Only applies if the object is of type DnDURIObject::Type_File.157 * Note: Only applies if the object is of type SharedClipboardURIObject::Type_File. 158 158 * 159 159 * @return The file's logical size (in bytes). 160 160 */ 161 uint64_t DnDURIObject::GetSize(void) const161 uint64_t SharedClipboardURIObject::GetSize(void) const 162 162 { 163 163 if (m_enmType == Type_File) … … 173 173 * @return True if complete, False if not. 174 174 */ 175 bool DnDURIObject::IsComplete(void) const175 bool SharedClipboardURIObject::IsComplete(void) const 176 176 { 177 177 bool fComplete; … … 199 199 * Returns whether the object is in an open state or not. 200 200 */ 201 bool DnDURIObject::IsOpen(void) const201 bool SharedClipboardURIObject::IsOpen(void) const 202 202 { 203 203 switch (m_enmType) … … 219 219 * @param fMode File mode to use. 220 220 */ 221 int DnDURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */)221 int SharedClipboardURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */) 222 222 { 223 223 return OpenEx( enmView == View_Source 224 224 ? m_strSrcPathAbs : m_strTgtPathAbs 225 , enmView, fOpen, fMode, DNDURIOBJECT_FLAGS_NONE);225 , enmView, fOpen, fMode, SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE); 226 226 } 227 227 … … 234 234 * @param fOpen Open mode to use; only valid for file objects. 235 235 * @param fMode File mode to use; only valid for file objects. 236 * @param fFlags Additional DnDURI object flags.237 */ 238 int DnDURIObject::OpenEx(const RTCString &strPathAbs, View enmView,239 uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */, DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */)240 { 241 AssertReturn(!(fFlags & ~ DNDURIOBJECT_FLAGS_VALID_MASK), VERR_INVALID_FLAGS);236 * @param fFlags Additional Shared Clipboard URI object flags. 237 */ 238 int SharedClipboardURIObject::OpenEx(const RTCString &strPathAbs, View enmView, 239 uint64_t fOpen /* = 0 */, RTFMODE fMode /* = 0 */, SHAREDCLIPBOARDURIOBJECTFLAGS fFlags /* = SHAREDCLIPBOARDURIOBJECT_FLAGS_NONE */) 240 { 241 AssertReturn(!(fFlags & ~SHAREDCLIPBOARDURIOBJECT_FLAGS_VALID_MASK), VERR_INVALID_FLAGS); 242 242 RT_NOREF1(fFlags); 243 243 … … 328 328 * @param enmView View to use for querying information. Currently ignored. 329 329 */ 330 int DnDURIObject::queryInfoInternal(View enmView)330 int SharedClipboardURIObject::queryInfoInternal(View enmView) 331 331 { 332 332 RT_NOREF(enmView); … … 360 360 * @param enmView View to use for querying information. 361 361 */ 362 int DnDURIObject::QueryInfo(View enmView)362 int SharedClipboardURIObject::QueryInfo(View enmView) 363 363 { 364 364 return queryInfoInternal(enmView); … … 374 374 * @param strBaseNew New base path to rebase to. 375 375 * 376 ** @todo Put this into an own class like DnDURIPath : public RTCString?376 ** @todo Put this into an own class like SharedClipboardURIPath : public RTCString? 377 377 */ 378 378 /* static */ 379 int DnDURIObject::RebaseURIPath(RTCString &strPathAbs,379 int SharedClipboardURIObject::RebaseURIPath(RTCString &strPathAbs, 380 380 const RTCString &strBaseOld /* = "" */, 381 381 const RTCString &strBaseNew /* = "" */) … … 439 439 * @param pcbRead Pointer where to store how many bytes were read. Optional. 440 440 */ 441 int DnDURIObject::Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead)441 int SharedClipboardURIObject::Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead) 442 442 { 443 443 AssertPtrReturn(pvBuf, VERR_INVALID_POINTER); … … 495 495 * Resets the object's state and closes all related handles. 496 496 */ 497 void DnDURIObject::Reset(void)497 void SharedClipboardURIObject::Reset(void) 498 498 { 499 499 LogFlowThisFuncEnter(); … … 512 512 * Sets the bytes to process by the object. 513 513 * 514 * Note: Only applies if the object is of type DnDURIObject::Type_File.514 * Note: Only applies if the object is of type SharedClipboardURIObject::Type_File. 515 515 * 516 516 * @return IPRT return code. 517 517 * @param cbSize Size (in bytes) to process. 518 518 */ 519 int DnDURIObject::SetSize(uint64_t cbSize)519 int SharedClipboardURIObject::SetSize(uint64_t cbSize) 520 520 { 521 521 AssertReturn(m_enmType == Type_File, VERR_INVALID_PARAMETER); … … 535 535 * @param pcbWritten Pointer where to store how many bytes were written. Optional. 536 536 */ 537 int DnDURIObject::Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten)537 int SharedClipboardURIObject::Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten) 538 538 { 539 539 AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
Note:
See TracChangeset
for help on using the changeset viewer.