本文整理汇总了C++中AttrListPrintMask::display_Headings方法的典型用法代码示例。如果您正苦于以下问题:C++ AttrListPrintMask::display_Headings方法的具体用法?C++ AttrListPrintMask::display_Headings怎么用?C++ AttrListPrintMask::display_Headings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttrListPrintMask
的用法示例。
在下文中一共展示了AttrListPrintMask::display_Headings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ppDisplayHeadings
static void ppDisplayHeadings(FILE* file, ClassAd *ad, const char * pszExtra)
{
if (ad) {
// render the first ad to a string so the column widths update
std::string tmp;
pm.display(tmp, ad, NULL);
}
if (pm.has_headings()) {
pm.display_Headings(file);
} else {
pm.display_Headings(file, pm_head);
}
if (pszExtra)
printf("%s", pszExtra);
}
示例2: printHeader
static void printHeader()
{
// Print header
if ( ! longformat) {
if ( ! customFormat) {
// hack to get backward-compatible formatting
if ( ! wide_format && 80 == wide_format_width)
short_header();
else {
init_default_custom_format();
if ( ! wide_format || 0 != wide_format_width) {
int console_width = wide_format_width;
if (console_width <= 0) console_width = getConsoleWindowSize()-1; // -1 because we get double spacing if we use the full width.
if (console_width < 0) console_width = 1024;
mask.SetOverallWidth(console_width);
}
}
}
if (customFormat && mask.has_headings()) {
mask.display_Headings(stdout);
}
}
}
示例3: if
//.........这里部分代码省略.........
case PP_STARTD_STATE:
printState(ad, (classad_index == 0));
break;
#ifdef HAVE_EXT_POSTGRESQL
case PP_QUILL_NORMAL:
printQuillNormal (ad);
break;
#endif /* HAVE_EXT_POSTGRESQL */
case PP_SCHEDD_NORMAL:
printScheddNormal (ad, (classad_index == 0));
break;
case PP_NEGOTIATOR_NORMAL:
printNegotiatorNormal (ad, (classad_index == 0));
break;
case PP_SCHEDD_SUBMITTORS:
printScheddSubmittors (ad, (classad_index == 0));
break;
case PP_VERBOSE:
printVerbose (ad);
break;
case PP_XML:
printXML (ad, (classad_index == 0),
(classad_index == last_classad_index));
break;
case PP_MASTER_NORMAL:
printMasterNormal(ad, (classad_index == 0));
break;
case PP_COLLECTOR_NORMAL:
printCollectorNormal(ad, (classad_index == 0));
break;
case PP_CKPT_SRVR_NORMAL:
printCkptSrvrNormal(ad, (classad_index == 0));
break;
case PP_STORAGE_NORMAL:
printStorageNormal(ad, (classad_index == 0));
break;
case PP_GRID_NORMAL:
printGridNormal(ad, (classad_index == 0));
break;
case PP_GENERIC_NORMAL:
case PP_GENERIC:
case PP_ANY_NORMAL:
printAnyNormal(ad, (classad_index == 0));
break;
case PP_CUSTOM:
// hack: print a single item to a string, then discard the string
// this makes sure that the headings line up correctly over the first
// line of data.
if (fPrintHeadings) {
std::string tmp;
pm.display(tmp, ad, targetAd);
if (pm.has_headings()) {
if ( ! (pmHeadFoot & HF_NOHEADER))
pm.display_Headings(stdout);
} else {
pm.display_Headings(stdout, pm_head);
}
fPrintHeadings = false;
}
printCustom (ad);
break;
case PP_NOTSET:
fprintf (stderr, "Error: pretty printing set to PP_NOTSET.\n");
exit (1);
default:
fprintf (stderr, "Error: Unknown pretty print option.\n");
exit (1);
}
}
classad_index++;
totals->update(ad);
}
adList.Close();
// if there are no ads to print, but the user wanted XML output,
// then print out the XML header and footer, so that naive XML
// parsers won't get confused.
if ( PP_XML == pps && 0 == classad_index ) {
printXML (NULL, true, true);
}
// if totals are required, display totals
if (adList.MyLength() > 0 && totals) totals->displayTotals(stdout, 20);
}