本文整理汇总了C++中nsCOMPtr::GetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ nsCOMPtr::GetInt方法的具体用法?C++ nsCOMPtr::GetInt怎么用?C++ nsCOMPtr::GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsCOMPtr
的用法示例。
在下文中一共展示了nsCOMPtr::GetInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetProxyResult
nsresult
nsUnixSystemProxySettings::SetProxyResultFromGConf(const char* aKeyBase, const char* aType,
nsACString& aResult)
{
nsAutoCString hostKey;
hostKey.AppendASCII(aKeyBase);
hostKey.AppendLiteral("host");
nsAutoCString host;
nsresult rv = mGConf->GetString(hostKey, host);
NS_ENSURE_SUCCESS(rv, rv);
if (host.IsEmpty())
return NS_ERROR_FAILURE;
nsAutoCString portKey;
portKey.AppendASCII(aKeyBase);
portKey.AppendLiteral("port");
int32_t port;
rv = mGConf->GetInt(portKey, &port);
NS_ENSURE_SUCCESS(rv, rv);
/* When port is 0, proxy is not considered as enabled even if host is set. */
if (port == 0)
return NS_ERROR_FAILURE;
SetProxyResult(aType, host, port, aResult);
return NS_OK;
}
示例2: SetProxyResult
nsresult
nsUnixSystemProxySettings::SetProxyResultFromGConf(const char* aKeyBase, const char* aType,
nsACString& aResult)
{
nsCAutoString hostKey;
hostKey.AppendASCII(aKeyBase);
hostKey.AppendLiteral("host");
nsCAutoString host;
nsresult rv = mGConf->GetString(hostKey, host);
NS_ENSURE_SUCCESS(rv, rv);
if (host.IsEmpty())
return NS_ERROR_FAILURE;
nsCAutoString portKey;
portKey.AppendASCII(aKeyBase);
portKey.AppendLiteral("port");
PRInt32 port;
rv = mGConf->GetInt(portKey, &port);
NS_ENSURE_SUCCESS(rv, rv);
SetProxyResult(aType, host, port, aResult);
return NS_OK;
}