DnDURIList.cpp revision 82391de567696f10b21a762fde6a06fe3c266d28
/* $Id$ */
/** @file
* DnD: URI list class.
*/
/*
* Copyright (C) 2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/******************************************************************************
* Header Files *
******************************************************************************/
#ifdef LOG_GROUP
#endif
#define LOG_GROUP LOG_GROUP_GUEST_DND
DnDURIList::DnDURIList(void)
: m_cbTotal(0)
{
}
DnDURIList::~DnDURIList(void)
{
}
{
if (RT_FAILURE(rc))
return rc;
/*
* These are the types we currently support. Symlinks are not directly
* supported. First the guest could be an OS which doesn't support it and
* second the symlink could point to a file which is out of the base tree.
* Both things are hard to support. For now we just copy the target file in
* this case.
*/
return VINF_SUCCESS;
if (rc == VERR_IS_A_DIRECTORY)
rc = VINF_SUCCESS;
if (RT_FAILURE(rc))
return rc;
#ifdef DEBUG_andy
LogFlowFunc(("strHostPath=%s, strGuestPath=%s, fMode=0x%x, cbSize=%RU64, cbTotal=%zu\n",
#endif
/* We have to try to open even symlinks, cause they could
* be symlinks to directories. */
/* The following error happens when this was a symlink
* to an file or a regular file. */
if ( rc == VERR_PATH_NOT_FOUND
|| rc == VERR_NOT_A_DIRECTORY)
return VINF_SUCCESS;
if (RT_FAILURE(rc))
return rc;
while (RT_SUCCESS(rc))
{
if (RT_FAILURE(rc))
{
if (rc == VERR_NO_MORE_FILES)
rc = VINF_SUCCESS;
break;
}
{
case RTDIRENTRYTYPE_DIRECTORY:
{
/* Skip "." and ".." entries. */
break;
if (pszRecDir)
{
}
else
rc = VERR_NO_MEMORY;
break;
}
case RTDIRENTRYTYPE_SYMLINK:
case RTDIRENTRYTYPE_FILE:
{
if (pszNewFile)
{
/* We need the size and the mode of the file. */
if (RT_FAILURE(rc))
return rc;
if (RT_FAILURE(rc))
break;
#ifdef DEBUG_andy
LogFlowFunc(("strHostPath=%s, strGuestPath=%s, fMode=0x%x, cbSize=%RU64, cbTotal=%zu\n",
#endif
}
else
rc = VERR_NO_MEMORY;
break;
}
default:
break;
}
}
return rc;
}
{
#ifdef DEBUG_andy
#endif
int rc = VINF_SUCCESS;
/* Query the path component of a file URI. If this hasn't a
* file scheme NULL is returned. */
if (pszFilePath)
{
/* Add the path to our internal file list (recursive in
* the case of a directory). */
if (pszFileName)
{
if (pszNewURI)
{
fFlags);
}
}
}
else /* Just append the raw data. */
return rc;
}
{
int rc = VINF_SUCCESS;
{
if (RT_FAILURE(rc))
break;
}
return rc;
}
void DnDURIList::Clear(void)
{
m_cbTotal = 0;
}
void DnDURIList::RemoveFirst(void)
{
}