Ejemplo n.º 1
0
CString CDirstatView::GenerateReport()
{
	CString report= GetOptions()->GetReportPrefix() + _T("\r\n");

	CItem *root= GetDocument()->GetSelection();
	ASSERT(root != NULL);
	ASSERT(root->IsVisible());

	int r= m_treeListControl.FindTreeItem(root);
	
	for (
		int i=r; 
			i < m_treeListControl.GetItemCount() 
			&& (i == r || m_treeListControl.GetItem(i)->GetIndent() > root->GetIndent());
		i++
	)
	{
		CItem *item= (CItem *)m_treeListControl.GetItem(i);
		
		if (item->GetType() == IT_MYCOMPUTER)
			continue;

		report.AppendFormat(_T("%s %s\r\n"), PadWidthBlanks(FormatLongLongHuman(item->GetSize()), 11), item->GetReportPath());
	}

	report+= _T("\r\n\r\n");
	report+= GetOptions()->GetReportSuffix();

	return report;
}
Ejemplo n.º 2
0
CString CDirstatApp::GetCurrentProcessMemoryInfo()
{
	UpdateMemoryInfo();

	if (m_workingSet == 0)
		return _T("");

	CString n= PadWidthBlanks(FormatBytes(m_workingSet), 11);

	CString s;
	s.FormatMessage(IDS_RAMUSAGEs, n);

	return s;
}