本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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 );
}
}
示例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());
}
示例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
}
示例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);
}
示例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 );
}
}
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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;
}
}
}
示例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;
}
}
示例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;
}