errorprint.cpp revision c58f1213e628a545081c70e26c6b67a841cff880
/* $Id$ */
/** @file
* MS COM / XPCOM Abstraction Layer:
* Error info print helpers. This implements the shared code from the macros from errorprint.h.
*/
/*
* Copyright (C) 2009-2012 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 <ProgressImpl.h>
namespace com
{
{
bool haveResultCode = false;
#if defined (RT_OS_WIN)
bool haveComponent = true;
bool haveInterfaceID = true;
#else /* defined (RT_OS_WIN) */
haveResultCode = true;
#endif
if (!bstrDetailsText.isEmpty())
bstrDetailsText.raw());
if (haveResultCode)
info.getResultCode()));
if (haveComponent)
if (haveInterfaceID)
{
str += "Details: ";
str += "\n";
}
// print and log
}
{
// pcszSourceFile comes from __FILE__ macro, which always contains the full path,
// which we don't want to see printed:
strFilename.c_str());
// print and log
}
{
// print and log
}
const char *pcszContext,
const char *pcszSourceFile,
{
{
do
{
/* If there is more than one error, separate them visually. */
if (pInfo)
{
/* If there are several errors then at least basic error
* information must be available, otherwise something went
* horribly wrong. */
RTMsgError("--------\n");
}
}
while (pInfo);
}
else
}
const char *pcszContext,
const char *pcszSourceFile,
{
/* If we have full error info, print something nice, and start with the
* actual error message. */
rc,
ulLine);
}
const char *pcszContext,
const char *pcszSourceFile,
{
/* Get the error info out of the progress object. */
rc,
ulLine);
}
} /* namespace com */