/** * @brief Set new value for option. * @param [in] name Option's name. * @param [in] value Option's new value. */ int COptionsMgr::Set(const String& name, const varprop::VariantValue& value) { int retVal = COption::OPT_OK; OptionsMap::const_iterator found = m_optionsMap.find(name); if (found != m_optionsMap.end()) { // Allow automatic conversion so we don't bother callsites about this! COption tmpOption = found->second; retVal = tmpOption.Set(value, true); if (retVal == COption::OPT_OK) m_optionsMap[name] = tmpOption; } else { retVal = COption::OPT_NOTFOUND; } return retVal; }
/** * @brief Set new value for option. * @param [in] name Option's name. * @param [in] value Option's new value. */ int COptionsMgr::Set(LPCTSTR name, varprop::VariantValue value) { int retVal = OPT_OK; OptionsMap::const_iterator found = m_optionsMap.find(name); if (found != m_optionsMap.end()) { // Allow automatic conversion so we don't bother callsites about this! COption tmpOption = found->second; retVal = tmpOption.Set(value, true); if (retVal == OPT_OK) m_optionsMap[name] = tmpOption; } else { _RPTF1(_CRT_ERROR, "Could not set option: %s", name); retVal = OPT_NOTFOUND; } return retVal; }