当前位置: 首页>>代码示例>>C++>>正文


C++ THTTPHdrVal::SetInt方法代码示例

本文整理汇总了C++中THTTPHdrVal::SetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ THTTPHdrVal::SetInt方法的具体用法?C++ THTTPHdrVal::SetInt怎么用?C++ THTTPHdrVal::SetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在THTTPHdrVal的用法示例。


在下文中一共展示了THTTPHdrVal::SetInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckAndSetSessionSettingsL

void CPipeliningConfigTest::CheckAndSetSessionSettingsL(RHTTPSession aSession)
{
    RStringPool stringPool = aSession.StringPool();
    RHTTPConnectionInfo sessionSettings = aSession.ConnectionInfo();

    if (iMaxNumberTransactionsToPipeline > 0)
    {
        RStringF maxToPipelineSetting = stringPool.StringF(HTTP::EMaxNumTransactionsToPipeline,
                                        aSession.GetTable());
        THTTPHdrVal value;
        if (sessionSettings.Property(maxToPipelineSetting, value) == EFalse)
        {
            value.SetInt(iMaxNumberTransactionsToPipeline);
            sessionSettings.SetPropertyL(maxToPipelineSetting,value);
        }
    }


    if (iMaxNumberTransportHandlers > 0)
    {
        RStringF maxTransportHandlers = stringPool.StringF(HTTP::EMaxNumTransportHandlers,
                                        aSession.GetTable());
        THTTPHdrVal value;
        if (sessionSettings.Property(maxTransportHandlers, value) == EFalse)
        {
            value.SetInt(iMaxNumberTransportHandlers);
            sessionSettings.SetPropertyL(maxTransportHandlers,value);
        }
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:30,代码来源:cpipeliningconfigtest.cpp

示例2: DecodeWellKnownParamTokenL

void CWspHeaderReader::DecodeWellKnownParamTokenL(TWspPrimitiveDecoder& aDecoder, TInt& aBytesRead,
												  TPtrC8& aRawParamBlock, CHeaderFieldPart& aHeaderFieldPart) const
	{
	TInt err = 0;
	TUint32 parameterToken = 0;
	aBytesRead = aDecoder.Integer(parameterToken);
	THTTPHdrVal paramValue;
	RStringF paramDesValue;
	CleanupClosePushL(paramDesValue);
	RStringF paramName = iStrPool.StringF(parameterToken, WSPParam::Table);
	switch( parameterToken )
		{
		case WSPParam::EQ:
			{
			// Decode Q value
			TUint32 qIntValue = 0;
			err = aDecoder.UintVar(qIntValue);
			User::LeaveIfError(err);
			aBytesRead += err;
			TReal q;
			TInt numDecimals = 0;
			TBuf8<KMaxNumQDigits> qDesC;
			if( qIntValue > 100 )
				{
				// Value is -100 and then divide by 1000
				qIntValue -= 100;
				q = ((TReal)(qIntValue/1000.));
				numDecimals = 3;
				}
			else
				{
				// Value is -1 and then divide by 100
				--qIntValue;
				if( qIntValue%10 ==0 )
					numDecimals = 1;
				else
					numDecimals = 2;
				q = ((TReal)(qIntValue/100.));
				}
			TRealFormat realFt(KMaxNumQDigits,numDecimals); // set max width and 3 decimal places
			// always use a decimal separator rather than the one supplied 
			// by the current locale
			realFt.iPoint = TChar('.'); 
			qDesC.Num(q, realFt);
			paramDesValue = iStrPool.OpenFStringL(qDesC);
			paramValue.SetStrF(paramDesValue);
			} break;
		case WSPParam::ECharset:
			{
			if( aRawParamBlock[aBytesRead] == 128 )
				{
				paramDesValue = iStrPool.StringF(WSPStdConstants::EAny, WSPStdConstants::Table);
				paramValue.SetStrF(paramDesValue);
				// Need to call Integer to update offset in WSP Decoder
				TUint8 updateDecoder =  0;
				err = aDecoder.Val7Bit(updateDecoder);
				User::LeaveIfError(err);
				aBytesRead += err;
				}
			else
				{
				switch( aDecoder.VarType() )
					{
					case TWspPrimitiveDecoder::E7BitVal:
					case TWspPrimitiveDecoder::ELengthVal:
						{
						TUint32 value = 0;
						err = aDecoder.Integer(value);
						User::LeaveIfError(err);
						aBytesRead += err;
						GetCharacterSetFromValueL(value, paramDesValue);
						paramValue.SetStrF(paramDesValue);
						} break;
					default:
						User::Leave(KErrCorrupt);
						break;
					}
				}
			} break;
		case WSPParam::ELevel:
			{
			// This is a version value
			err = aDecoder.VersionL(iStrPool,paramDesValue);
			User::LeaveIfError(err);
			aBytesRead += err;
			paramValue.SetStrF(paramDesValue);
			} break;
		case WSPParam::EType:
		case WSPParam::ESize:
		case WSPParam::EPadding:
		case WSPParam::ESEC:
		case WSPParam::EMaxAge:
			{
			TUint32 integerValue = 0;
			err = aDecoder.Integer(integerValue);
			User::LeaveIfError(err);
			aBytesRead += err;
			paramValue.SetInt(integerValue);
			} break;
		case WSPParam::ECreationDate:
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:101,代码来源:CWspHeaderReader.cpp


注:本文中的THTTPHdrVal::SetInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。