VirtualBoxImplExtra.cpp revision b667eae0e8c210aaefcb7a6b72548945f2238c52
/** @file
*
* VirtualBox COM class implementation extra definitions
*
* This file pulls in generated entities that may be rather big but rarely
* changed. Separating them from VirtualBoxImpl.cpp should speed up
* compilation a bit.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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 "VirtualBoxImpl.h"
#include "VirtualBoxXMLUtil.h"
/* embedded XML Schema documents for validating XML settings files */
#include "xml_VirtualBox_settings_xsd.h"
#include "xml_VirtualBox_settings_common_xsd.h"
/* embedded settings converter template for updating settings files */
#include "xml_SettingsConverter_xsl.h"
/**
* Resolves external entities while parting and validating XML settings files.
*
* @param aURI URI of the external entity.
* @param aID ID of the external entity (may be NULL).
*
* @return Input stream created using @c new or NULL to indicate
*/
{
{
return new settings::
MemoryBuf ((const char *) g_ab_xml_VirtualBox_settings_common_xsd,
}
{
return new settings::
MemoryBuf ((const char *) g_ab_xml_VirtualBox_settings_xsd,
}
{
return new settings::
MemoryBuf ((const char *) g_ab_xml_SettingsConverter_xsl,
}
return NULL;
}
/**
* Returns @true if the given tree needs to be converted using the XSLT
* template identified by #templateUri(), or @false if no conversion is
* required.
*
* The implementation normally checks for the "version" value of the
* root key to determine if the conversion is necessary. The
* implementation must return a string representing the old version
* (before conversion) in the @c aOldVersion argument -- this string is
* used by XmlTreeBackend::oldVersion() and must be non-NULL to indicate
* that the conversion has been performed on the tree. The returned
* string must be allocated using RTStrDup or such.
*
* @param aRoot Root settings key.
* @param aOldVersionString Old version string (allocated by
* RTStrDup or such).
*/
bool VirtualBox::SettingsTreeHelper::
{
{
{
{
/* version mismatch */
return true;
}
}
}
/* either the tree is invalid, or it's the other platform, or it's the same
* version */
return false;
}
/**
* Returns the URI of the XSLT template to perform the conversion.
* This template will be applied to the tree if #needsConversion()
* returns @c true for this tree.
*/
{
return VBOX_XML_SETTINGS_CONVERTER;
}