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


C++ RBuf8::Close方法代码示例

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


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

示例1:

void CTcpServerTestUPnP23::RecvComplete ( RMBufChain& aData )
	{
	RBuf8 responseBuf;
	responseBuf.CreateMax ( aData.Length () );
	aData.CopyOut ( responseBuf );
	aData.Free ();
	
	if ( responseBuf.FindF ( KExpectedResponse ) != KErrNotFound )
		{
		iSocketHandler.Recv ();
		responseBuf.Close ();
		return;
		}
		
	if ( responseBuf.FindF ( KResponseData ) == KErrNotFound )
		{
		iResponse = EFail; // test case failed
		}
	else
		{
		iResponse = EPass;	// test case passed
		}
	
	responseBuf.Close ();
	CompleteSelf ( KErrNone );
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:26,代码来源:ctcpservertestupnp23.cpp

示例2: DriverCreateConferenceCallL

void CCTsyCallControlMultipartyFUNegative::DriverCreateConferenceCallL(RMobilePhone::TMobileService aMobileService, TInt aCallId1, TInt aCallId2)
	{
	RBuf8 data;
	CleanupClosePushL(data);

	DriverDialAndHoldFirstCallDialSecondCallL(aMobileService, aCallId1, aCallId2);

	TMockLtsyData2<TInt, TInt> createConfData(aCallId1, aCallId2);
	createConfData.SerialiseL(data);
	iMockLTSY.ExpectL(MLtsyDispatchCallControlMultipartyCreateConference::KLtsyDispatchCallControlMultipartyCreateConferenceApiId, data);

    RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusConnected;
    TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData(
    		aCallId1, RMobilePhone::EServiceUnspecified, callStatus);
    data.Close();
    mockCallData.SerialiseL(data);
    iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);

    TMockLtsyCallData1<RMobileCall::TMobileCallStatus> mockCallData2(
    		aCallId2, RMobilePhone::EServiceUnspecified, callStatus);
    data.Close();
    mockCallData2.SerialiseL(data);
    iMockLTSY.CompleteL(KMockLtsyDispatchCallControlNotifyCallStatusChangeIndId, KErrNone, data);

    CleanupStack::PopAndDestroy(1, &data);
	} // CCTsyCallControlMultipartyFUNegative::DriverCreateConferenceCallL
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:26,代码来源:cctsycallcontrolmultipartyfunegative.cpp

示例3: QueueProcessedEventL

