本文整理汇总了C++中printHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ printHeader函数的具体用法?C++ printHeader怎么用?C++ printHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void)
{
int a[SIZE]; // create array a
// create data
for (size_t i = 0; i < SIZE; ++i)
{
a[i] = 2 * i;
}
printf("%s", "Enter a number between 0 and 28: ");
int key; // value to locate in array a
scanf_s("%d", &key);
printHeader();
// Search for key in array a
const size_t result = binarySearch(a, key, 0, SIZE - 1);
// display results
if (result != (size_t)-1)
{
printf("\n%d found at index %d\n", key, result);
}
else
{
printf("\n%d not found\n", key);
}
return 0;
}
示例2: printHeader
void TextTestResult::print (std::ostream &stream)
{
printHeader (stream);
printErrors (stream);
printFailures (stream);
}
示例3: open
void myLog::openLog(const string& fileName, int mode)
{
if (logLevel < QUIET_MODE)
{
open(fileName.c_str(),mode);
// fail() returns a null zero when operation fails
// rc = (*this).fail();
if ( fail() == 0 )
{
logName = fileName;
printHeader(0); // insert start time into top of log file
}
else
{
cout << "ERROR: Log file " << fileName.c_str()
<< " could not be opened for write access." << endl;
logLevel = QUIET_MODE;
}
}
else
{
cout << "Logging disabled (QUIET_MODE set)" << endl;
}
}
示例4: printHeader
void StatTool::printTabular(StatManager * sm)
{
if (ST_WithHeader) {
printHeader();
}
std::cout<< sm->getGid()<<ST_Separator;
std::cout<< sm->getConcensus()<<ST_Separator;
std::cout<< sm->getRpeatCount()<< ST_Separator;
std::cout<< sm->meanRepeatL()<<ST_Separator;
std::cout<< sm->getSpacerCount()<<ST_Separator;
if (!sm->getSpLenVec().empty()) {
std::cout<< sm->meanSpacerL()<<ST_Separator;
} else {
std::cout<<0<<ST_Separator;
}
if (sm->getSpCovVec().empty()) {
std::cout<<0<<ST_Separator;
} else {
std::cout<< sm->meanSpacerC()<<ST_Separator;
}
std::cout<< sm->getFlankerCount()<<ST_Separator;
if (sm->getFlLenVec().empty()) {
std::cout<<0<<ST_Separator;
} else {
std::cout<< sm->meanFlankerL()<<ST_Separator;
}
std::cout<<sm->getReadCount()<<std::endl;
}
示例5: printHeader
void GerberGenerator::generate() {
mOutput.clear();
printHeader();
printApertureList();
printContent();
printFooter();
}
示例6: menu0
int menu0()
{
char input[32]; // A simple buffer to store whatever the user types in the menu
int optionSelected = -1;
// Display the menu to select the region
while(optionSelected != EXIT) // This condition makes the menu repeat itself until a valid input is entered
{
system("cls"); // clears the screen
printHeader();
printf("Start patch to RU version\n");
// Converts the read string to int
optionSelected = 1;
// This variable also tells the program later which one of the "moddedBytes" the program should use when replacing the bytes
if (optionSelected == EXIT)
{
break;
}
// If the user entered an invalid option, displays a error message
if(optionSelected < 1 || optionSelected > 2)
{
printf("\nInvalid option!\n\n");
system("PAUSE");
}
else
{
break;
}
}
return optionSelected;
}
示例7: AstranError
void Spice::saveFile(string filename, Circuit& netList){
ofstream file;
file.open(filename.c_str()); // Write
if (!file)
throw AstranError("Could not save file: " + filename);
printHeader (file, "* ", "");
map<string, CellNetlst>::iterator cells_it;
for ( cells_it = netList.getCellNetlsts()->begin(); cells_it != netList.getCellNetlsts()->end(); cells_it++ ){
file << ".SUBCKT " << cells_it->first;
for ( vector<int>::iterator inouts_it=cells_it->second.getInouts().begin(); inouts_it != cells_it->second.getInouts().end(); inouts_it++ )
file << " " << cells_it->second.getNetName(*inouts_it);
file << endl;
for(map<string,Inst>::iterator tmp=cells_it->second.getInstances().begin(); tmp!=cells_it->second.getInstances().end(); ++tmp){
file << tmp->first << " ";
for(vector<int>::iterator tmp2=tmp->second.ports.begin(); tmp2!=tmp->second.ports.end(); ++tmp2)
file << cells_it->second.getNetName(*tmp2) << " ";
file << tmp->second.subCircuit << endl;
}
for(int x=0; x<cells_it->second.size(); x++){
file << cells_it->second.getTrans(x).name << " " <<
cells_it->second.getNetName(cells_it->second.getTrans(x).drain) << " " <<
cells_it->second.getNetName(cells_it->second.getTrans(x).gate) << " " <<
cells_it->second.getNetName(cells_it->second.getTrans(x).source) << " ";
if(cells_it->second.getTrans(x).type==PMOS)
file << netList.getVddNet() << " PMOS";
else
file << netList.getGndNet() << " NMOS";
file << " L=" << cells_it->second.getTrans(x).length << "U W=" << cells_it->second.getTrans(x).width << "U"<< endl;
}
file << ".ENDS " << cells_it->first << endl << endl;
}
}
示例8: wxLogTextCtrl
/** Constructor */
IcpdFrm::IcpdFrm( wxWindow* parent ):ICPD_frm( parent ){
wxLog::SetActiveTarget( new wxLogTextCtrl(wx_log));
new Redirector( wx_log, cout, false);
new Redirector( wx_log, cerr, true);
printHeader(cout, "", "");
string astran_cfg;
astran_cfg = "astran.cfg";
wxString astran_path;
::wxGetEnv(wxT("ASTRAN_PATH"), &astran_path);
if (wxDirExists(astran_path)) {
astran_cfg = string(wxString(astran_path).mb_str()) + "/astran.cfg";
ifstream afile(astran_cfg.c_str());
if(afile) {
executeCommand(string("read \"" + astran_cfg + "\""));
}
}
wxabout = new WxAbout(this);
wxrules = new WxRules(this);
wxautocell = new WxAutoCell(this);
wxcircuit = new WxCircuit(this);
wxfp = new WxFP(this);
wxpreferences = new WxPreferences(this);
refresh();
}
示例9: main
// main function
int main(int argc, char *argv[])
{
ios::sync_with_stdio(false);
// warnings
if (argc != 4)
{
usage(argv);
return 0;
}
// create modified RNA index
int qualThreshold, coverageThreshold;
qualThreshold = atoi(argv[2]);
coverageThreshold = atoi(argv[3]);
// read lines
printHeader();
if (strcmp(argv[1],"-") == 0)
{
cerr << "Reading from stdin" << endl;
readStream(qualThreshold, coverageThreshold);
}
else
{
const char* filename = argv[1];
cerr << "Reading from: " << filename << endl;
readFile(filename, qualThreshold, coverageThreshold);
}
return 0;
}
示例10: fopen
int ApiGen::genContextImpl(const std::string &filename, SideType side)
{
FILE *fp = fopen(filename.c_str(), "wt");
if (fp == NULL) {
perror(filename.c_str());
return -1;
}
printHeader(fp);
std::string classname = m_basename + "_" + sideString(side) + "_context_t";
size_t n = size();
fprintf(fp, "\n\n#include <string.h>\n");
fprintf(fp, "#include \"%s_%s_context.h\"\n\n\n", m_basename.c_str(), sideString(side));
fprintf(fp, "#include <stdio.h>\n\n");
// init function;
fprintf(fp, "int %s::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)\n{\n", classname.c_str());
for (size_t i = 0; i < n; i++) {
EntryPoint *e = &at(i);
fprintf(fp, "\t%s = (%s_%s_proc_t) getProc(\"%s\", userData);\n",
e->name().c_str(),
e->name().c_str(),
sideString(side),
e->name().c_str());
}
fprintf(fp, "\treturn 0;\n");
fprintf(fp, "}\n\n");
fclose(fp);
return 0;
}
示例11: printHeader
void MemoryDebugger::doLookForValue(const s2e::plugins::ExecutionTraceItemHeader &hdr,
const s2e::plugins::ExecutionTraceMemory &item)
{
/* if (!(item.flags & EXECTRACE_MEM_WRITE)) {
if ((m_valueToFind && (item.value != m_valueToFind))) {
return;
}
}*/
printHeader(hdr);
m_os << " pc=0x" << std::hex << item.pc <<
" addr=0x" << item.address <<
" val=0x" << item.value <<
" size=" << std::dec << (unsigned)item.size <<
" iswrite=" << (item.flags & EXECTRACE_MEM_WRITE);
ModuleCacheState *mcs = static_cast<ModuleCacheState*>(m_events->getState(m_cache, &ModuleCacheState::factory));
const ModuleInstance *mi = mcs->getInstance(hdr.pid, item.pc);
std::string dbg;
if (m_library->print(mi, item.pc, dbg, true, true, true)) {
m_os << " - " << dbg;
}
m_os << std::endl;
}
示例12: getIndexSearcher
void IndexFrontEnd::doSearch(){
int docIdsFound;
set<EvidenceInfo *, EvidenceMostImportant > foundEvidenceSet;
map<std::string, int> foundWords;
if (mSearchType == WORDS){
getIndexSearcher().findMatchingTerms(mIndexSearcher.getQuery(), foundWords);
printFoundWords(foundWords);
} else {
docIdsFound = getIndexSearcher().searchDocuments();
printHeader(docIdsFound);
int foundEvidences = getIndexSearcher().retrieveEvidences(foundEvidenceSet, mFrom, mAmount);
set<EvidenceInfo *>::iterator iter;
for (iter = foundEvidenceSet.begin(); iter != foundEvidenceSet.end(); iter++){
printEvidenceInfo(**iter);
}
printNavigation(foundEvidences);
for (iter = foundEvidenceSet.begin(); iter != foundEvidenceSet.end(); iter++){
delete *iter;
// *iter = 0;
}
}
}
示例13: main
int main(void) {
int arr[SIZE];
int element;
int searchKey;
int count;
for (count = 0; count < SIZE; count++) {
arr[count] = 2 * count;
}
printf("Enter a number between 0 and 28: \n");
scanf("%d", &searchKey);
printHeader();
element = binearSearch(arr, searchKey, 0, SIZE - 1);
if (element != -1) {
printf("\n%dvalue found in array%d\n", searchKey, element);
}
else {
printf("\n%dSearched value not found in array\n", searchKey);
}
system("pause");
return 0;
}
示例14: printHeader
gboolean PrintDialog::printLine(int indent, const char *line)
{
QRect out_rect;
QString out_line;
if (!line || !cur_printer_ || !cur_painter_) return FALSE;
/* Prepare the tabs for printing, depending on tree level */
out_line.fill(' ', indent * 4);
out_line += line;
out_rect = cur_painter_->boundingRect(cur_printer_->pageRect(), Qt::TextWordWrap, out_line);
if (cur_printer_->pageRect().height() < page_pos_ + out_rect.height()) {
if (in_preview_) {
// When generating a preview, only generate the first page;
// if we're past the first page, stop the printing process.
return FALSE;
}
if (*line == '\0') { // Separator
return TRUE;
}
printHeader();
}
out_rect.translate(0, page_pos_);
cur_painter_->drawText(out_rect, Qt::TextWordWrap, out_line);
page_pos_ += out_rect.height();
return TRUE;
}
示例15: tempPage
/*
* The temperature page, takes a linked list of structs as input
* Should be generated from the JSON
*/
void tempPage(struct tempList *temps){ //take temp list as parameter
//Set up the html file for the table
printHeader();
printNavbar();
printAccountNav();
startBody();
divClass("centered");
divClass("content");
//start table
printf("<table><caption>");
printf("Recorded temperature measurements for the past 24 hours.");
printf("</caption>\n");
//Insert the header row of the table
printf("<tr>\n");
printf("<th scope=\"col\">Time Recorded</th>\n");
printf("<th scope=\"col\">Temperature Recorded</th>\n");
printf("</tr>\n");
//Fill the rows of the table with the temperature val
while (temps!=NULL){
tableRow(temps->tempTime, temps->tempVal);
temps = temps -> next;
}
//close the table and the rest of the page
printf("</table>\n");
endDiv();
endDiv();
endBody();
printFooter();
}