• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TPtrC类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OverrideFormatForParsersIfApplicable

void CRichText::OverrideFormatForParsersIfApplicable(TPtrC& aText, TCharFormatX& aFormat, TInt aStartPos) const
	{
	if (aFormat.iParserTag && iParserData->iActiveParserList && iParserData->iEditObserver)
		{
		// Replace format
		TInt start = -1;
		TInt length = 0;
		TInt curPos = iParserData->iLastKnownCursor;
		if (curPos > DocumentLength())
			curPos = DocumentLength();  // This shouldn't be neccesary but it makes it more
										// bulletproof if the calls from outside are made in
										// the wrong order
		if (curPos != -1)
			{
			TCharFormatX format;
			TCharFormatXMask varies;
			MParser* parser;

			GetExtendedCharFormat(format, varies, curPos, 1);
			// If char at curpos has a tag then cursor is over that tag, get extents of tag
			if (CParserList::ReformatOnRollover(format.iParserTag))
				DoCursorOverTag(curPos, parser, start, length);
			else if (curPos)
				{
				GetExtendedCharFormat(format, varies, curPos - 1, 1);
				// Try the char "before" curpos
				if (CParserList::ReformatOnRollover(format.iParserTag))
					DoCursorOverTag(curPos - 1, parser, start, length);
				}
			}

		MParser* parser = iParserData->iActiveParserList->ParserWithThisTag(aFormat.iParserTag);
		
		if (length && (aStartPos >= start) && (aStartPos < start + length))
			{
			if (start + length < aStartPos + aText.Length())
				aText.Set(aText.Left(start + length - aStartPos));
			if (parser != NULL)
				{
				// Only accept the rollover format if the parser agrees 
				// with the framework match of a tag
				if (parser->ConfirmCursorOverTag(*this, start, length, curPos))
					parser->GetRolloverFormat(aFormat.iCharFormat);
				else 
					// Reset format to recognised format if parser disagrees
					// with the framework match as the tag is still in view
					// and must be formatted as in the else clause below.
					parser->GetRecogniseFormat(aFormat.iCharFormat);
				}
			}
		else
			{
			if (length && (start > aStartPos))
				aText.Set(aText.Left(start - aStartPos));
			if (parser != NULL)
				parser->GetRecogniseFormat(aFormat.iCharFormat);
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:59,代码来源:Txtparse.cpp


示例2: SetSharedTextL

/**
used by concurrent tests to write shared text to aShare either appedning or overwriteing
*/
void CPerformanceFunctionalityBase::SetSharedTextL(const TDesC &aShare, const TDesC &aText, const TBool aAppend)
	{

	TPtrC txtWriteData;
	txtWriteData.Set(aText); // Copy the literal to a text buffer
	WriteSharedDataL(aShare, txtWriteData, (aAppend ? EAppendText : ESetText) ); // Data copied to shared location

	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:11,代码来源:performancefunctionalitybase.cpp


示例3: PlayFile

TInt CSoundManager::PlayFile()
{
    TPtrC file = iData->GetSelectFile();
    if (file.Compare(KNullDesC)== 0)
        return KErrNotFound;
    else
        return LoadFile(file);
}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:8,代码来源:SoundManager.cpp


示例4: DoListStoresLCL

void CNSmlDummyDataProvider_Test::DoListStoresLCL()
    {
    CDesCArray* store = iCNSmlDummyDataProvider->DoListStoresLC();
    TPtrC ptrStoreName = ( *store )[ 0 ];
    EUNIT_PRINT( ptrStoreName );
    EUNIT_ASSERT( ptrStoreName.Compare( KDefaultDBName ) == 0 );
    CleanupStack::PopAndDestroy( store );
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:8,代码来源:cnsmldummydataprovider_test.cpp


示例5: Name

TPtrC CSystemStartupStateInfo::Name() const
	{
	TPtrC retval;
	if (iName)
		{
		retval.Set(*iName);
		}
	return retval;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:9,代码来源:SystemStartupStateInfo.cpp


示例6: addressesAdded

// ----------------------------------------------------
// CUniAddressHandler::AddRecipientL
//
// Performs address(es) fetch operation.
// ----------------------------------------------------
//
EXPORT_C TBool CUniAddressHandler::AddRecipientL( TBool& aInvalid )
    {
    TBool addressesAdded( EFalse );
    aInvalid = EFalse;
    
    CMsgRecipientList* recipientList = CMsgRecipientList::NewL();
    CleanupStack::PushL( recipientList );

    CMsgRecipientArray* recipients = new ( ELeave ) CMsgRecipientArray( 10 );
    CleanupStack::PushL( TCleanupItem( CleanupRecipientArray, recipients ) );
    
    // Multiple entry fetch to get the contact    
    if ( !iCheckNames )
        {
        iCheckNames = CMsgCheckNames::NewL();
        }
        
    iCheckNames->FetchRecipientsL( *recipients, iValidAddressType );
    
    // Contacts now fetched, verify that valid address is given for every contact
    while ( recipients->Count() > 0 )
        {
        CMsgRecipientItem* recipient = recipients->At( 0 );
        
        TPtrC namePtr = recipient->Name()->Des();
        TPtrC addressPtr = recipient->Address()->Des();

        // Don't parse away chars here so this is consistent with 
        // addresses that user writes "-()" are saved to draft
        // but removed when sending
        if ( CheckSingleAddressL( addressPtr ) )
            {
            //  add it to the list of valid addresses
            recipient->SetValidated( ETrue );
            recipient->SetVerified( ( namePtr.Length() > 0 ? ETrue : EFalse ) );
            recipientList->AppendL( recipient );
            }
        else
            {
            aInvalid = ETrue;
            ShowAddressInfoNoteL( addressPtr, namePtr );
            delete recipient;
            }
        
        recipients->Delete( 0 );
        }
    
    if ( recipientList->Count() > 0 )
        {
        iControl.AddRecipientsL( *recipientList );
        addressesAdded = ETrue;
        }
 
    CleanupStack::PopAndDestroy( 2, recipientList );//recipients
    
    return addressesAdded;
    }
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:63,代码来源:uniaddresshandler.cpp


示例7: DialogWithAnimationL

void CSimpleAppUi::DialogWithAnimationL(TInt aResourceId)
	{
    TPtrC ptr;
	ptr.Set(KTBmpAnimMBMFilePath/*Application()->BitmapStoreName()*/);
	
	
	CEikDialog* dialog = new (ELeave) CAnimationDlg(ptr);
	dialog->ExecuteLD(aResourceId);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:9,代码来源:TBMPAnimStep.cpp


示例8: _LIT

/*
	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


示例9: GetChars

 void GetChars(TPtrC& aView,TCharFormat& aFormat, TInt aStartPos)const
 {
     TCharFormat cf;
     aFormat = cf;
     if (aStartPos == LdDocumentLength())
         aView.Set(KEnd);
     else
         aView.Set(iDes->Mid(aStartPos));
 }
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:9,代码来源:TCustomCharMapping.cpp


示例10: Machine

TInt CCmdShowTransaction::ProcessL(const TDesC& aCommand)
	{
	// Complete the test machine - will then get the next cmd
	Machine()->CompleteRequest();
	
	TPtrC param;
	TInt error = KErrNone;
	TRAP(error, param.Set( ParamsL(aCommand)));
	if (error != KErrNone)
		return Error(error, TFR_KFmtErrBadCmd, &Keyphrase());
	
	CObjCatalogue *trnsctns = Machine()->Domains();
	TInt iTrans = 0;

	Log(_L("\tCurrent Transactions:"));
	Log(_L("\tName  \tMethod  \tURI"));
	for (TInt i = 0; i < trnsctns->Count(); ++i)
		{
		CAnyObject *obj = (CAnyObject *)trnsctns->At(i);
		if (obj->Tag() == THA_KHTTP_Transaction)
			{
			TPtrC label = obj->Name();
			TInt eStrIndex = obj->Index();
			CTestTransaction *trans = (CTestTransaction *)obj->Ptr();
			TBuf<256> uri;
			uri.Copy (trans->Uri()) ;
									
			TPtrC mthd;
						
			switch (eStrIndex)
				{
				case HTTP::EGET : mthd.Set(THA_TxtCmdTransactionGET); break;
				case HTTP::EPOST : mthd.Set(THA_TxtCmdTransactionPOST); break;
				case HTTP::EPUT : mthd.Set(THA_TxtCmdTransactionPUT); break;
				case HTTP::EDELETE : mthd.Set(THA_TxtCmdTransactionDELETE); break;
				case HTTP::EHEAD : mthd.Set(THA_TxtCmdTransactionHEAD); break;
				case HTTP::EOPTIONS : mthd.Set(THA_TxtCmdTransactionOPTIONS); break;
				case HTTP::ETRACE : mthd.Set(THA_TxtCmdTransactionTRACE); break;
				default : break;
				}
			++iTrans;
//			if (trans->iState == CTestTransaction::EActive)
			if (trans->State() == CTestTransaction::EActive)
				{
				Log(_L("\t%d\t%S\t%S\t%S"), iTrans, 
					&label, 
					&mthd,
					&uri);
				}
			}
		}
	if (iTrans == 0)
		Log(_L("\tNo transactions have been defined"));
		
	return KErrNone;
	
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:57,代码来源:HttpTransactionCmds.cpp


示例11: _LIT

void CMemSpyEngineActiveObject::ConstructL( CMemSpyEngine& /*aEngine*/ )
    {
    TBuf<256> item;

    _LIT(KBasicFormat, "\t0x%08x\t\t");
    item.Format( KBasicFormat, VTable() );

    // Add modifiers
    _LIT( KModifiers, "%d" );
    _LIT( KBoxedCharFormat, " [%c]" );
    item.AppendFormat( KModifiers, RequestStatusValue() );
    if  ( IsActive() )
        {
        item.AppendFormat( KBoxedCharFormat, 'A' );
        }
    if  ( RequestIsPending() )
        {
        item.AppendFormat( KBoxedCharFormat, 'P' );
        }
    iCaption = item.AllocL();

    // Listbox items
    TPtrC value;

    // Address
    _LIT(KCaption1, "\tAddress\t\t0x%08x");
    item.Format( KCaption1, iAddress );
    AppendL( item );

    // vTable
    _LIT(KCaption2, "\tVTable\t\t0x%08x");
    item.Format( KCaption2, iVTable );
    AppendL( item );

    //
    _LIT(KCaption3, "\tStatus Value\t\t%d");
    item.Format( KCaption3, iRequestStatusValue );
    AppendL( item );

    //
    _LIT(KCaption5, "\tIs Active\t\t%S");
    value.Set( YesNoValue( IsActive() ) );
    item.Format( KCaption5, &value );
    AppendL( item );

    //
    _LIT(KCaption6, "\tRequest Pending\t\t%S");
    value.Set( YesNoValue( RequestIsPending() ) );
    item.Format( KCaption6, &value );
    AppendL( item );

    //
    _LIT(KCaption4, "\tPriority\t\t%d");
    item.Format( KCaption4, iPriority );
    AppendL( item );
    }
开发者ID:RomanSaveljev,项目名称:osrndtools,代码行数:56,代码来源:MemSpyEngineHelperActiveObject.cpp


示例12: new

void CHttpTypes::ReadHttpTypesFileL(const TDesC& aFileName)
{
	RFs fs;

#if EPOC_SDK >= 0x06000000
	User::LeaveIfError(fs.Connect());
	iHttpTypesArray = new (ELeave) CDesCArrayFlat(HTTP_TYPES_ARRAY_GRANURALITY);

	HBufC *config = NULL;
	// Need to TRAP leaves, because must close the fs (right).
	// Thus, no point in using the CleanupStack for config either.
	//
	TRAPD(err, config = UnicodeLoad::LoadL(fs, aFileName));
	if (err == KErrNone && config != NULL)
		{
		TLineBuffer buffer(config->Des());
		while (!buffer.EOB())
			{
			TPtrC line = buffer.ReadLine();
			if (line.Length() > 0)
				{
				TRAP(err, ParseTypeLineL(line));
				if (err != KErrNone)
					break;
				}
			}
		}
	delete config;
	User::LeaveIfError(err);

#else
	RFile cfg;
	TFileText cfgtxt;
	TBuf<256> buffer;

	User::LeaveIfError(fs.Connect());
	User::LeaveIfError(cfg.Open(fs,aFileName,EFileStreamText));

	iHttpTypesArray = new (ELeave) CDesCArrayFlat(HTTP_TYPES_ARRAY_GRANURALITY);
	
	cfgtxt.Set(cfg);
	User::LeaveIfError(cfgtxt.Seek(ESeekStart));
	
	cfgtxt.Read(buffer);
	while (buffer.Length() > 0)
	{
		ParseTypeLineL(buffer);
		cfgtxt.Read(buffer);
	}
	
	cfg.Close();
#endif
	iHttpTypesArray->Sort();

	fs.Close();
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:56,代码来源:ws_eng.cpp


示例13: testTPtrLocateReverse

LOCAL_C void testTPtrLocateReverse()
//
// Test locating in reverse on an empty TPtr
//
	{

	TPtrC a;
	test(a.LocateReverse('0')==KErrNotFound);
	test(a.LocateReverseF('0')==KErrNotFound);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:10,代码来源:t_des.cpp


示例14: LeaveIfFileParamsNotValidL

//Add aItem to DSC at aPos
void CDscDatabase::AddItemL(CDscItem& aItem, TDscPosition aPos)
	{
	//Leave if DB is opened for enumeration
	if (iIsEnumOpened)
		{
		User::Leave(KErrLocked);
		}
	
	//verify data integrity,
	LeaveIfFileParamsNotValidL(aItem);
	if(aItem.ItemId() != 0)
		{
		User::Leave(KErrArgument);
		}

	//Start transaction
	DatabaseBeginLC();

	//Leave if aDscId doesn't exist
	if (!DscExistsL(aItem.DscId()))
		{
		User::Leave(KErrNotFound);
		}

	//Leave if aItem exists
	if (ItemExistsL(aItem))
		{
		User::Leave(KErrAlreadyExists);
		}

	const TPtrC filename = aItem.FileName();
	const TPtrC argList = aItem.Args();	//whitespace already trimmed
	const TInt itemId = GetNextItemIdL(aPos, aItem.DscId());
	
	RBuf sqlCmd;
	CleanupClosePushL(sqlCmd);
	sqlCmd.CreateL(KSqlInsertDscItemLength + filename.Length() + argList.Length());
	
	//insert the item
	sqlCmd.Format(KSqlInsertDscItem, &KItemTable, &KDscIdCol, &KItemIdCol, &KFileNameCol, &KArgListCol,
				&KStartMethodCol, &KTimeoutCol, &KNoOfRetriesCol, &KMonitorCol, &KStartupTypeCol,
				&KViewlessCol, &KStartInBackgroundCol, aItem.DscId(), itemId, &filename, &argList, aItem.StartMethod(),
				aItem.Timeout(), aItem.NoOfRetries(), aItem.Monitored(),
				aItem.StartupType(), aItem.Viewless(), aItem.StartInBackground());

	DebugPrint(sqlCmd);
	
	User::LeaveIfError(iDatabase.Execute(sqlCmd));
	CleanupStack::PopAndDestroy(&sqlCmd);
	DatabaseCommitL(); //CommitL + CleanupStack::Pop()
	
	//Now aItem is persistent, set the ItemId so it can be read by the client
	aItem.SetItemId(itemId);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:55,代码来源:dscdatabase.cpp


示例15: SetStepOver

TBool CCmdRemark::Recognize( const TDesC& aCommand  )
{
// Obey the command family's step over mode.
SetStepOver(Family()->StepOver());

// Check if is empty or begins with # character.
TPtrC cmd = TfrLex::Trim(aCommand);

//	look for empty, # or //
return ((cmd.Length() == 0) || (cmd.Match( _L("#*")) == 0) || (cmd.Match(_L("//*")) == 0 ));
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:11,代码来源:CCmdStandard.cpp


示例16: IsAdaptiveFindMatchClassic

inline TBool IsAdaptiveFindMatchClassic( const TDesC& aItemString, const TDesC& aSearchText )
    {
    TPtrC itemptr = aItemString;
    TPtrC searchptr = aSearchText;

    TBool match = EFalse;
    
    for(;;) 
        {
        // Loop invariant: itemptr is next character from ' ' or '-'
        // Loop invariant: seachptr is at beginning of searched item
    
        TInt val = MyFindC(itemptr,searchptr);
        if (val == 0)
            {
            match = ETrue;
            break;
            }
        if (val != KErrNotFound && IsFindWordSeparator(itemptr[val-1]))
            {
            match = ETrue;
            break;
            }

        // find the word separator characters from list item
        TInt spacepos = itemptr.LocateF(TChar(' '));
        TInt minuspos = itemptr.LocateF(TChar('-'));
        TInt tabpos = itemptr.LocateF(TChar('\t'));
        if (spacepos != KErrNotFound)
            {
            itemptr.Set(itemptr.Mid(spacepos+1));
            }
        else if (minuspos != KErrNotFound)
            {
            itemptr.Set(itemptr.Mid(minuspos+1));
            }
        else if (tabpos != KErrNotFound)
            {
            itemptr.Set(itemptr.Mid(tabpos+1));
            }
        else
            {
            match = EFalse;
            break;
            }
        if (itemptr.Length() == 0)
            {
            match = EFalse;
            break;
            }

        }
    return match;
    }	
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:54,代码来源:FindUtilWestern.cpp


示例17: INFO_PRINTF1

TInt COpenRSubConnectionStep::ConfigureFromIni()
	{
	iParams.Reset();
	
	// Read in appropriate fields
	if((GetStringFromConfig(iSection, KTe_SubConnectionName, iParams.iSubConnectionName) != 1)
		|| (iParams.iSubConnectionName.Length() == 0))
		{
		INFO_PRINTF1(_L("Couldn't find appropriate field in config file"));
		return KErrNotFound;
		}
		
    if (GetStringFromConfig(iSection,KTe_SocketServName,iParams.iSockServName)!=1)
        {
        INFO_PRINTF2(_L("%S: Socket server name missing."),&iParams.iSubConnectionName);
        return KErrNotFound;
        }

    if (GetStringFromConfig(iSection,KTe_ConnectionName,iParams.iConnectionName)!=1)
        {
        INFO_PRINTF2(_L("%S: Connection name missing."),&iParams.iSubConnectionName);
        return KErrNotFound;
        }

	TPtrC subConnTypeName;
    if (GetStringFromConfig(iSection,KTe_SubConnectionTypeName,subConnTypeName)!=1)
        {
        INFO_PRINTF2(_L("%S: SubConnection type missing."),&iParams.iSubConnectionName);
        return KErrNotFound;
        }

    if (subConnTypeName.Compare(KTe_SubConnectionTypeAttach)==0)
	    { iParams.iSubConnType = RSubConnection::EAttachToDefault; }
    else if (subConnTypeName.Compare(KTe_SubConnectionTypeNew)==0)
	    { iParams.iSubConnType = RSubConnection::ECreateNew; }
    else
       {
       INFO_PRINTF3(_L("%S: SubConnection type (%S) not recognised."),&iParams.iSubConnectionName,&subConnTypeName);
       return KErrNotFound;
       }

	if (!GetIntFromConfig(iSection, KExpectedError, iExpectedError))  
       {
       	iExpectedError = KErrNone;
       }

       else
       {
       	INFO_PRINTF2(_L("Error to be expected: %d"),iExpectedError);
       }

    // All ok if we got this far
    return KErrNone;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:54,代码来源:SubConnections.TestSteps.cpp


示例18: Machine

TInt CCmdConnect::ProcessL( const TDesC& aCommand )
{
	// Complete the test machine - will then get the next cmd
	Machine()->CompleteRequest();

	TPtrC framework;
	TPtrC conname;

	TInt error;
	if (( error = ParseCmdArgs( aCommand, framework, conname )) != KErrNone)
		return error;
	
	if (conname.Size() != 0)
		{		
		//	Check if the connection already is defined. 
		//	If it is return error, if not create a session and ptr!
		CAnyObject *cnx = (CAnyObject *)Machine()->Domains()->Name(conname);
	
		if (cnx != NULL)		//	already exists
			return Error(KErrAlreadyExists, THA_KErrCnxionExists, &conname);
		else
			{
			CFrmwrkSession *cithc = CFrmwrkSession::NewLC(conname, framework, Machine());
			cithc->iEventDispatcher = iEventDispatcher ;

			TRAPD(error, cithc->OpenL());
			if (error == KErrNone)
				{
				cithc->SetPropertiesL();
			
				TRAP(error, cithc->ConnectL());
				
				if (error == KErrNone)
					{
					//	now create reference to name in domains
					//	note: the value is 1 for HTTP and 0 for WSP
					Machine()->Domains()->AddL(conname, 0, THA_KHTTP_Connect, (TAny *) cithc);
					WriteDateStamp();
					Log(_L("Connection '%S' has been opened!"), &conname);
					}
				else
					Error(error, KTxtErrConnectFailed);
				}
			
			CleanupStack::Pop();	// cithc
			}
		}
	else
		{		
		(void) ShowSessions () ;
		}

	return error;
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:54,代码来源:HttpSessionCmds.cpp


示例19: Peel

TPtrC TfrLex::Peel( const TDesC& aText )
{
TPtrC result;
TInt  length = aText.Length();
if ( length >= 2 && (aText[0] == '"' && aText[length-1] == '"') )
	result.Set( aText.Mid(1,length-2) );
else
	result.Set( aText );

return result;
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:11,代码来源:TfrLex.cpp


示例20: CleanupClosePushL

// ---------------------------------------------------------
// CPosTp52::CheckLongCategoryNameL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CPosTp52::CheckLongCategoryNameL(TInt aNumExpectedCategories )
{
    iLog->Log(_L("CheckLongCategoryNameL"));
    // Should only exist one landmark in db
    CPosLandmark* lm = iDatabase->ReadLandmarkLC(1);

    RArray<TPosLmItemId> array;
    CleanupClosePushL(array);
    lm->GetCategoriesL(array);
    TInt nr = array.Count();
    TPtrC name;

    _LIT(KLONGNAME1, "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234");
    _LIT(KLONGNAME2, "Pizzeria10Pizzeria20Pizzeria30Pizzeria40Pizzeria50Pizzeria60Pizzeria70Pizzeria80Pizzeria90Pizzeria10Pizzeria10Pizzeria20Pizz");
    _LIT(KLONGNAME3, "Gizzeria10Gizzeria20Gizzeria30Gizzeria40Gizzeria50Gizzeria60Gizzeria70Gizzeria80Gizzeria90Gizzeria10Gizzeria10Gizzeria20_ABC");
    _LIT(KLONGNAME4, "Dizzeria10Dizzeria20Dizzeria30Dizzeria40Dizzeria50Dizzeria60Dizzeria70Dizzeria80Dizzeria90Dizzeria10Dizzeria10Dizzeria20_ABC");

    const TInt numNames = 4;
    const TPtrC names[] = { KLONGNAME1(), KLONGNAME2(), KLONGNAME3(), KLONGNAME4() };

    if (nr != aNumExpectedCategories) //LogErrorAndLeave(_L("Wrong number of categories for landmark"));
    {
        iLog->Log(_L("Wrong number of categories for landmark"));
        User::Leave(-1);
    }

    CPosLmCategoryManager* categoryManager = CPosLmCategoryManager::NewL(*iDatabase);
    CleanupStack::PushL(categoryManager);

    for ( TInt i = 0; i < aNumExpectedCategories; i++ )
    {
        CPosLandmarkCategory* cat = categoryManager->ReadCategoryLC(array[i]);

        cat->GetCategoryName(name);
        // Maximum size for category name is 124 characters
        if (name.Length() != 124)
        {
            iLog->Log(_L("Category name has wrong size, should be 124"));
            User::Leave(-1);

        }
        if (name.Compare(names[i]) != 0)
        {
            iLog->Log(_L("Long category name does not match"));
            iErrorsFound++;
        }
        CleanupStack::PopAndDestroy(cat);
    }

    CleanupStack::PopAndDestroy(categoryManager);

    CleanupStack::PopAndDestroy(&array);
    CleanupStack::PopAndDestroy(lm);
}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:60,代码来源:FT_CPosTp52.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TPtrC8类代码示例发布时间:2022-05-31
下一篇:
C++ TPtr8类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap