VirtualBoxErrorInfo.cpp revision 9ccca682f7c407bfcc51139868bbcb93887c16d4
/* $Id$ */
/** @file
* MS COM / XPCOM Abstraction Layer:
* VirtualBoxErrorInfo COM class implementation
*/
/*
* Copyright (C) 2008-2009 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "VBox/com/VirtualBoxErrorInfo.h"
#include <list>
namespace com
{
////////////////////////////////////////////////////////////////////////////////
// VirtualBoxErrorInfo class
////////////////////////////////////////////////////////////////////////////////
// public initializer/uninitializer for internal purposes only
////////////////////////////////////////////////////////////////////////////////
/**
* Initializes the error info object with the given error details.
*/
const char *aComponent,
{
return S_OK;
}
// IVirtualBoxErrorInfo properties
////////////////////////////////////////////////////////////////////////////////
{
if (!aResultCode)
return E_POINTER;
return S_OK;
}
{
if (!aIID)
return E_POINTER;
return S_OK;
}
{
if (!aComponent)
return E_POINTER;
return S_OK;
}
{
if (!aText)
return E_POINTER;
return S_OK;
}
{
if (!aNext)
return E_POINTER;
/* this will set aNext to NULL if mNext is null */
}
#if !defined(VBOX_WITH_XPCOM)
/**
* Initializes itself by fetching error information from the given error info
* object.
*/
{
/* We don't return a failure if talking to IErrorInfo fails below to
* protect ourselves from bad IErrorInfo implementations (the
* corresponding fields will simply remain null in this case). */
mResultCode = S_OK;
AssertComRC (rc);
AssertComRC (rc);
AssertComRC (rc);
return S_OK;
}
// IErrorInfo methods
////////////////////////////////////////////////////////////////////////////////
{
}
{
return rc;
}
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
{
}
#else // !defined(VBOX_WITH_XPCOM)
/**
* Initializes itself by fetching error information from the given error info
* object.
*/
{
/* We don't return a failure if talking to nsIException fails below to
* protect ourselves from bad nsIException implementations (the
* corresponding fields will simply remain null in this case). */
char *pszMsg;
if (NS_SUCCEEDED(rc))
{
}
else
return S_OK;
}
// nsIException methods
////////////////////////////////////////////////////////////////////////////////
/* readonly attribute string message; */
{
if (!aMessage)
return NS_ERROR_INVALID_POINTER;
return S_OK;
}
/* readonly attribute nsresult result; */
{
if (!aResult)
return NS_ERROR_INVALID_POINTER;
return rc;
}
/* readonly attribute string name; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute string filename; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute PRUint32 lineNumber; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute PRUint32 columnNumber; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsIStackFrame location; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsIException inner; */
{
}
/* readonly attribute nsISupports data; */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* string toString (); */
{
return NS_ERROR_NOT_IMPLEMENTED;
}
#endif /* !defined(VBOX_WITH_XPCOM) */
////////////////////////////////////////////////////////////////////////////////
// VirtualBoxErrorInfoGlue class
////////////////////////////////////////////////////////////////////////////////
// public initializer/uninitializer for internal purposes only
////////////////////////////////////////////////////////////////////////////////
/**
* Initializes the glue object with two given error info chains.
*
* @param aHead Chain placed to the beginning.
* @param aTail Chain placed to the end.
*/
{
do
{
break;
}
while (true);
{
/* simplest case */
return S_OK;
}
{
-- prev;
else
}
return S_OK;
}
/**
* Protected initializer that just sets the data fields as given.
*
* @param aReal Real error info object (not NULL) to forward calls to.
* @param aNext Next error info object (may be NULL).
*/
{
return S_OK;
}
// IVirtualBoxErrorInfo properties
////////////////////////////////////////////////////////////////////////////////
{
if (!aNext)
return E_POINTER;
/* this will set aNext to NULL if mNext is null */
}
#if defined (VBOX_WITH_XPCOM)
#endif /* defined (VBOX_WITH_XPCOM) */
} /* namespace com */