VFSExplorerImpl.cpp revision 15e9181ff43bf09ce40eaab73cee8c8492f99878
/* $Id$ */
/** @file
*
* IVFSExplorer COM class implementations.
*/
/*
* Copyright (C) 2009 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>
////////////////////////////////////////////////////////////////////////////////
//
// VFSExplorer definitions
//
////////////////////////////////////////////////////////////////////////////////
/* opaque private instance data of VFSExplorer class */
struct VFSExplorer::Data
{
struct DirEntry
{
};
};
: mVirtualBox(NULL)
{
}
{
}
/**
* VFSExplorer COM initializer.
* @param
* @return
*/
HRESULT VFSExplorer::init(VFSType_T aType, Utf8Str aFilePath, Utf8Str aHostname, Utf8Str aUsername, Utf8Str aPassword, VirtualBox *aVirtualBox)
{
/* 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
*/
{
if (!aPath)
return E_POINTER;
AutoCaller autoCaller(this);
return S_OK;
}
{
if (!aType)
return E_POINTER;
AutoCaller autoCaller(this);
*aType = m->storageType;
return S_OK;
}
struct VFSExplorer::TaskVFSExplorer
{
enum TaskType
{
};
{}
~TaskVFSExplorer() {}
int startThread();
/* task data */
};
{
"Explorer::Task");
return vrc;
}
/* static */
{
{
case TaskVFSExplorer::Update:
{
break;
}
case TaskVFSExplorer::Delete:
{
break;
}
}
return VINF_SUCCESS;
}
/* static */
{
if (pTask &&
{
if (fCanceled)
return -1;
}
return VINF_SUCCESS;
}
{
switch(aType)
{
default:
case RTDIRENTRYTYPE_UNKNOWN: t = VFSFileType_Unknown; break;
case RTDIRENTRYTYPE_FIFO: t = VFSFileType_Fifo; break;
case RTDIRENTRYTYPE_DEV_CHAR: t = VFSFileType_DevChar; break;
case RTDIRENTRYTYPE_DIRECTORY: t = VFSFileType_Directory; break;
case RTDIRENTRYTYPE_DEV_BLOCK: t = VFSFileType_DevBlock; break;
case RTDIRENTRYTYPE_FILE: t = VFSFileType_File; break;
case RTDIRENTRYTYPE_SYMLINK: t = VFSFileType_SymLink; break;
case RTDIRENTRYTYPE_SOCKET: t = VFSFileType_Socket; break;
case RTDIRENTRYTYPE_WHITEOUT: t = VFSFileType_WhiteOut; break;
}
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))
}
}
{
}
return VINF_SUCCESS;
}
{
AutoCaller autoCaller(this);
try
{
int vrc = RTS3Create(&hS3, m->strUsername.c_str(), m->strPassword.c_str(), m->strHostname.c_str(), "virtualbox-agent/"VBOX_VERSION_STRING);
if (RT_FAILURE(vrc))
/* Do we need the list of buckets or keys? */
{
if (RT_FAILURE(vrc))
while (pBuckets)
{
}
}
else
{
if (RT_FAILURE(vrc))
while (pKeys)
{
}
}
}
{
}
/* Assign the result on success (this clears the old list) */
return VINF_SUCCESS;
}
{
AutoCaller autoCaller(this);
try
{
int vrc = RTS3Create(&hS3, m->strUsername.c_str(), m->strPassword.c_str(), m->strHostname.c_str(), "virtualbox-agent/"VBOX_VERSION_STRING);
if (RT_FAILURE(vrc))
size_t i = 0;
++it, ++i)
{
if (RT_FAILURE(vrc))
}
}
{
}
return VINF_SUCCESS;
}
{
AutoCaller autoCaller(this);
try
{
/* Create the progress object */
TRUE /* aCancelable */);
/* Initialize our worker task */
/* Don't destruct on success */
}
{
}
/* Return progress to the caller */
return rc;
}
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
STDMETHODIMP VFSExplorer::EntryList(ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(VFSFileType_T, aTypes))
{
if (ComSafeArrayOutIsNull(aNames) ||
return E_POINTER;
AutoCaller autoCaller(this);
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;
}