本文整理汇总了C++中TName::Length方法的典型用法代码示例。如果您正苦于以下问题:C++ TName::Length方法的具体用法?C++ TName::Length怎么用?C++ TName::Length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TName
的用法示例。
在下文中一共展示了TName::Length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitialisePhoneL
/**
Function to initialize the phone settings
@return TBool
*/
TBool CMBMSEngine::InitialisePhoneL()
{
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
CMDBSession* dbSession = CMDBSession::NewL(KCDVersion1_2);
#else
CMDBSession* dbSession = CMDBSession::NewL(KCDVersion1_1);
#endif
CleanupStack::PushL(dbSession);
CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
if(err != KErrNone)
{
User::Leave(KErrNotFound);
}
CCDModemBearerRecord *modemBearerRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
CleanupStack::PushL(modemBearerRecord);
modemBearerRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS);
TRAPD(err1,modemBearerRecord->LoadL(*dbSession));
if(err1 != KErrNone)
{
User::Leave(KErrNotFound);
}
TName tsyName;
tsyName = modemBearerRecord->iTsyName;
//leave if not able to read Tsy name.
if(tsyName.Length() == 0)
{
User::Leave(KErrNotFound);
}
CleanupStack::PopAndDestroy(modemBearerRecord);
CleanupStack::PopAndDestroy(dbSession);
User::LeaveIfError(iTelServer.Connect());
User::LeaveIfError(iTelServer.LoadPhoneModule(tsyName));
User::LeaveIfError(iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended));
//Open telephony server
GetPhoneInfoL(iTelServer,tsyName,iPhoneInfo);
//Open phone
User::LeaveIfError(iPhone.Open(iTelServer,iPhoneInfo.iName));
//Get phone status
User::LeaveIfError(iPhone.GetStatus(iPhoneStatus));
SetActive();
iPhoneState = EInitialising;
TRequestStatus* status = &iStatus;
User::RequestComplete(status, KErrNone);
return ETrue;
}
示例2: IdentifyChunkType
TMemSpyDriverChunkType DMemSpyDriverLogChanChunks::IdentifyChunkType( DChunk& aChunk )
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - START" ) );
TMemSpyDriverChunkType ret = EMemSpyDriverChunkTypeUnknown;
TName name;
aChunk.Name( name );
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - name: %S", &name ) );
DMemSpyDriverOSAdaptionDChunk& chunkAdaption = OSAdaption().DChunk();
const TChunkType type = chunkAdaption.GetType( aChunk );
if ( name == KMemSpyLitDllDollarData )
{
// This chunk contains Dll Global Data for the process
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeGlobalData" ) );
ret = EMemSpyDriverChunkTypeGlobalData;
}
else if ( type == ERamDrive )
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeRamDrive" ) );
ret = EMemSpyDriverChunkTypeRamDrive;
}
else if ( type == EKernelStack )
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeStackKernel" ) );
ret = EMemSpyDriverChunkTypeStackKernel;
}
else if ( name == KMemSpyLitDollarDat )
{
// This chunk contains process global data as well as user-side stacks for
// the process.
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeStackAndProcessGlobalData" ) );
ret = EMemSpyDriverChunkTypeStackAndProcessGlobalData;
}
else if ( name == KMemSpyLitDollarGlobalCode && type == EDll )
{
// GLOBAL$CODE is used for RAM loaded code which is globally visible. This
// basically means locale DLLs - these must be visible to every process, even
// those which haven't loaded them.
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeCodeGlobal" ) );
ret = EMemSpyDriverChunkTypeCodeGlobal;
}
else if ( name == KMemSpyLitDollarCode || type == EKernelCode || type == EDll || type == EUserCode )
{
// RAM-loaded code, which on the multiple memory model at least means that the code chunk is eseentially just a mapping
// artifact. The RAM itself is owned by the code segment, therefore counting the size of these CODE elements may result
// in inaccurate results if the code is shared amongst multiple processes.
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeCode" ) );
ret = EMemSpyDriverChunkTypeCode;
}
else if ( type == EUserSelfModCode )
{
// Dynamically create code chunk
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeCodeSelfModifiable" ) );
ret = EMemSpyDriverChunkTypeCodeSelfModifiable;
}
else if ( IsHeapChunk( aChunk, name ) )
{
// Catch kernel heap too
if ( type == EKernelData )
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeHeapKernel" ) );
ret = EMemSpyDriverChunkTypeHeapKernel;
}
else
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeHeap" ) );
ret = EMemSpyDriverChunkTypeHeap;
}
}
else if ( type == EUserData && chunkAdaption.GetOwningProcess( aChunk ) == NULL )
{
// Global shared chunks match this pattern. Of course, we could check the memory model mapping attributes
// as that would give us the info in a heartbeat, but it's too specific.
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeGlobal" ) );
ret = EMemSpyDriverChunkTypeGlobal;
}
else if ( type == EUserData && chunkAdaption.GetOwner( aChunk ) != NULL && name.Length() > KMemSpyLitLocalObject().Length() && name.Left( KMemSpyLitLocalObject().Length() ) == KMemSpyLitLocalObject )
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeLocal" ) );
ret = EMemSpyDriverChunkTypeLocal;
}
else
{
TRACE( Kern::Printf("DMemSpyDriverLogChanChunks::IdentifyChunkType() - EMemSpyDriverChunkTypeUnknown" ) );
TRACE( PrintChunkInfo( aChunk ) );
ret = EMemSpyDriverChunkTypeUnknown;
}
return ret;
}