本文整理汇总了C++中CHexEditApp::GetFileList方法的典型用法代码示例。如果您正苦于以下问题:C++ CHexEditApp::GetFileList方法的具体用法?C++ CHexEditApp::GetFileList怎么用?C++ CHexEditApp::GetFileList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHexEditApp
的用法示例。
在下文中一共展示了CHexEditApp::GetFileList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_header
CString CHexEditView::create_header(const char *fmt, long pagenum)
{
bool bDiskFile = GetDocument()->pfile1_ != NULL;
bool bDevice = bDiskFile && GetDocument()->IsDevice();
CString retval; // Return string
CString sin = fmt; // Rest of input string
int pos; // Posn in string of param.
CString ss; // Temporary string
CHexFileList *pfl = theApp.GetFileList();
int ii = -1;
if (GetDocument()->pfile1_ != NULL) // make sure there is a disk file (pfl requires a disk file name)
ii = pfl->GetIndex(GetDocument()->pfile1_->GetFilePath());
CFileStatus status; // Get status of file (for times)
if (bDiskFile && !bDevice)
GetDocument()->pfile1_->GetStatus(status);
while ((pos = sin.Find("&")) != -1)
{
retval += sin.Left(pos);
if (sin.GetLength() > pos + 1)
{
switch (toupper(sin[pos+1]))
{
case 'F':
if (bDiskFile)
retval += GetDocument()->pfile1_->GetFileName();
break;
case 'A':
if (bDevice)
retval += GetDocument()->pfile1_->GetFileName();
else if (bDiskFile)
retval += GetDocument()->pfile1_->GetFilePath();
break;
case 'P':
ss.Format("%ld", long(pagenum));
retval += ss;
break;
case 'D':
retval += print_time_.Format("%x");
break;
case 'T':
retval += print_time_.Format("%X");
break;
case 'N':
retval += print_time_.Format("%#c");
break;
case 'C':
if (bDiskFile && !bDevice)
retval += status.m_ctime.Format("%c");
break;
case 'M':
if (bDiskFile && !bDevice)
retval += status.m_mtime.Format("%c");
break;
#if 0 // Since we have the file open the last access time is now so don't bother with this one
case 'U':
if (bDiskFile && !bDevice)
retval += status.m_atime.Format("%c");
break;
#endif
case 'G':
if (ii > -1)
retval += pfl->GetData(ii, CHexFileList::CATEGORY);
break;
case 'K':
if (ii > -1)
retval += pfl->GetData(ii, CHexFileList::KEYWORDS);
break;
case 'X':
if (ii > -1)
retval += pfl->GetData(ii, CHexFileList::COMMENTS);
break;
default:
case '&':
retval += sin[pos+1];
}
sin = sin.Mid(pos+2);
}
else
{
sin.Empty();
break;
}
}
retval += sin;
return retval;
}