VFSExplorerImpl.cpp revision b10a13ee0c4f4df2aa7cf2b164f0073fbd42e93c
/* $Id$ */
/** @file
*
* IVFSExplorer COM class implementations.
*/
/*
* Copyright (C) 2009-2013 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.
*/
#include "VFSExplorerImpl.h"
#include "VirtualBoxImpl.h"
#include "ProgressImpl.h"
#include "AutoCaller.h"
#include "Logging.h"
#include <memory>
struct VFSExplorer::Data
{
struct DirEntry
{
};
};
: mVirtualBox(NULL)
{
}
{
}
/**
* VFSExplorer COM initializer.
* @param
* @return
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
/* Weak reference to a VirtualBox object */
/* initialize data */
m = new Data;
m->storageType = aType;
m->strHostname = aHostname;
m->strUsername = aUsername;
m->strPassword = aPassword;
if (m->storageType == VFSType_S3)
{
{
}
}
/* Confirm a successful initialization */
return S_OK;
}
/**
* VFSExplorer COM uninitializer.
* @return
*/
void VFSExplorer::uninit()
{
delete m;
m = NULL;
}
/**
* Public method implementation.
* @param
* @return
*/
{
return S_OK;
}
{
if (!aType)
return E_POINTER;
*aType = m->storageType;
return S_OK;
}
struct VFSExplorer::TaskVFSExplorer
{
enum TaskType
{
};
{}
~TaskVFSExplorer() {}
int startThread();
/* task data */
};
{
"Explorer::Task");
if (RT_FAILURE(vrc))
return VFSExplorer::setErrorStatic(E_FAIL, Utf8StrFmt("Could not create taskThreadVFS (%Rrc)\n", vrc));
return vrc;
}
/* static */
{
{
case TaskVFSExplorer::Update:
{
#ifdef VBOX_WITH_S3
#else
#endif
break;
}
case TaskVFSExplorer::Delete:
{
#ifdef VBOX_WITH_S3
#else
#endif
break;
}
default:
break;
}
return VINF_SUCCESS;
}
/* static */
{
if (pTask &&
{
if (fCanceled)
return -1;
}
return VINF_SUCCESS;
}
{
int a = aType & RTFS_TYPE_MASK;
if ((a & RTFS_TYPE_DIRECTORY) == RTFS_TYPE_DIRECTORY)
else if ((a & RTFS_TYPE_FILE) == RTFS_TYPE_FILE)
t = VFSFileType_File;
else if ((a & RTFS_TYPE_SYMLINK) == RTFS_TYPE_SYMLINK)
t = VFSFileType_SymLink;
else if ((a & RTFS_TYPE_FIFO) == RTFS_TYPE_FIFO)
t = VFSFileType_Fifo;
else if ((a & RTFS_TYPE_DEV_CHAR) == RTFS_TYPE_DEV_CHAR)
t = VFSFileType_DevChar;
else if ((a & RTFS_TYPE_DEV_BLOCK) == RTFS_TYPE_DEV_BLOCK)
t = VFSFileType_DevBlock;
else if ((a & RTFS_TYPE_SOCKET) == RTFS_TYPE_SOCKET)
t = VFSFileType_Socket;
else if ((a & RTFS_TYPE_WHITEOUT) == RTFS_TYPE_WHITEOUT)
t = VFSFileType_WhiteOut;
return t;
}
{
AutoCaller autoCaller(this);
try
{
if (RT_FAILURE(vrc))
while (RT_SUCCESS(vrc))
{
if (RT_SUCCESS(vrc))
{
if ( name != "."
&& name != "..")
}
}
}
{
}
/* Clean up */
if (pszPath)
if (pDir)
/* Assign the result on success (this clears the old list) */
return VINF_SUCCESS;
}
{
AutoCaller autoCaller(this);
try
{
char szPath[RTPATH_MAX];
size_t i = 0;
++it, ++i)
{
if (RT_FAILURE(vrc))
if (RT_FAILURE(vrc))
}
}
{
}
return VINF_SUCCESS;
}
#ifdef VBOX_WITH_S3
{
AutoCaller autoCaller(this);
try
{
if (RT_FAILURE(vrc))
/* Do we need the list of buckets or keys? */
{
if (RT_FAILURE(vrc))
while (pBuckets)
{
0, RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR));
}
}
else
{
if (RT_FAILURE(vrc))
while (pKeys)
{
}
}
}
{
}
/* Assign the result on success (this clears the old list) */
return VINF_SUCCESS;
}
{
AutoCaller autoCaller(this);
try
{
if (RT_FAILURE(vrc))
size_t i = 0;
++it, ++i)
{
if (RT_FAILURE(vrc))
}
}
{
}
return VINF_SUCCESS;
}
#endif /* VBOX_WITH_S3 */
{
try
{
/* Create the progress object */
static_cast<IVFSExplorer*>(this),
progressDesc.raw(),
TRUE /* aCancelable */);
/* Initialize our worker task */
/* Don't destruct on success */
}
{
}
/* Return progress to the caller */
return rc;
}
{
}
{
{
/* Remove lowest dir entry in a platform neutral way. */
}
}
{
size_t i = 0;
++it, ++i)
{
}
return S_OK;
}
{
AutoCaller autoCaller(this);
{
++it)
{
}
}
return S_OK;
}
{
AutoCaller autoCaller(this);
try
{
/* Create the progress object */
TRUE /* aCancelable */);
/* Initialize our worker task */
/* Add all filenames to delete as task data */
/* Don't destruct on success */
}
{
}
/* Return progress to the caller */
return rc;
}