void CMockPowerEngine::QueueProcessedEventL(const TInt aCommandId, const TUint8 aTransId, TDesC8& aData)
	{
	// Request
	RBuf8 buffer;
	
	// Request
	
	FurtherProcessEventL(aCommandId, aData);

	TMockHwrmPluginData reqData(aTransId,aData);
	reqData.SerialiseL(buffer);
	// copy serialised data to a HBufC8 pointer
	HBufC8* req = HBufC8::New(buffer.Length());
	TPtr8 reqPtr = req->Des();
	reqPtr = buffer;
	// queue that as expected request (take ownership of req)
	CMockSYEngine::DoQueueEventL(TMockSYEvent::EMessage,aCommandId,req,KErrNone,EFalse,0);
	buffer.Close();
	
	QueueProcessedCompletionL(aCommandId, aTransId, buffer, aData);
	// copy serialised data to a HBufC8 pointer
	HBufC8* resp = HBufC8::New(buffer.Length());
	TPtr8 respPtr = resp->Des();
	respPtr = buffer;
	// queue that as response (take ownership of req)
	CMockSYEngine::DoQueueEventL(TMockSYEvent::ECompletion,aCommandId,resp,KErrNone,EFalse,1);
	buffer.Close();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:28,代码来源:cmockpowerengine.cpp

示例4:

void CTcpServerTestUPnP40::RecvComplete ( RMBufChain& aData )
	{
	RBuf8 responseBuf;
	responseBuf.CreateMax ( aData.Length () );
	aData.CopyOut ( responseBuf );
	aData.Free ();
	
	if ( responseBuf.FindF ( KExpectedResponse3 ) != KErrNotFound )
		{
		iSocketHandler.Recv ();
		responseBuf.Close ();
		return;
		}
	if ( responseBuf.FindF ( KResponseData ) != KErrNotFound )
		{
		TRAP_IGNORE(iSendChain.CreateL ( KData32 ));
		iSocketHandler.Send ( iSendChain );
		responseBuf.Close ();
		return;
		}
	if ( responseBuf.FindF ( KExpectedResponse32 ) != KErrNotFound )
		{
		iResponse = EPass;	// test case Passed
		}
	else
		{
		iResponse = EFail;	// test case failed
		}
	
	responseBuf.Close ();
	CompleteSelf ( KErrNone );
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:32,代码来源:ctcpservertestupnp30.cpp

示例5:

void CTcpClientTestUPnP13::NewData(TUint aCount)
	{
	RMBufChain data;
	RBuf8 resData;
	
	iLogger.WriteFormat(_L("<i>NewData..... </i>"));
	iSSP->GetOption(1,KCHMaxLength,resData);
	resData.Create( aCount );
	iSSP->GetOption(KCHOptionLevel,KCHMaxLength,resData);
	TInt len = *(TUint*) resData.Ptr();
	resData.Close();
	
	iSSPData->GetData(data,aCount,0);
	resData.Create( aCount );
	data.CopyOut(resData);
	resData.Close();
	resData.Create( aCount );
	iSSP->GetOption(KCHOptionLevel,KCHLastMessage,resData);
	TBool isLastMsg = *(TUint*) resData.Ptr();
	resData.Close();
	data.Init();
	
	if(isLastMsg)
		{
		iLogger.WriteFormat(_L("<i>NewData.LastMsg.... </i>"));
		CompleteSelf ( KErrNone );
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:28,代码来源:ctcpclienttestupnp13.cpp

示例6: PublishServiceL

/*
	Tests whether Publishing a Service/Device is performing as specified in UPnP specifications.
	@param			aOperationType is reference to a section name in ini file where required parameters
					needs to be referred for this operation.
	@return			None.
 */
void CTestRControlChannel::PublishServiceL (const TDesC& aOperationType)
	{
	_LIT(KInfoLogFile, "CTestRControlChannel::PublishServiceL ().... \n");
	INFO_PRINTF1(KInfoLogFile);
	CRControlChannelObserver* upnpObserver = CRControlChannelObserver::NewL(this);
	CleanupStack::PushL( upnpObserver );
	iObserverArray.Append(upnpObserver);

	RPnPParameterBundle pnpBundle ;
	pnpBundle.Open();
    CleanupClosePushL( pnpBundle );
    pnpBundle.SetPnPObserver((MPnPObserver*)upnpObserver);
    RParameterFamily family = pnpBundle.CreateFamilyL(EUPnPServiceRegisterParamSet);
   	CUPnPServiceRegisterParamSet* registerServiceParamSet = CUPnPServiceRegisterParamSet::NewL(family );

   	_LIT(KParentDeviceUid, "ParentDeviceUid");
   	TPtrC parentDeviceUid;
	GetStringFromConfig(aOperationType, KParentDeviceUid, parentDeviceUid);

	RBuf8 parentDeviceUidBuf;
	parentDeviceUidBuf.Create(parentDeviceUid.Length());
	parentDeviceUidBuf.Copy(parentDeviceUid);
	registerServiceParamSet->SetDeviceUidL (parentDeviceUidBuf);


	TPtrC serviceType;
	GetStringFromConfig(aOperationType, KServiceType, serviceType);
	RBuf8 serviceTypeBuf;
	serviceTypeBuf.Create(serviceType.Length());
	serviceTypeBuf.Copy(serviceType);
	registerServiceParamSet->SetUriL ( serviceTypeBuf );


	TInt duration;
	GetIntFromConfig(aOperationType, KCacheControl, duration);
	registerServiceParamSet->SetCacheControlData (duration);

	ExtractServiceDescriptionL (aOperationType, *registerServiceParamSet);

	_LIT8(KInitialMessage, "Initial notification message");
	registerServiceParamSet->SetInitialMessageL(KInitialMessage);
	
	OpenPublisherL();

	iPublisher.Publish( pnpBundle );
	CActiveScheduler::Start();

	serviceTypeBuf.Close();
	parentDeviceUidBuf.Close();
	CleanupStack::PopAndDestroy( &pnpBundle );
	CleanupStack::Pop( upnpObserver );
	
	InitiateControlL();
	_LIT(KInfoLogFile1, "CTestRControlChannel::PublishServiceL () Stop.... \n");
	INFO_PRINTF1(KInfoLogFile1);
	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:63,代码来源:testrcontrolchannel.cpp

示例7: printMessage

void SymbianLog::printMessage(const char* level, const char* msg, PLATFORM_VA_LIST argList) 
{
    iSemaphore.Wait();
    
    StringBuffer currentTime = createCurrentTime(true);
    
    TInt err = file.Open(fsSession, iLogName, EFileWrite|EFileShareAny);
    TInt pos = 0;
    
    if (err == KErrNotFound) 
    {
        // First time: file does not exist. Create it.
        err = file.Create(fsSession, iLogName, EFileWrite|EFileShareAny);
        if (err != KErrNone) {
            setErrorF(err, "SymbianLog: could not open log file (code %d)", err);
            goto finally;
        }
        StringBuffer header = createHeader();
        RBuf8 data;
        data.Assign(stringBufferToNewBuf8(header));
        file.Write(data);
        data.Close();
    }
    else 
    {
        err = file.Seek(ESeekEnd, pos);
        if (err != KErrNone) {
            setErrorF(err, "SymbianLog: seek error on log file (code %d)", err);
            goto finally;
        }
    }

    {
        // Write the data
        StringBuffer line, data;
        line.sprintf("%s -%s- %s", currentTime.c_str(), level, msg);
        data.vsprintf(line.c_str(), argList);
        data.append("\n");
        
        RBuf8 buf;
        buf.Assign(stringBufferToNewBuf8(data));
        file.Write(buf);
        buf.Close();
    }
    
finally:
    file.Close();
    // we need closed file to operate on it
    if ( LogSize() > SYMBIAN_LOG_SIZE ){
        // roll log file
        RollLogFile();
    }
    iSemaphore.Signal();
}
开发者ID:pohly,项目名称:funambol-cpp-client-api,代码行数:54,代码来源:Log.cpp

示例8: ILibSocketWrapper_recv

int ILibSocketWrapper_recv(int socketObject, char *buffer, int bufferLength)
{
	RSocket *s = (RSocket*)SocketArray[socketObject];
	RBuf8 *buf = new RBuf8();
	
	TRequestStatus status;
	TSockXfrLength aLen;
	int RetVal=0;
	
	if(buf->Create(bufferLength)==KErrNone)
	{
		s->RecvOneOrMore(*buf,0,status,aLen);
		User::WaitForRequest(status);
		if(status!=KErrNone)
		{
			RetVal = 0;
		}
		else
		{
			RetVal = aLen();
			Mem::Copy(buffer,(void*)buf->Ptr(),RetVal);
		}
	}
	buf->Close();
	delete buf;
	return(RetVal);
}
开发者ID:GufCab,项目名称:Semester-Projekt---Test-Kode,代码行数:27,代码来源:ILibSocketWrapper.cpp

示例9: SetClientProfileActionL

// -------------------------------------------------------------------------------------
// CUpnpTmClientProfileService::SetClientProfileActionL
// @param aAction  Pointer to UPnP action object
// @return Returns upnp error code
// ---------------------------------------------------------------------------------
//
TUpnpErrorCode CUpnpTmClientProfileService::SetClientProfileActionL( CUpnpAction* aAction )
{
    OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL_ENTRY );
    TUint profileIdInt;
    // Fetch the value for profile ID argument
    TLex8 lex( aAction->ArgumentValue(KProfileId) );
    lex.Val(profileIdInt);
    OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL;profileIdInt=%d", profileIdInt );

    // Fetch the value for client profile argument
    const TDesC8& clientProfile = aAction->ArgumentValue(KClientProfile);

    RBuf8 resultProfileBuf;
    TTerminalModeErrorCode ret = iTmServerImpl.SetClientProfile( profileIdInt,clientProfile,resultProfileBuf );
    if ( ret != ETerminalModeSuccess )
    {
        resultProfileBuf.Close();
        OstTrace0( TRACE_ERROR, DUP1_CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL" );
        return TUpnpErrorCode( ret );
    }
    CleanupClosePushL(resultProfileBuf);
    aAction->SetArgumentL( KResultProfile , resultProfileBuf );
    CleanupStack::PopAndDestroy(&resultProfileBuf);
    OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL_EXIT );
    return EHttpOk;
}
开发者ID:kuailexs,项目名称:symbiandump-mw4,代码行数:32,代码来源:upnptmclientprofileservice.cpp

示例10: WriteL

/** This user-side method uses the RFile Session methods to find the end of the file described by iCSVFile.
It then appends performance data metrics by element from the passed array, with each element separated by a comma character.
@param aPerformanceData is the constant array of performance data stored as TDesC
@return KErrNone if command was prepared correctly and a system wide error code otherwise.
 */
void CUptCsvGenerator::WriteL(const RArray<TPtrC8>& aPerformanceConfig)
	{
	// find end of this file, and append the passed data from here.
	TInt filesize;
	iCsvFile.Size(filesize);
	iCsvFile.Seek(ESeekStart, filesize);
	
	RBuf8 buf; 
	CleanupClosePushL(buf);
	//create a buf large enough to contain the passed data and comma separators
	TInt numbytes = 5*aPerformanceConfig.Count()*sizeof(TPtrC8);
	buf.CreateL(numbytes);
		
	//for the number of elements in the passed array:- append each element, separated by a comma, to the buffer
	for(TInt i=0; i!=aPerformanceConfig.Count(); i++) //could replace aPerformance.Count() with structure paramter Parameter.Count
		{
		buf.Append(aPerformanceConfig[i]);
		//may reimplement this
		if(i!=aPerformanceConfig.Count()) 	
			buf.Append(KCsvComma);  

		}
	//write the buffer to the given file	
	User::LeaveIfError(iCsvFile.Write(buf));
	
	
	//close and cleanup the heap objects
	buf.Close();
	CleanupStack::PopAndDestroy(&buf);

	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:36,代码来源:te_perfcsvgenerator.cpp

示例11: GetDataL

// ---------------------------------------------------------------------------
// Data request from CatalogsPCConnectivityPlugin
// First ask the size from server, then give correct size CBufFlat
// ---------------------------------------------------------------------------
//
void RCatalogsPCConnectivityClient::GetDataL( 
    TDataType& aMimeType, CBufFlat& aData )
    {
    TPckgBuf<TInt> pckgSize;
    TPckgBuf<TDataType> pckgMIME;
    
    User::LeaveIfError( SendReceive( 
            ECatalogsPCConnectivityGetSize, 
            TIpcArgs( &pckgMIME, &pckgSize ) ) );
    
    TInt size = pckgSize();
    aMimeType = pckgMIME();
    
    RBuf8 desData;
    desData.CreateL( size );
    desData.CleanupClosePushL();
    
    User::LeaveIfError( SendReceive( 
            ECatalogsPCConnectivityGetData, 
            TIpcArgs( &desData ) ) );
    
    aData.Reset();
    aData.ExpandL( 0, size );
    aData.Write( 0, desData, size );        
            
    CleanupStack::Pop(); //desData
    desData.Close();
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:33,代码来源:catalogspcconnectivityclient.cpp

示例12: if

void CTcpClientTestUPnP1::ReceivedL ( const TRuntimeCtxId& /*aSender*/, const TNodeId& /*aRecipient*/, TSignatureBase& aMessage )
	{
	if ( aMessage.IsMessage<TCFFactory::TPeerFoundOrCreated> () )
		{
		const TCFFactory::TPeerFoundOrCreated& msg = message_cast < const TCFFactory::TPeerFoundOrCreated > ( aMessage );
		iClientId = msg.iNodeId;
		CompleteSelf ( KErrNone );
		}
	else if ( aMessage.IsMessage<TUpnpMessage::TResponse > () )
		{
		TUpnpMessage::TResponse& msg = message_cast< TUpnpMessage::TResponse >(aMessage);
		
		RBuf8 responseBodyData;
		responseBodyData.CreateMax ( msg.iBodyData.Length () );
		responseBodyData.FillZ ( msg.iBodyData.Length () );
		msg.iBodyData.CopyOut ( responseBodyData );	
		responseBodyData.Close ();
		msg.iBodyData.Free ();
		
		CompleteSelf(EPass);
		}
	else if ( aMessage.IsMessage<TEBase::TError > () )
		{
		iLogger.WriteFormat(_L("<i>TEBase::TError..... </i>"));
		CompleteSelf(EFail);
		}

	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:28,代码来源:ctcpclienttestupnp1.cpp

示例13: WriteApiNameL

void CUptCsvGenerator::WriteApiNameL(const TInt aApiEnum)
	{
	// find end of this file, and append the passed data from here.
	TInt filesize;
	iCsvFile.Size(filesize);
	iCsvFile.Seek(ESeekStart, filesize);
		
	RBuf8 buf; 
	CleanupClosePushL(buf);
	//create a buf large enough to contain the passed data and comma separators
	TInt numbytes = 1024;//2*sizeof(TPtrC8);
	buf.CreateL(numbytes);
		
	//read the APIenum (which is the same as the first element of aPerformanceData)
	//use this enum value to write the name of the API being tested
	TApiNames getApiName;
	buf.Append(getApiName.GetApiIdString(aApiEnum));
	buf.Append(KCsvComma); 
	
	//write the buffer to the given file	
	User::LeaveIfError(iCsvFile.Write(buf));
		
		
	//close and cleanup the heap objects
	buf.Close();
	CleanupStack::PopAndDestroy(&buf);
		
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:28,代码来源:te_perfcsvgenerator.cpp

示例14: doTestStepL

/**
 * @see GetInfoCpm test case NET-CONFIGURATOR-I-0018-HP
 *
 * doTestStepL virtual function does the below action
 * Connect to a configurator
 * Configurator get the module inidata section. Inidata section contains
   module initialisation information in the module's configuration file.
 * close the connection to configuator
 * Expected:-GetInfoCpm return kerrNone
*/
TVerdict CGetInfoCpm::doTestStepL()
	{

	SetTestStepResult(EFail);
	_LIT8(KNameDummyCpm,"DummyCpm");

	RBuf8 data;
	data.Create(100);
	TInt actualdatasize;

	//Configurator call to get the module inidata section
	TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize);
	if (error == KErrOverflow)
		{
		INFO_PRINTF2(_L("GetModuleIniData returned KErrOverflow (%d)  \n"), error);
		data.ReAlloc(actualdatasize);
	    error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize);
	  	}
	else if (error == KErrRSModuleUnknown )
		{
		INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d)  \n"), error);
		}
	else if (error == KErrNone)
		{
	    INFO_PRINTF1(_L("GetModuleIniData Sucessful"));
	    SetTestStepResult(EPass);
		}
	else
		{
		INFO_PRINTF2(_L("GetModuleIniData  (DummyCpm) returned Error (%d)  \n"), error);
		}

    data.Close();
	return TestStepResult();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:45,代码来源:getinienumerateStep.cpp

示例15: LaunchAppActionL

// ---------------------------------------------------------------------------------
// CUpnpTmAppServerService::LaunchAppActionL
// @param aAction pointer to upnp action object
// @return Returns upnp error code
// ---------------------------------------------------------------------------------
//
TUpnpErrorCode CUpnpTmAppServerService::LaunchAppActionL( CUpnpAction* aAction )
   {
   OstTraceFunctionEntry0( CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL_ENTRY );
   TUint appIdInt;  
   TUint profileIdInt;
   // Validates the input parameters
   if ( ( ConvertDescriptorToInt( aAction->ArgumentValue(KAppId), appIdInt ) != KErrNone )
       || ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone ))
        {
        OstTraceExt2( TRACE_ERROR, CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL, "CUpnpTmAppServerService::LaunchAppActionL;appIdInt=%u;profileIdInt=%u", appIdInt, profileIdInt );
        return EInvalidArgs;   // either invalid app ID or invalid profile ID  
        }

   RBuf8 launchUrl;
   TTerminalModeErrorCode ret = iTmServerImpl.LaunchApp( appIdInt,profileIdInt,launchUrl );
   
   if ( ret != ETerminalModeSuccess )
       {
       // Error is returned
       launchUrl.Close();
       OstTrace0( TRACE_ERROR, DUP1_CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL, "CUpnpTmAppServerService::LaunchAppActionL" );   
       return TUpnpErrorCode( ret );
       }
   CleanupClosePushL(launchUrl);
   aAction->SetArgumentL( KAppLaunchUri , launchUrl );
   
   CleanupStack::PopAndDestroy(&launchUrl);
   OstTraceFunctionExit0( CUPNPTMAPPSERVERSERVICE_LAUNCHAPPACTIONL_EXIT );
   return EHttpOk;  
   }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:36,代码来源:upnptmappserverservice.cpp


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