// // Gets command line arguments // void DrGetUtf8CommandArgs(int argc, wchar_t *wargv[], char ***pargv) { DrStr128 strArg; char **newArgv = NULL; // // increment count to account for tailing NULL // ++argc; // // If there are any command line args // if (argc > 0) { // // Create argument storage and verify that it's correctly created // newArgv = new char *[(size_t)argc]; LogAssert(newArgv != NULL); // // Foreach argument // for (int i = 0; i < argc; i++) { if (wargv[i] == NULL) { // // If NULL argument, store NULL // newArgv[i] = NULL; } else { // // Get argument value and verify that it's a valid string // strArg.Set( wargv[i] ); LogAssert(strArg.GetString() != NULL); // // Copy argument value into list // newArgv[i] = new char[strArg.GetLength() + 1]; LogAssert(newArgv[i] != NULL); memcpy(newArgv[i], strArg.GetString(), strArg.GetLength() + 1); } } } // // Store argument list (can be null if no arguments) // *pargv = newArgv; }
bool DoInitialize() { if (m_valid) { // We don't want perf counter files Counters::SetInitNoPerfFiles(); } // Register ourselves as the singleton config manager if (!m_valid || !Configuration::PreInitialize(this)) { DrLogA( "DryadConfigurationManager", "Failed to preinitialize dryad configuration manager"); m_valid = false; } if (m_valid) { if (!CommonInit(m_strIniFileName.GetString(), 0, -1 )) { DrLogA( "DryadConfigurationManager", "Failed to initialize dryad configuration manager"); m_valid = false; } } return m_valid; }