/** Searches for a config file in the command-line arguments, * environment, and finally in a default location. WARNING: * if no valid config file is found, the value of the result * parameter is unspecified! Always make sure to check the return * value! * @param argc Argument count * @param argv Argument list * @param result std::string reference to store the path, if any * @return true if a config file is found, false otherwise. */ bool findConfigFile(int argc, char** argv, string& result) { if ( checkArgs(argc, argv, result) ) return true; else if ( checkEnv(result) ) return true; else if ( checkDefault(result) ) return true; else return false; }
NS_IMETHODIMP nsMailGNOMEIntegration::IsDefaultClient(bool aStartupCheck, PRUint16 aApps, bool * aIsDefaultClient) { *aIsDefaultClient = true; if (aApps & nsIShellService::MAIL) *aIsDefaultClient &= checkDefault(sMailProtocols, NS_ARRAY_LENGTH(sMailProtocols)); if (aApps & nsIShellService::NEWS) *aIsDefaultClient &= checkDefault(sNewsProtocols, NS_ARRAY_LENGTH(sNewsProtocols)); if (aApps & nsIShellService::RSS) *aIsDefaultClient &= checkDefault(sFeedProtocols, NS_ARRAY_LENGTH(sFeedProtocols)); // If this is the first mail window, maintain internal state that we've // checked this session (so that subsequent window opens don't show the // default client dialog). if (aStartupCheck) mCheckedThisSession = true; return NS_OK; }
// ---------------------------------------------------------------------------- PCH #include "converter/smr2rdox/pch.h" // ----------------------------------------------------------------------- INCLUDES // ----------------------------------------------------------------------- SYNOPSIS #include "converter/smr2rdox/param.h" #include "simulator/runtime/rdo_resource.h" // -------------------------------------------------------------------------------- OPEN_RDO_CONVERTER_SMR2RDOX_NAMESPACE RDOParam::RDOParam(CREF(tstring) name, CREF(LPRDOTypeParam) pType, CREF(LPRDOValue) pDefault) : RDOParserSrcInfo(name ) , m_pType (pType ) , m_pDefault (pDefault ) { checkDefault(); } RDOParam::RDOParam(CREF(RDOParserSrcInfo) src_info, CREF(LPRDOTypeParam) pType, CREF(LPRDOValue) pDefault) : RDOParserSrcInfo(src_info) , m_pType (pType ) , m_pDefault (pDefault) { checkDefault(); } RDOParam::~RDOParam() {} void RDOParam::checkDefault() {