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


C++ TDes::Length方法代码示例

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


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

示例1: GetDebugConnStatus

//
// RTrkSrvCliSession::GetDebugConnStatus()
//
TInt RTrkSrvCliSession::GetDebugConnStatus(TTrkConnStatus& aConnStatus, TDes& aConnMsg)
{    
    TPckg<TTrkConnStatus> package(aConnStatus);
	TIpcArgs args(&package, aConnMsg.Length(), &aConnMsg);
	
	return SendReceive(ETrkSrvCmdGetDebugConnStatus, args);
}
开发者ID:fedor4ever,项目名称:devicedbgsrvs,代码行数:10,代码来源:trksrvclisession.cpp

示例2: DeleteDatabaseL

/**
Delete an existing Contacts database file.

@param aCntFile Contacts database filename.
*/
void CCntDbManagerController::DeleteDatabaseL(TDes& aCntFile) const
	{
	// Deal with default Contacts database file (indicated by empty descriptor).
	if(aCntFile.Length() == 0)
		{
		DefaultDatabaseL(aCntFile); // Get the default database name.
		}
		
	// Release the internal reference to the manager if the internal
	// permanent data is the only object holding it open.
	if (iPermanentData)
		{
		CCntDbManager* manager = DbManagerL(aCntFile);
		if (manager && iPermanentData->IsOnlyClientOfDbManager(manager))
			{
			iPermanentData->ReleaseDbManagerL(manager);
			}
		}
	
	// Make sure there is not an existing CCntDbManager session.
	if(FindExistingFileManager(aCntFile) != KErrNotFound)
		{
		User::Leave(KErrInUse);
		}
	else
		{
		// Delete the backup registration file associated with the Contacts
		// database file.
		iBackupRestoreAgent->DeleteBackupRegistrationFileL(aCntFile);
		// Call the Persistence Layer to delete the Contacts database file.
		iPersistenceLayer->ContactsFileL().DeleteL(aCntFile);
		}
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:38,代码来源:ccntdbmanagercontroller.cpp

示例3: GetOperatorNameSync

void CPhone::GetOperatorNameSync(TDes& aOperatorName)
	{
	if (IsActive())
		{
		Cancel();
		}
	/*
	CTelephony::TOperatorNameV1Pckg operatorNamePckg(iOpName);
	iTelephony->GetOperatorName(iStatus,operatorNamePckg);
	iFunc = EOperatorName; 
	SetActive();
	StartWait();
	iFunc = ENoneFunc;
	aOperatorName.Copy(iOpName.iOperatorName);
	*/
	CTelephony::TNetworkInfoV1Pckg netInfoPckg(iNetInfo);
	iTelephony->GetCurrentNetworkInfo(iStatus,netInfoPckg);
	iFunc = ECellID;
	SetActive();
	StartWait();
	iFunc = ENoneFunc;
	aOperatorName.Copy(iNetInfo.iShortName);
	if (aOperatorName.Length() == 0)
		{
			aOperatorName.Copy(iNetInfo.iLongName);
		}
		
	}
开发者ID:BwRy,项目名称:core-symbian,代码行数:28,代码来源:Phone.cpp

示例4: convertStoreNameL

void CntSimStorePrivate::convertStoreNameL(TDes &storeName)
{
    if(storeName.MaxLength() < RMobilePhoneBookStore::KMaxPBIDSize) {
        User::Leave(KErrArgument);
    }

    if (m_storeInfo.m_storeName.isEmpty()) {
        // Default to ADN store
        m_storeInfo.m_storeName = (QLatin1String) KParameterValueSimStoreNameAdn;
        storeName.Copy(KETelIccAdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameFdn) {
        storeName.Copy(KETelIccFdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameAdn) {
        storeName.Copy(KETelIccAdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameSdn) {
        storeName.Copy(KETelIccSdnPhoneBook);
    } else if (m_storeInfo.m_storeName == KParameterValueSimStoreNameOn) {
        storeName.Copy(KETelOwnNumberStore);
    }

    // Check that we got a valid store name
    if(storeName.Length() == 0) {
        User::Leave(KErrArgument);
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:25,代码来源:cntsimstoreprivate.cpp

示例5:

// -----------------------------------------------------------------------------
// Converts from TDesC to TDesC8
// -----------------------------------------------------------------------------
//
void ConnMonUtils::TDesToTDes8( const TDes& aSrc, TDes8& aDest )
    {
    for ( TUint i = 0; i < aSrc.Length(); ++i )
        {
        aDest.Append( aSrc[i] & 0x00FF );
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:11,代码来源:ConnMonUtils.cpp

示例6: ConvertStringToUnicode

 /* if no length is specified, the whole string is converted */
 int ConvertStringToUnicode(const unsigned char* aText, TDes& aDesc,
                            int aLength)
 {
   if( aText != NULL ) {
     /* initialize variables */
     aDesc.Zero();
     int textlen;
       /* check the length of the string */
       if( aLength == -1 ) {
       textlen = strlen((char*)aText);
     } else {
         textlen = aLength;
      }
      /* start copying the string if it's not zero-length */
     if( textlen > 0 ) {
       /* compensate for longer text than descriptor */
        if( textlen >= aDesc.MaxLength() ){
          textlen = aDesc.MaxLength()-1;
       }
       /* copy the data */
       for( TInt j=0; j < textlen; j++ )
          {
             aDesc.Append( aText[j] );
          }
       aDesc.PtrZ();
       }
   }else{
       return(0);
    }
   return(aDesc.Length());
 }
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:32,代码来源:MapUtility.cpp

示例7: Overflow

/** Methods from TDesOverflow
	@param aDes modifiable descriptor whose overflow results in the call to this overflow handler.
*/
EXPORT_C void TTimerLogger::Overflow(TDes& aDes)
	{
	#if defined (__LOG_PERFORMANCE) && !defined (_DEBUG)
	// Overflow has occured - end log line with '...'
	_LIT(KErrOverflowMsg, "...");
	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
		aDes.Append(KErrOverflowMsg);
	#endif
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:12,代码来源:TimerLogger.cpp

示例8: Overflow

EXPORT_C
#ifdef _DEBUG
void THttpLogger::Overflow(TDes& aDes)
	{
	// Overflow has occured - end log line with '...'
	_LIT(KErrOverflowMsg, "...");
	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
		aDes.Append(KErrOverflowMsg);
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:9,代码来源:httplogger.cpp

示例9: ChangePathSeparator

void ChangePathSeparator( TDes& aDesPtr, TUint aPathSeperatorFrom, TUint aPathSeperatorTo )
	{
	for( TInt offset = aDesPtr.Length() - 1; offset >= 0; offset-- )
		{
		if ( aDesPtr[offset] == aPathSeperatorFrom )
			{	
				aDesPtr[offset] = TUint16( aPathSeperatorTo );
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:10,代码来源:testwebbrowser.cpp

示例10:

void CntFilterDetail::TMatch::stripOutNonDigitChars(TDes& text)
{
    for (TInt chrPos = 0; chrPos < text.Length(); ++chrPos) {
        TChar chr = text[chrPos];
        if (!chr.IsDigit()) {
            text.Delete(chrPos, 1);
            --chrPos;
        }
    }
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:10,代码来源:cntfilterdetail.cpp

示例11: RemoveRichtextFormating

EXPORT_C void CTestUtils::RemoveRichtextFormating(TDes& aSourceLine)
	{
	TUint8* ptr = (TUint8*)aSourceLine.Ptr();
	TUint8* start = ptr;

	TInt totalLength = aSourceLine.Length()*2;
	do {
		if(*ptr==CEditableText::EParagraphDelimiter || *ptr==CEditableText::ELineBreak || *ptr==CEditableText::EPageBreak)
			*ptr=0x0A;
		} while((++ptr-start)<totalLength);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:11,代码来源:MsvTestUtilsBase.cpp

示例12: GetStringFromConsole

//*******************************************************************************
// Method      : CTestAppConsole::GetAddrFromConsole()
// Purpose     : 
// Parameters  : 
// Return Value: 
//*******************************************************************************
TKeyCode CTestAppConsole::GetStringFromConsole(TDes &aAddr)
    {
	// Get a line from console
    TKeyCode input = EKeyNull;
    const TInt start_pos = iConsole->WhereX();
    aAddr.Zero();

    // loop until descriptor full or EKeyEnter or EKeyEscape entered
    do {
        // get one character
        input = iConsole->Getch();
        // process it
        if(input == EKeyBackspace  ||  input == EKeyDelete)
            {
            // backspace or delete
            if(iConsole->WhereX() > start_pos)
                {
				iConsole->SetPos(iConsole->WhereX() - 1);
				iConsole->ClearToEndOfLine();
				if(aAddr.Length() > 0) 
                    {
					aAddr.SetLength(aAddr.Length() - 1);
                    }
                }
            }
        else
            {
            // other than backspace or delete
            TChar ch(input);
            if(ch.IsPrint())
                {
                aAddr.Append(ch);
                iConsole->Printf(_L("%c"), input);
                }
            }   
        } 
    while(aAddr.Length() < aAddr.MaxLength()  &&  input != EKeyEnter  &&  input != EKeyEscape);

    DisplayMsg(KTxtLineBreak);
    return input;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:47,代码来源:testconsole.cpp

示例13:

/**
Strip out any non-digit characters before we convert the phone number to an
integer.

@param aText Phone number which on return will have any non-digit characters
removed.
*/
void CPplCommAddrTable::TMatch::StripOutNonDigitChars(TDes& aText)
	{
	for(TInt chrPos = 0; chrPos < aText.Length(); ++chrPos)
		{
		TChar chr = aText[chrPos];
		if (!chr.IsDigit() )
			{
			aText.Delete(chrPos, 1);
			--chrPos;
			}
		}
	}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:19,代码来源:cpplcommaddrtable.cpp

示例14: ReverseDescriptor

void ReverseDescriptor( TDes& aPtr )
    {
    TInt count = aPtr.Length();
    TInt halfCount = count/2; // rounded down
    TInt target(count-1);
    for ( TInt index = 0; index < halfCount; index++, target-- )
        {
        TText temp = aPtr[target];
        aPtr[target] = aPtr[index];
        aPtr[index] = temp;
        }   
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:12,代码来源:AknPhoneNumberTextUtils.cpp

示例15: GetSuggestedOutputFileName

TInt CRefTestAgentImportFile::GetSuggestedOutputFileName(TDes& aFileName)
	{
	TInt ret = iImporter->GetSuggestedOutputFileName(aFileName);
	if (ret == KErrNone && aFileName.Length() == 0)
		{
		// This means the imported archive has no rights.
		// Will just suggest the "output.content" to client.
		TParsePtrC parse(*iSuggestedFileName);
		aFileName.Copy( parse.NameAndExt() );
		}
	return ret;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:12,代码来源:Reftestagentimportfile.cpp


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