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


C++ TPckgBuf类代码示例

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


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

示例1: DBG_PRINT

// ---------------------------------------------------------------------------
// CNATFWTraversalAdapter::SaveL
//
// ---------------------------------------------------------------------------
//
void CNATFWTraversalAdapter::SaveL( TInt aIndex )
    {
    DBG_PRINT( "CNATFWTraversalAdapter::SaveL - begin" );
    CWPNATFWItem* cNATFWItem = iDatas[aIndex];
    const TInt iapItemCount( iDatas[aIndex]->IAPItems().Count() );
    for ( TInt counter = 0; counter < iapItemCount; counter++ )
        {
        // Set access point ID to current IAP item (access point is always
        // stored before NAT/FW settings).
        CNATFWIAPSpecificItem* cIapItem = iDatas[aIndex]->IAPItems()[counter];
        if ( cIapItem->NapDef() )
            {
            // Get WAP ID.
            TPckgBuf<TUint32> uid;
            uid.Copy( cIapItem->NapDef()->Data( 0 ) );
            
            TUint32 wapId( uid() );
            // Get corresponding IAP ID.
            TUint32 iapId = IapIdFromWapIdL( wapId );
            cIapItem->SetIAPId( iapId );
            }// if 
        cIapItem = NULL;    
        }
    cNATFWItem->StoreL();
    cNATFWItem = NULL;
    DBG_PRINT( "CNATFWTraversalAdapter::SaveL - end" );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:32,代码来源:natfwtraversaladapter.cpp

示例2: __ASSERT_ALWAYS

// -----------------------------------------------------------------------------
// CMceComAvSink::SetParameterL
// -----------------------------------------------------------------------------
//    
TBool CMceComAvSink::SetParameterL( 
    const CMceComEndpoint& aClient, 
    TUint32 aParam,
    const TDesC8& aValue )
    {
    // At the moment, only supported parameter is volume for speaker
    //
    if ( aClient.iType != KMceSpeakerSink || aParam != KMccSpeakerVolume )
        {
        return KMceSrvStreamDefaultSequence;
        }
    
    __ASSERT_ALWAYS( ServesProxyClient( aClient ), User::Leave( KErrNotFound ) );
    
    __ASSERT_ALWAYS( aClient.MediaStream() && aClient.MediaStream()->Session(),
                     User::Leave( KErrNotFound ) );
   
    CMceMediaManager& manager = 
        aClient.MediaStream()->Session()->SdpSession().Manager();
    
    TPckgBuf<TInt> volBuf;
    volBuf.Copy( aValue );
    
    iVolume = volBuf();
    
    if ( aClient.IsEnabled() )
        {
        manager.SetMccParameterL( 
            static_cast<const CMceComMediaSink&>( aClient ), aParam, aValue );
        }
        
    return KMceSrvStreamAlternativeSequence;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:37,代码来源:mcecomavsink.cpp

示例3: TestDeleteStoreOperationL

LOCAL_C void TestDeleteStoreOperationL()
	{
	CMsgsTestUtils::SetDriveL(EDriveC);

	CSessionObserver* ob = new(ELeave)CSessionObserver;
	CleanupStack::PushL(ob);

	// Set session in observer
	CMsvSession* session = CMsvSession::OpenAsyncL(*ob);
	ob->iSession = session; 
	CleanupStack::PushL(session);
	
	CActiveScheduler::Start();
	test(ob->iType==MMsvSessionObserver::EMsvServerReady);

	CTestActive* active = new(ELeave)CTestActive;
	CleanupStack::PushL(active);
	
	// Test Delete MailStore 
	active->StartL();
	CMsvOperation* operation = NULL;
	TDriveUnit unit =(EDriveD);
	operation = session->DeleteStoreL(unit, active->iStatus);
	test(operation->Mtm() == KUidMsvServerMtm);
	CleanupStack::PushL(operation);
	
    CActiveScheduler::Start();
    
    //Retrieve progress 
	TPckgBuf<TMsvCopyProgress> package;
	package.Copy(operation->ProgressL());
	test((package().iError == KErrNone) || (package().iError == KErrPathNotFound)) ;
	
	CleanupStack::PopAndDestroy(4);	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:35,代码来源:T_MAILSTORE.CPP

示例4: HandleRequestForEventL

// -----------------------------------------------------------------------------
// CPosLmEventHandler::HandleRequestForEventL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CPosLmEventHandler::HandleRequestForEventL(
    const RMessagePtr2& aMessage)
    {
    TPckgBuf<TPosLmEvent> event;
    TInt desMaxLength = aMessage.GetDesMaxLength(KPosLmServerEventArg);
    if (desMaxLength != event.Length())
        {
        PanicClient(aMessage, EPosUnableToReadOrWriteDataToClient);
        return;
        }

    if (iEventQueue.Count() > 0)
        {
        // Send the first event in the queue to the client.
        WriteEventAndComplete(aMessage, iEventQueue[0]);
        iEventQueue.Remove(0);
        }
    else
        {
        // No events in queue. Put the message on hold.
        if (!iHoldingMessage.IsNull())
            {
            PanicClient(aMessage,
                EPosEventNotifierAlreadyHasOutstandingRequest);
            }
        else
            {
            iHoldingMessage = aMessage;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:37,代码来源:EPos_CPosLmEventHandler.cpp

示例5: HandleRequestForEventL

// -----------------------------------------------------------------------------
// CPosLmDbManEventHandler::HandleRequestForEventL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CPosLmDbManEventHandler::HandleRequestForEventL(
    const RMessagePtr2& aMessage)
    {
    // check that descriptor parameters are OK so that server
    // won't panic when trying to write.
    TPckgBuf<TPosLmDatabaseEvent> event;
    TPckgBuf<TInt> length;
    TInt eventMaxLength = aMessage.GetDesMaxLength(KPosLmServerDbManEventArg);
    TInt lengthMaxLength = aMessage.GetDesMaxLength(KPosLmServerUriLengthArg);
    if (eventMaxLength  != event.Length() ||
        lengthMaxLength != length.Length())
        {
        PanicClient(aMessage, EPosUnableToReadOrWriteDataToClient);
        return;
        }

    if (iEventQueue.Count() > 0)
        {
        // Send the first event in the queue to the client.
        WriteEventAndComplete(aMessage);
        }
    else
         {
        // No events in queue. Put the message on hold.
        if (!iHoldingMessage.IsNull())
            {
            PanicClient(aMessage,
                EPosEventNotifierAlreadyHasOutstandingRequest);
            }
        else
            {
            iHoldingMessage = aMessage;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:41,代码来源:EPos_CPosLmDbManEventHandler.cpp

示例6: HandleGetArtistResponse

/**
Extracts the artist from the 'get artist' response data and calls 
the relevant mixin function on the observer.	
	
@param The data passed with the response.
*/	
void CRemConTrackInfoController::HandleGetArtistResponse(TInt aError, const TDesC8& aData)
	{
	LOG_FUNC

	TPckgBuf<TName> buf;
	buf.Copy((aData.Mid(KRemConExtApi1ResultDataLength)));
	iObserver.MrcticoGetArtistResponse(aError, buf());
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:trackinfocontroller.cpp

示例7: _DBG_FILE

// -----------------------------------------------------------------------------
// CNSmlDsProvisioningAdapter::DeleteL
// -----------------------------------------------------------------------------
void CNSmlDsProvisioningAdapter::DeleteL( const TDesC8& aSaveData)
	{
	_DBG_FILE("CNSmlDsProvisioningAdapter::DeleteL(): begin");
	TPckgBuf<TInt> uid;
	uid.Copy( aSaveData );
	iSession.DeleteProfileL( uid() );
	_DBG_FILE("CNSmlDsProvisioningAdapter::DeleteL(): end");
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:11,代码来源:NSmlDsProvisioningAdapter.cpp

示例8: __ASSERT_DEBUG

CMsvOperation* CTextMtmClient::ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList, 
										TRequestStatus& aCompletionStatus)
// Create forwarded message 
// Destination folder is aForwardEntryL
//
	{
	__ASSERT_DEBUG(iMsvEntry!=NULL,gPanic(ETxtcNoCMsvEntrySet));
	__ASSERT_DEBUG(iMsvEntry->Entry().iType.iUid == KUidMsvMessageEntryValue, gPanic(ETxtcEntryTypeNotSupported));
	__ASSERT_DEBUG(iMsvEntry->Entry().iServiceId == KMsvLocalServiceIndexEntryId, gPanic(ETxtcInvalidServiceId));
	
	// Create the forwarded index entry
	TMsvEntry forwardEntry;
	forwardEntry.iMtm = KUidMsgTypeText;
	forwardEntry.iServiceId = Entry().Entry().iServiceId;
	forwardEntry.iType = KUidMsvMessageEntry;
	forwardEntry.iDetails.Set(iMsvEntry->Entry().iDetails);				
	forwardEntry.iSize = iMsvEntry->Entry().iSize;	
	if(aPartList&KMsvMessagePartDate)
		forwardEntry.iDate.HomeTime();
	if(aPartList&KMsvMessagePartDescription)
		forwardEntry.iDescription.Set(iMsvEntry->Entry().iDescription);		

	// Get CMsvEntry for destination (parent)
	CMsvEntry* cEntry = CMsvEntry::NewL(Session(), aForwardEntryId, TMsvSelectionOrdering());
	CleanupStack::PushL(cEntry);
	// Synchronously create new child
	CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
	CMsvOperation* opert = cEntry->CreateL(forwardEntry, wait->iStatus);
	CleanupStack::PushL(opert);
	wait->Start();
	User::LeaveIfError(opert->iStatus.Int());
	// Check result
	TPckgBuf<TMsvLocalOperationProgress> progressPack;
    progressPack.Copy(opert->ProgressL());
	TMsvLocalOperationProgress progress = progressPack();
	User::LeaveIfError(progress.iError);
	CleanupStack::PopAndDestroy(2);	// opert, wait

	// Get CMsvEntry for new entry
	TMsvId forwardId=progress.iId;
	cEntry->SetEntryL(forwardId);
	
	// Populate new forwarded message with Body text
	if(aPartList&KMsvMessagePartBody)
		{
		CMsvStore* store=cEntry->EditStoreL();
		CleanupStack::PushL(store);
		StoreBodyL(*store);				// Current context is original message
		store->CommitL();
		CleanupStack::PopAndDestroy();	// store
		}

	CleanupStack::PopAndDestroy(); // cEntry
		
	// Request was performed synchronously, so return a completed operation object
	return CMsvCompletedOperation::NewL(Session(), KUidMsgTypeText, progressPack, 
		KMsvNullIndexEntryId, aCompletionStatus);
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:58,代码来源:TXCLIENT.CPP

示例9: HandleGetTrackDurationResponse

/**
Extracts the track duration from the 'get track duration' response data and calls 
the relevant mixin function on the observer.	
	
@param The data passed with the response.
*/	
void CRemConTrackInfoController::HandleGetTrackDurationResponse(TInt aError, const TDesC8& aData)
	{
	LOG_FUNC	
	
	TPckgBuf<TInt64> buf;
	buf.Copy((aData.Mid(KRemConExtApi1ResultDataLength)));
	TTime duration(buf());
	iObserver.MrcticoGetTrackDurationResponse(aError, duration);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:15,代码来源:trackinfocontroller.cpp

示例10: MCC_ENDPOINT_ID

// -----------------------------------------------------------------------------
// CMccFileSource::ConstructSourceL
// -----------------------------------------------------------------------------
//
void CMccFileSource::ConstructSourceL( const TDesC8& aInitData )
    {    	
	iSourceImpl = CMccFileSourceImpl::NewL( 
        MCC_ENDPOINT_ID( static_cast<MDataSource*>( this ) ) );
  
    TPckgBuf<TFileName> initData;
    initData.Copy( aInitData );
    
    OpenFileL( initData() );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:14,代码来源:mccfilesource.cpp

示例11: sizeof

void CProtocolExadump::DoOpen(TInt aSnaplen)
	/**
	* Try opening the dump file.
	*
	* Opens the dump file and writes the file header to it.
	*
	* @param aSnaplen The snap length
	*/
	{
/** @code */
	// Just close the previous, if called with open file.
	if (iOpen > 0)
		{
		iDumpFile.Close();
		iFS.Close();
		}

	// Allocate a working buffer for the packet frames
	// (include packet header and snaplen).
	delete iBuffer;
	iBuffer = HBufC8::NewMax(aSnaplen + sizeof(struct pcap_file_header));
	if (iBuffer == NULL)
		{
		iOpen = KErrNoMemory;
		return;
		}

	_LIT(KDumpFile, "exedump.dat");	// the name of the dump file.

	iOpen = iFS.Connect();
	if (iOpen != KErrNone)
		return;
	iOpen = iDumpFile.Replace(iFS, KDumpFile, EFileWrite);
	if (iOpen != KErrNone)
		{
		iFS.Close();
		return;
		}

	// Write the header
	TPckgBuf<struct pcap_file_header> hdr;

	hdr().magic = TCPDUMP_MAGIC;
	hdr().version_major = PCAP_VERSION_MAJOR;
	hdr().version_minor = PCAP_VERSION_MINOR;

	hdr().thiszone = 0;
	hdr().snaplen = aSnaplen;
	hdr().sigfigs = 0;
	hdr().linktype = DLT_RAW;
	iDumpFile.Write(hdr, hdr.Length());
	iOpen = 1;
	return;
/** @endcode */
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:55,代码来源:exadump.cpp

示例12: err

// ---------------------------------------------------------------------------
// CSensorDataCompensatorAxisDataHandler::Update
// ---------------------------------------------------------------------------
//
TInt CSensorDataCompensatorAxisDataHandler::Update()
    {
	
	FUNC_LOG;
    TInt err( KErrNone );
    TInt count = iPlugin.GetCompensationItemCount();
    INFO_1( "Axis compensation item count %d", count );
    iMatrix.SetIdentity(); // Reset compensation
    if ( count >= 0 )
        {
        // Calculate final compensation angles and create compensation matrix
        TPckgBuf<TCompensationTypeAxisData> pckg;
        TInt x( 0 );
        TInt y( 0 );
        TInt z( 0 );
        TSensorDataCompensatorMatrix m;
        TSensorDataCompensatorMatrix m2;
        for ( TInt i( 0 ) ; i < count; i++ )
            {
            TPtrC8 data( iPlugin.GetCompensationItem( i ) );
            if ( data.Size() == pckg.MaxSize() )
                {
                pckg.Copy( data );
                x = pckg().iAxisX;
                y = pckg().iAxisY;
                z = pckg().iAxisZ;
                }
            else
                {
                err = KErrCorrupt;
                break;
                }
            m.SetRotateX( x );
            m2.SetRotateY( y );
            m *= m2; // xy
            m2.SetRotateZ( z );
            m *= m2; // xy * z
            iMatrix *= m;
            }
        if ( err != KErrNone )
            {
            iMatrix.SetIdentity();
            }
        }
    else
        {
        // Error occured in plugin
        err = count;
        }
    iCompensate = ( count > 0 ) && ( err == KErrNone ); // Ready to compensate
    ERROR( err, "Axis update error" );
    return err;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:57,代码来源:sensordatacompensatoraxisdatahandler.cpp

示例13: __ASSERT_DEBUG

void CWin32Socket::Accept(TWin32Message& aMessage)
	{
	__ASSERT_DEBUG(iAcceptMessage == NULL, Panic(EWinSockPrtCWin32SocketMultipleAcceptRequests));
	__ASSERT_DEBUG(iBlankAcceptSocket == NULL, Panic(EWinSockPrtCWin32SocketAcceptBlankSocketNotNull));
	iAcceptMessage = &aMessage;
	WSP_LOG(WspLog::Printf(_L("CWin32Socket::Accept: this: 0x%x"), this));
	if (WSAEventSelect(iSocket, iEvent, FD_ACCEPT) == SOCKET_ERROR)
		{
		Complete(iAcceptMessage, MapWinSockError(WSAGetLastError()));
		}
	TPckgBuf<TInt> newSocketHandleBuf;
	newSocketHandleBuf.Copy(iAcceptMessage->ReadBuffer());
	iBlankAcceptSocket = (CWin32Socket*)newSocketHandleBuf();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:wsp_socket.cpp

示例14: queueSizeBuf

void CWin32Socket::Listen(TWin32Message& aMessage)
	{
	TPckgBuf<TUint> queueSizeBuf;
	queueSizeBuf.Copy(aMessage.ReadBuffer());
	TUint& queueSize = queueSizeBuf();
	if (listen(iSocket, queueSize))
		{
		aMessage.Complete(MapWinSockError(WSAGetLastError()));
		}
	else
		{
		aMessage.Complete(KErrNone);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:wsp_socket.cpp

示例15: CleanupClosePushL

// -----------------------------------------------------------------------------
// CResultCollector::VisitL
// -----------------------------------------------------------------------------
// 
void CResultCollector::VisitL( CNSPTest& aTest )
	{
	CBufFlat* buffer = CBufFlat::NewL( 300 );
	CleanupStack::PushL( buffer );
	RBufWriteStream stream;
	stream.Open( *buffer );
	CleanupClosePushL( stream );
	aTest.ExternalizeL( stream );
	
	TPckgBuf<TResult> pkgIn;
	pkgIn.Copy( buffer->Ptr(0) );
	PrintResult( pkgIn() );
	
	CleanupStack::PopAndDestroy();
	CleanupStack::PopAndDestroy( buffer );
	}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:20,代码来源:nspresultcollector.cpp


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