void CMemSpyEngineHelperSysMemTrackerCycleChangeOpenFile::OutputContentL( CMemSpyEngineOutputSink& aSink, CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ ) { _LIT( KFormat, "%S,%S,%S,%d,%d,%S" ); // TMemSpySWMTTypeName type;; FormatType( type ); // TBuf<20> attribs; FormatAttributes( attribs ); // HBufC* buf = HBufC::NewLC( 1024 ); TPtr pBuf( buf->Des() ); // Now output line pBuf.Format( KFormat, &type, iFileName, iThreadName, iSize, iUniqueFileId, &attribs ); aSink.OutputLineL( pBuf ); CleanupStack::PopAndDestroy( buf ); }
void CMemSpyEngineHelperSysMemTrackerCycleChangeGlobalData::OutputContentL( CMemSpyEngineOutputSink& aSink, CMemSpyEngineHelperSysMemTrackerCycle& /*aCycle*/ ) { _LIT( KFormat, "%S,%S,%S,0x%08x,0x%08x,%d,%d,%S" ); // TMemSpySWMTTypeName type;; FormatType( type ); // TBuf<20> attribs; FormatAttributes( attribs ); // HBufC* buf = HBufC::NewLC( 1024 ); TPtr pBuf(buf->Des()); // Try to get associated process name TPtrC pProcessName( KNullDesC ); CMemSpyEngine& engine = aSink.Engine(); const TInt procIndex = engine.Container().ProcessIndexById( iCurrent.iOwnerId ); if ( procIndex >= 0 ) { CMemSpyProcess& process = engine.Container().At( procIndex ); pProcessName.Set( process.Name() ); } // Now output line pBuf.Format( KFormat, &type, &pProcessName, iChunkName, iCurrent.iHandle, iCurrent.iBaseAddress, iCurrent.iSize, iCurrent.iMaxSize, &attribs ); aSink.OutputLineL( pBuf ); CleanupStack::PopAndDestroy( buf ); }
CString CItem::GetText(int subitem) const { CString s; switch (subitem) { case COL_NAME: s = m_name; break; case COL_SUBTREEPERCENTAGE: if (IsDone()) { ASSERT(m_readJobs == 0); //s = "ok"; } else { if (m_readJobs == 1) s.LoadString(IDS_ONEREADJOB); else s.FormatMessage(IDS_sREADJOBS, FormatCount(m_readJobs)); } break; case COL_PERCENTAGE: if (GetOptions()->IsShowTimeSpent() && MustShowReadJobs() || IsRootItem()) { s.Format(_T("[%s s]"), FormatMilliseconds(GetTicksWorked())); } else { s.Format(_T("%s%%"), FormatDouble(GetFraction() * 100)); } break; case COL_SUBTREETOTAL: s = FormatBytes(GetSize()); break; case COL_ITEMS: if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN) s = FormatCount(GetItemsCount()); break; case COL_FILES: if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN) s = FormatCount(GetFilesCount()); break; case COL_SUBDIRS: if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN) s = FormatCount(GetSubdirsCount()); break; case COL_LASTCHANGE: if (GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN) { s = FormatFileTime(m_lastChange); } break; case COL_ATTRIBUTES: if (GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN && GetType() != IT_MYCOMPUTER && GetType() != IT_FILESFOLDER) { s = FormatAttributes(GetAttributes()); } break; default: ASSERT(0); break; } return s; }