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


C++ TBuf8::Num方法代码示例

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


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

示例1: WriteToFile

// ----------------------------------------------------------------------------------------
// CFMSServer::WriteToFile() 
// ----------------------------------------------------------------------------------------
void CFMSServer::WriteToFile(TInt aReason, TInt aBearer,TDriveNumber aDrive,
		TInt aSize, TBool aWcdmaBearer )
	{
	if(iSessionCount == 0)
		{
		FLOG(_L("CFMSServer::WriteToFile- begin"));
		TInt err=iFile.Open(iFs,KFotaInterruptFileName,EFileWrite);
		if(err == KErrNone)
			{
			FLOG(_L("CFMSServer::WriteToFile--passed"));
			TBuf8<30> data;//size 30 or 32--as args is 16 bytes
			TBuf8<30> temp;
			temp.Num(aReason);
			data.Append(temp);
			data.Append(',');
			temp.Num(aBearer);// or use iFMSinterruptAob's iBearer
			data.Append(temp);
			data.Append(',');
			temp.Num((TInt)aDrive);
			data.Append(temp);
			data.Append(',');
			temp.Num(aSize);  
			data.Append(temp);
			data.Append(',');
			temp.Num(aWcdmaBearer);
			data.Append(temp);
			iFile.Write(data);
			iFile.Close();
			}
		else
			FLOG(_L("CFMSServer::WriteToFile- Failed"));
		}
	else
		FLOG(_L("CFMSServer::WriteToFile- not done as another request is there"));
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:38,代码来源:fmsserver.cpp

示例2: IconLookUp

// ---------------------------------------------------------------------------------
// CUpnpTmFilteredAppList::IconLookUp
// Performs the icon look up
// Checks if the requested icon and given icon matches
// @param aIcon Reference to the Terminal Mode Icon object
// @return Returns boolean value(true or false)
// ---------------------------------------------------------------------------------
//
TBool CUpnpTmFilteredAppList::IconLookUp( CUpnpTerminalModeIcon& aIcon  )
    {
    OstTraceFunctionEntry0( CUPNPTMFILTEREDAPPLIST_ICONLOOKUP_ENTRY );
    TBool matchFound(EFalse);
    const TDesC8& filterMimeType = iFilterInfo->MimeType();
    const TDesC8& filterWidth = iFilterInfo->Width();
    const TDesC8& filterHeight = iFilterInfo->Height();
    const TDesC8& filterDepth = iFilterInfo->Depth(); 

    // Check whether the icon is meant to be used only at launch time
    TBuf8<UpnpString::KShortStringLength> widthBuf;
    widthBuf.Num(aIcon.Width());
    TBuf8<UpnpString::KShortStringLength> heightBuf;
    heightBuf.Num(aIcon.Height());
    TBuf8<UpnpString::KShortStringLength> depthBuf;
    depthBuf.Num(aIcon.Depth());
    /* Check if the icon in provided in the input filter string, and if so
       then does it match with the desired icon ( type and dimension ) */
    if ( (( filterMimeType.Length() == 0 ) ||( (aIcon.MimeType()).MatchC(filterMimeType) != KErrNotFound))
         && (( filterWidth.Length() == 0 ) ||( widthBuf.MatchC(filterWidth) != KErrNotFound))
         && (( filterHeight.Length() == 0 ) ||( heightBuf.MatchC(filterHeight) != KErrNotFound))
         && (( filterDepth.Length() == 0 ) ||( depthBuf.MatchC(filterDepth) != KErrNotFound)))
            {
            matchFound = ETrue;
            }
    OstTraceFunctionExit0( CUPNPTMFILTEREDAPPLIST_ICONLOOKUP_EXIT );
    return matchFound;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:36,代码来源:upnptmfilteredapplist.cpp

示例3: UpdateLogEventParam

TInt CEventLogger::UpdateLogEventParam(CLogEvent& aLogEvent, TInt aRConnectionStatusId, const TUid& aDataEventType, const TInt64& aBytesSent, const TInt64& aBytesReceived)
{

    TTime time;
    TInt ret =KErrNone;
    time.UniversalTime();
    TTimeIntervalSeconds interval(0);
    if (time.SecondsFrom(iCurrentLogEvent->Time(),interval) != KErrNone)
    {
        interval = 0;	// no duration available ->error
    }
    if (KConnectionStatusIdNotAvailable != aRConnectionStatusId)
    {
        //status needs to be updated
        TBuf<KLogMaxStatusLength > logStatusBuf;
        iLogWrap->Log().GetString(logStatusBuf, aRConnectionStatusId); // Ignore error - string blank on error which is ok
        aLogEvent.SetStatus(logStatusBuf);
    }
    if ( aDataEventType != TUid::Null())
    {
        aLogEvent.SetEventType(aDataEventType);
    }
    aLogEvent.SetDuration(interval.Int());		//0 or not
    //check if data metrics need to be updated
    TInt64 byteInfoNotAvailable(KBytesInfoNotAvailable);
    if ((aBytesReceived != byteInfoNotAvailable) && (aBytesSent != byteInfoNotAvailable))
    {
        TBuf8<KDatabufferSize> dataBuffer;
        dataBuffer.Num(aBytesSent);
        dataBuffer.Append(TChar(','));
        dataBuffer.AppendNum(aBytesReceived);
        TRAP(ret, aLogEvent.SetDataL(dataBuffer));
    }
    return ret;
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:35,代码来源:EventLogger.cpp

示例4: SetIntPropertyL

TInt CSenLayeredXmlProperties::SetIntPropertyL(const TDesC8& aName,
                                               const TInt aValue)
    {
    TBuf8<KFlatBufSize> buffer;
    buffer.Num(aValue);
    return SetPropertyL(aName, buffer);
    }
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:7,代码来源:senlayeredxmlproperties.cpp

示例5: FetchLeafObjectSizeL

// -----------------------------------------------------------------------------
//  CNSmlDmDevDetailAdapter::FetchLeafObjectSizeL( const TDesC8& aURI, 
// const TDesC8& aLUID, const TDesC8& aType, const TInt aResultsRef, 
// const TInt aStatusRef )
// -----------------------------------------------------------------------------
void CNSmlDmDevDetailAdapter::FetchLeafObjectSizeL( const TDesC8& aURI, 
                                                    const TDesC8& /*aLUID*/, 
                                                    const TDesC8& aType, 
                                                    const TInt aResultsRef, 
                                                    const TInt aStatusRef )
    {
    _DBG_FILE("CNSmlDmDevDetailAdapter::FetchLeafObjectSizeL(): begin");

    CBufBase *object = CBufFlat::NewL( 1 );
    CleanupStack::PushL( object );
    CSmlDmAdapter::TError retValue = FetchLeafObjectL( aURI, *object );

    TInt objSizeInBytes = object->Size();
    TBuf8<KNSmlMaxSizeBufferLength> stringObjSizeInBytes;
    stringObjSizeInBytes.Num( objSizeInBytes );
    object->Reset();
    object->InsertL( 0, stringObjSizeInBytes );
    
    iDmCallback->SetStatusL( aStatusRef, retValue );
    iDmCallback->SetResultsL( aResultsRef, *object, aType);
    CleanupStack::PopAndDestroy(); //object 

            
    _DBG_FILE("CNSmlDmDevDetailAdapter::FetchLeafObjectSizeL(): end");
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:30,代码来源:nsmldmdevdetailadapter.cpp

示例6: SaveSettingL

void CSTPreferences::SaveSettingL(RFile& aFile, const TDesC8& aSettingName, const TDesC& aSettingValue)
{
	aFile.Write(aSettingName);
	aFile.Write(KLit8Colon);
	
	
	HBufC8* encodedSettingValue = ConvertToUtf8L(aSettingValue);
	if (encodedSettingValue)
	{
		CleanupStack::PushL(encodedSettingValue);
		
		TBuf8<16> settingLength;
		settingLength.Num(encodedSettingValue->Length());
		aFile.Write(settingLength);
		
		aFile.Write(KLit8EqualSign);
		aFile.Write(*encodedSettingValue);
		CleanupStack::PopAndDestroy(); // encodedSettingValue
	}
	else
	{
		_LIT8(KLit8Unset, "0=");
		aFile.Write(KLit8Unset);
	}
	
	aFile.Write(KLit8EndLine);
}
开发者ID:Nokia700,项目名称:SymTorrent,代码行数:27,代码来源:STPreferences.cpp

示例7: WriteDescription

void CRightsCriteriaCount::WriteDescription(RFile& aFile)
	{
	TBuf8 <10> count;
	count.Num(iCount);
	aFile.Write(_L8("Count = "));
	aFile.Write(count);
	aFile.Write(_L8("\r\n"));
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:8,代码来源:rightscriteriacount.cpp

示例8: SetParamL

// -----------------------------------------------------------------------------
// CSIPParamContainerBase::SetParamL
// -----------------------------------------------------------------------------
//
void CSIPParamContainerBase::SetParamL(RStringF aName, TReal aValue)
	{
	TBuf8<KMaxNumericValueAsTextLength> valueAsText;
	TRealFormat format;
	const TChar KDotChr = '.';
	format.iPoint = KDotChr; // SIP uses always dot as a decimal point
	User::LeaveIfError(valueAsText.Num(aValue,format));
	SetParamL(aName, valueAsText);
	}	
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:13,代码来源:CSIPParamContainerBase.cpp

示例9: AttachRefIdL

// -----------------------------------------------------------------------------
// CUpnpObjectBean::AttachRefIdL
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CUpnpObjectBean::AttachRefIdL(TXmlEngElement aElement)
{
    if(ObjRefId() != CUpnpObjectBean::KUndef)
    {
        TBuf8<KMaxIntegerLen> num;
        num.Num(ObjRefId());
        aElement.AddNewAttributeL( KRefID(), num );
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:14,代码来源:upnpobjectbean.cpp

示例10: SendRequestL

void CHttpController::SendRequestL( TInt aMethodIndex, const TDesC8& aUri, CHttpHeaders* aHeaders )
	{
	if ( !iObserver )
		{
		User::Leave( KErrHttpInvalidObserver );
		}
	RStringF method = iSession.StringPool().StringF( aMethodIndex, RHTTPSession::GetTable() );

	TUriParser8 uri;
	uri.Parse( aUri );
	iTransaction = iSession.OpenTransactionL( uri, *this, method );
	RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();

	RArray< TInt > addedElements;
	CleanupClosePushL( addedElements );

	SetHeaderL( HTTP::EUserAgent, hdr, KUserAgent, addedElements );
	SetHeaderL( HTTP::EConnection, hdr, KClose, addedElements );
	SetHeaderL( HTTP::EAccept, hdr, KAccept, addedElements );
	SetHeaderL( HTTP::EHost, hdr, uri.Extract( EUriHost ), addedElements );

	TInt count( iPersistentHeaders->Count() );
	for ( TInt i( 0 ); i < count; ++i )
		{
		if ( addedElements.FindInOrder( i ) >= 0 )
			{
			continue;
			}
		SetHeaderL( hdr, iPersistentHeaders->Key( i ), iPersistentHeaders->Value( i ) );
		}

	CleanupStack::PopAndDestroy( &addedElements );
	if ( aHeaders )
		{
		TInt count( aHeaders->Count() );
		for ( TInt i( 0 ); i < count; ++i )
			{
			SetHeaderL( hdr, aHeaders->Key( i ), aHeaders->Value( i ) );
			}
		}

	if ( aMethodIndex == HTTP::EPOST )
		{
		const TInt KMaxContentLenBufferLength = 100;
		TBuf8< KMaxContentLenBufferLength > contentLength;
		contentLength.Num( iOutputEncoder->OverallDataSize() );
		SetHeaderL( hdr, HTTP::EContentLength, contentLength );
		SetHeaderL( hdr, HTTP::EContentType, KUrlEncodedContentType );
		iTransaction.Request().SetBody( *iOutputEncoder );
		}
	iTransaction.SubmitL();
	StartTimeout();
	iState = EHttpActive;
	}
开发者ID:Symbian9,项目名称:symbian-http-engine,代码行数:54,代码来源:HttpController.cpp

示例11: CreatePatchDataL

HBufC8* CPolicyPatcher::CreatePatchDataL(const CPolicyPatchInfo* aPatchInfo)
    {
    TInt patchDataLength = 0;

    TBuf8<20> keyBuf;

    const TDesC8& certSubjectName = aPatchInfo->CertSubjectName();

    if (0 == aPatchInfo->UserCertKeyLen())
        {
        // CA cert patch
        patchDataLength = KName().Length() + KNewLine().Length() +
                          KDataField().Length() + KSpace().Length() +
                          certSubjectName.Length();
        }
    else
        {
        // user cert patch
        keyBuf.Num(aPatchInfo->UserCertKeyLen());
        patchDataLength = KDNField().Length() + certSubjectName.Length() +
                          KNewLine().Length() + KKeyLenField().Length() +
                          keyBuf.Length();
        }

    HBufC8* patchData = HBufC8::NewL(patchDataLength);
    CleanupStack::PushL(patchData);

    TPtr8 ptrPatchData(patchData->Des());

    if (0 == aPatchInfo->UserCertKeyLen())
        {
        // CA cert patch
        ptrPatchData.Append(KName);
        ptrPatchData.Append(KNewLine);
        ptrPatchData.Append(KDataField);
        ptrPatchData.Append(KSpace);
        ptrPatchData.Append(certSubjectName);
        }
    else
        {
        // User cert patch
        ptrPatchData.Append(KKeyLenField);
        ptrPatchData.Append(keyBuf);
        ptrPatchData.Append(KNewLine);
        ptrPatchData.Append(KDNField);
        ptrPatchData.Append(certSubjectName);
        iUserCertPatched = ETrue;
        }

    CleanupStack::Pop(); // patchData

    return patchData;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:53,代码来源:policypatcher.cpp

示例12: DoWriteToFileL

void CSetDRMProtectedTestDevice::DoWriteToFileL(TBool aFlag)
{
    RFs fs;
    CleanupClosePushL(fs);
    User::LeaveIfError(fs.Connect());

    RFile file;
    CleanupClosePushL(file);

    // File doesn't yet exist
    // It is the responsibility of the calling test function to delete the file after use
    User::LeaveIfError(file.Create(fs, KCITestFileName, EFileWrite));
    TBuf8<KMaxCITestFileDataLength> outputBuf;
    outputBuf.Num(aFlag);
    User::LeaveIfError(file.Write(outputBuf));
    CleanupStack::PopAndDestroy(2); // fs, file
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:17,代码来源:setdrmprotectedtestdevice.cpp

示例13: GetMaxNumProfilesActionL

// ---------------------------------------------------------------------------------
// CUpnpTmClientProfileService::GetMaxNumProfilesActionL
// @param aAction pointer to action object
// @return Returns upnp error code
// ---------------------------------------------------------------------------------
//
TUpnpErrorCode CUpnpTmClientProfileService::GetMaxNumProfilesActionL( CUpnpAction* aAction )
{
    OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_GETMAXNUMPROFILESACTIONL_ENTRY );
    TUint profileCount;
    TTerminalModeErrorCode ret = iTmServerImpl.GetMaxNumProfiles( profileCount );
    if ( ret != ETerminalModeSuccess )
    {
        OstTrace0( TRACE_ERROR, DUP1_CUPNPTMCLIENTPROFILESERVICE_GETMAXNUMPROFILESACTIONL, "CUpnpTmClientProfileService::GetMaxNumProfilesActionL" );
        return TUpnpErrorCode( ret );
    }
    OstTrace1( TRACE_NORMAL, CUPNPTMCLIENTPROFILESERVICE_GETMAXNUMPROFILESACTIONL, "CUpnpTmClientProfileService::GetMaxNumProfilesActionL;profileCount=%d", profileCount );
    TBuf8<UpnpString::KMaxTUintLength> countBuf;
    countBuf.Num(profileCount);

    aAction->SetArgumentL( KNumProfilesAllowed, countBuf );
    OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_GETMAXNUMPROFILESACTIONL_EXIT );
    return EHttpOk;
}
开发者ID:kuailexs,项目名称:symbiandump-mw4,代码行数:24,代码来源:upnptmclientprofileservice.cpp

示例14: UpdateTouchIdentityDBL

EXPORT_C void CSenBaseIdentityManager::UpdateTouchIdentityDBL(MSenServiceDescription& asd)
	{
	CSenIdentityProvider* Idp = NULL;
	
	Idp = iIdentity->IdentityProviderL(asd);
	if(Idp != NULL)
		{
		TUint32 current_tick(0);
		TBuf8<32> tickBuf;
				
		CSenElement& IdpElem = Idp->AsElement();
		current_tick = User::NTickCount();
		tickBuf.Num(current_tick);
		IdpElem.AddAttrL(KTouch(), tickBuf);
		}
//	CleanupUnusedIdentityDBL();   
                                  // (don't de-serialize old items). Serialized 
	                              // objects cannot be de-allocated on the fly.
	}
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:19,代码来源:senbaseidentitymanager.cpp

示例15:

// create a custom interface Mux implementation
MMMFDevSoundCustomInterfaceMuxPlugin* CMMFDevSoundCIMuxUtility::CreateCustomInterfaceMuxL(TUid aInterfaceId)
	{
	// The Uid of the plugin will be used as string for matching the best suitable plug in.
	TInt uidAsInteger = aInterfaceId.iUid;
	TBuf8<KMuxTempBufferSize> tempBuffer;
	tempBuffer.Num(uidAsInteger, EHex);
	TUid interfaceUid = {KUidDevSoundCustomInterfaceMux};
	
	TUid destructorKey;
	MMMFDevSoundCustomInterfaceMuxPlugin* self = 
		static_cast<MMMFDevSoundCustomInterfaceMuxPlugin*>
		(MmPluginUtils::CreateImplementationL(interfaceUid, destructorKey, tempBuffer, KRomOnlyResolverUid));

	// pass the destructor key so class can destroy itself
	self->PassDestructorKey(destructorKey);
	CleanupReleasePushL(*self);

	// attempt to construct the plugin
	self->CompleteConstructL(this);
	CleanupStack::Pop(); // self
		
	return self;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:24,代码来源:MmfDevSoundCIMuxUtility.cpp


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