本文整理汇总了C++中TName::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ TName::Left方法的具体用法?C++ TName::Left怎么用?C++ TName::Left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TName
的用法示例。
在下文中一共展示了TName::Left方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsConnectionL
// ---------------------------------------------------------
// CActiveDisconnectDlgPlugin::IsConnectionL
// ---------------------------------------------------------
//
TBool CActiveDisconnectDlgPlugin::IsConnectionL(
CConnectionInfo* aConnectionInfo )
{
CLOG_ENTERFN( "CActiveDisconnectDlgPlugin::IsConnectionL" );
TBool result( EFalse );
TUint i( 0 );
TUint connectionCount( 0 );
TUint connNum( 0 );
TUint subConnectionCount( 0 );
TUint connId( 0 );
TInt bearer( 0 );
TInt connStatus( 0 );
//TRequestStatus status;
TName apName;
RConnectionMonitor connMon;
result = connMon.ConnectL();
CLOG_WRITEF( _L( "result: %d" ), result );
CDisconnectDlgActiveWaiter* waiter = CDisconnectDlgActiveWaiter::NewL();
CleanupStack::PushL( waiter );
connMon.GetConnectionCount( connNum, waiter->iStatus );
waiter->WaitForRequest();
//User::WaitForRequest( status );
CLOG_WRITEF( _L( "status: %d" ), waiter->iStatus.Int() );
CLOG_WRITEF( _L( "connNum: %d" ), connNum );
for( i = 1; i < ( connNum + 1 ) && !connectionCount; ++i )
{
connMon.GetConnectionInfo( i, connId, subConnectionCount );
connMon.GetStringAttribute( connId, 0, KIAPName, apName, waiter->iStatus );
waiter->WaitForRequest();
//User::WaitForRequest( status );
CLOG_WRITEF( _L( "KIAPName status: %d" ), waiter->iStatus.Int() );
connMon.GetIntAttribute( connId, 0, KBearer, bearer, waiter->iStatus );
waiter->WaitForRequest();
//User::WaitForRequest( status );
CLOG_WRITEF( _L( "KBearer status: %d" ), waiter->iStatus.Int() );
connMon.GetIntAttribute( connId, 0, KConnectionStatus, connStatus,
waiter->iStatus );
waiter->WaitForRequest();
//User::WaitForRequest( status );
CLOG_WRITEF( _L( "KConnectionStatus status: %d" ), waiter->iStatus.Int() );
TUint iapId( 0 );
connMon.GetUintAttribute( connId, 0, KIAPId, iapId, waiter->iStatus );
waiter->WaitForRequest();
//User::WaitForRequest( status );
CLOG_WRITEF(_L( "KIAPId status: %d" ), waiter->iStatus.Int() );
CLOG_WRITEF(_L( "iapId: %d" ), iapId );
TConnMonTimeBuf timeBuf;
connMon.GetPckgAttribute( connId, 0, KStartTime, timeBuf, waiter->iStatus );
waiter->WaitForRequest();
CLOG_WRITEF(_L( "KStartTime status: %d" ), waiter->iStatus.Int() );
switch( bearer )
{
case EBearerGPRS :
case EBearerEdgeGPRS :
case EBearerExternalGPRS :
case EBearerExternalEdgeGPRS :
case EBearerWCDMA :
case EBearerExternalWCDMA :
#ifdef __WINS__
case EBearerLAN :
#endif // WINS
{
if ( ( connStatus == KLinkLayerOpen ) ||
( connStatus == KConnectionOpen &&
bearer >= EBearerExternalCSD ) )
{
apName.Trim();
if( apName.Left( KMrouterName().Length() ).
CompareF( KMrouterName ) )
{
++connectionCount;
aConnectionInfo->SetIapNameL( apName );
aConnectionInfo->SetBearerType( bearer );
aConnectionInfo->SetConnId( connId );
aConnectionInfo->SetIAPId( iapId );
aConnectionInfo->SetStartTime( timeBuf() );
TConnMonClientEnumBuf clientEnum;
connMon.GetPckgAttribute( connId, 0, KClientInfo,
clientEnum, waiter->iStatus );
waiter->WaitForRequest();
//.........这里部分代码省略.........
示例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;
}