/** Returns the root of the directory the system wants us to store user config data in */ static std::string GetAppSettingsPath()
{ #ifdefined( WIN32 )
WCHAR rwchPath[MAX_PATH];
// make sure the directory we're writing into actually exists
std::string sRegDirectory = Path_StripFilename( sRegPath ); if( !BCreateDirectoryRecursive( sRegDirectory.c_str() ) )
{
VRLog( "Unable to create path registry directory %s\n", sRegDirectory.c_str() ); returnfalse;
}
if( !Path_WriteStringToTextFile( sRegPath, sRegistryContents.c_str() ) )
{
VRLog( "Unable to write VR path registry to %s\n", sRegPath.c_str() ); returnfalse;
}
returntrue;
}
// --------------------------------------------------------------------------- // Purpose: Returns the current runtime path or NULL if no path is configured. // ---------------------------------------------------------------------------
std::string CVRPathRegistry_Public::GetRuntimePath() const
{ if( m_vecRuntimePath.empty() ) return""; else return m_vecRuntimePath.front().c_str();
}
// --------------------------------------------------------------------------- // Purpose: Returns the current config path or NULL if no path is configured. // ---------------------------------------------------------------------------
std::string CVRPathRegistry_Public::GetConfigPath() const
{ if( m_vecConfigPath.empty() ) return""; else return m_vecConfigPath.front().c_str();
}
// --------------------------------------------------------------------------- // Purpose: Returns the current log path or NULL if no path is configured. // ---------------------------------------------------------------------------
std::string CVRPathRegistry_Public::GetLogPath() const
{ if( m_vecLogPath.empty() ) return""; else return m_vecLogPath.front().c_str();
}
// --------------------------------------------------------------------------- // Purpose: Returns paths using the path registry and the provided override // values. Pass NULL for any paths you don't care about. // --------------------------------------------------------------------------- bool CVRPathRegistry_Public::GetPaths( std::string *psRuntimePath, std::string *psConfigPath, std::string *psLogPath, constchar *pchConfigPathOverride, constchar *pchLogPathOverride, std::vector<std::string> *pvecExternalDrivers )
{
std::string sLoadError;
CVRPathRegistry_Public pathReg; bool bLoadedRegistry = pathReg.BLoadFromFile( &sLoadError ); int nCountEnvironmentVariables = 0; int nRequestedPaths = 0;
if ( pvecExternalDrivers )
{
*pvecExternalDrivers = pathReg.m_vecExternalDrivers;
}
if ( nCountEnvironmentVariables == nRequestedPaths )
{ // all three environment variables were set, so we don't need the physical file returntrue;
} elseif( !bLoadedRegistry )
{
VRLog( "%s\n", sLoadError.c_str() );
}
return bLoadedRegistry;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.