• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ printHeader函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中printHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ printHeader函数的具体用法?C++ printHeader怎么用?C++ printHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了printHeader函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:dwinner,项目名称:CppAppdev,代码行数:31,代码来源:entryPoint.c


示例2: printHeader

void TextTestResult::print (std::ostream &stream)
{
	printHeader (stream);
	printErrors (stream);
	printFailures (stream);

}
开发者ID:chenbk85,项目名称:CuteTestForCoastTest,代码行数:7,代码来源:TextTestResult.cpp


示例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;
   }
}
开发者ID:RobertHu,项目名称:TraderClientTest,代码行数:26,代码来源:myLog.cpp


示例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;
}
开发者ID:EricDeveaud,项目名称:crass,代码行数:28,代码来源:StatTool.cpp


示例5: printHeader

void GerberGenerator::generate() {
  mOutput.clear();
  printHeader();
  printApertureList();
  printContent();
  printFooter();
}
开发者ID:LibrePCB,项目名称:LibrePCB,代码行数:7,代码来源:gerbergenerator.cpp


示例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;
}
开发者ID:Socolcol,项目名称:Splitter,代码行数:35,代码来源:main.c


示例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;
	}
}
开发者ID:rickdudek,项目名称:astran,代码行数:34,代码来源:spice.cpp


示例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();
}
开发者ID:leoheck,项目名称:astran,代码行数:32,代码来源:icpdfrm.cpp


示例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;
}
开发者ID:wckdouglas,项目名称:filterSamFile,代码行数:30,代码来源:pileupBases.cpp


示例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;
}
开发者ID:lcweik,项目名称:emulator,代码行数:30,代码来源:ApiGen.cpp


示例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;

}
开发者ID:xqx12,项目名称:s2e1.1,代码行数:26,代码来源:Debugger.cpp


示例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;
    }
  }

}
开发者ID:DNPA,项目名称:OcfaArch,代码行数:32,代码来源:IndexFrontEnd.cpp


示例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;
}
开发者ID:syvjohan,项目名称:CFun,代码行数:27,代码来源:BinearSearch.c


示例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;
}
开发者ID:DuLerWeil,项目名称:wireshark,代码行数:30,代码来源:print_dialog.cpp


示例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();
}
开发者ID:demonslab,项目名称:CGI_Website_In_C,代码行数:37,代码来源:login.c


示例16: printHeader

void *sal_malloc(u_int32_t n)
{
	byte *allocated;

	//iterate through to get to the first free space
	free_header_t *first = (free_header_t *) memory+free_list_ptr;
	free_header_t *curr = first;
	int circle = TRUE;
	
	printHeader(curr);
	
	while (circle)) {
		//found a chunk that is bigger than we need
		if (n <= HEADER_SIZE+curr->size) {
			//check if we can break down chunks
			if (n <= HEADER_SIZE+(curr->size)/2) {
				//break chunk, then salloc again (and hence find that chunk)
				//TODO this is a bad way i think...
				splitChunk(curr);
				allocated = sal_malloc(u_int32_t n/2)
			//if cannot splt, then five them this bit of memory
			} else {
				allocated = (byte *)curr + HEADER_SIZE;
			}
			break;
		//else if we get back around the full circle, nothing is big enough so error
		} else if (curr == first) {
开发者ID:bradywatkinson,项目名称:comp1917-linked-list-practuce,代码行数:27,代码来源:allocator.c


示例17: main

// main function
int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false);
	cout.sync_with_stdio(false);
    // warnings
    if (argc != 4)
    {
        usage(argv);
		return 0;
    }
	int qualThreshold = atoi(argv[2]);
	int covThreshold = atoi(argv[3]);

    printHeader();

    // read lines
    if (strcmp(argv[1],"-") == 0)
    {
        readStream(qualThreshold, covThreshold);
    }
    else
    {
        const char* filename = argv[1];
        readFile(filename,qualThreshold, covThreshold);
    }
    return 0;
}
开发者ID:wckdouglas,项目名称:filterSamFile,代码行数:28,代码来源:parsePileup.cpp


示例18: loginPage

/*
 * The login page. 
 * If error evaluates to true, show the user that the login failed
 */
void loginPage(int error){
    //Start of the page
    printHeader();
    printNavbar();
    startBody();
    divClass("centered");
    printBanner();
    
    //begin sign in display
    printf("<h1>Please sign in below to view the temperature recordings.</h1>\n");
    divClass("frame"); divClass("inFrame");
    
    if (error) //If Login Failed
        printf("<font color=\"#990000\">There was an error, try again.</font>");
    
    printf("<form action=\"\" method=\"get\" onSubmit=\"window.location.reload()\">\n" );
    input("text", "user", "Username");
    br();
    input("password" ,"pass", "Password");
    br();br();

    printf ("<input type=\"submit\" value=\"Sign In!\" class=\"btn\">\n");
    button("./temp-cgi/login.cgi", "float-right", "Sign Up!");
    printf("</form>\n");
    
    //End login form and fill out the rest of the page
    endDiv(); endDiv();
    endDiv();
    endBody();
    printFooter();
}
开发者ID:demonslab,项目名称:CGI_Website_In_C,代码行数:35,代码来源:login.c


示例19: msBedPrintTable

static void msBedPrintTable(struct bed *bedList, struct hash *erHash,
    char *itemName, char *expName, float minScore, float maxScore,
    float stepSize, int base,
    void(*printHeader)(struct bed *bedList, struct hash *erHash, char *item),
			    void(*printRow)(struct bed *bedList,struct hash *erHash, int expIndex, char *expName, float maxScore, enum expColorType colorScheme),
    void(*printKey)(float minVal, float maxVal, float size, int base, struct rgbColor(*getColor)(float val, float max, enum expColorType colorScheme), enum expColorType colorScheme),
    struct rgbColor(*getColor)(float val, float max, enum expColorType colorScheme),
	enum expColorType colorScheme)
/* prints out a table from the data present in the bedList */
{
int i,featureCount=0;
if(bedList == NULL)
    errAbort("hgc::msBedPrintTable() - bedList is NULL");
featureCount = slCount(bedList);
/* time to write out some html, first the table and header */
if(printKey != NULL)
    printKey(minScore, maxScore, stepSize, base, getColor, colorScheme);
printf("<p>\n");
printf("<basefont size=-1>\n");
printf("<table  bgcolor=\"#000000\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\"><tr><td>");
printf("<table  bgcolor=\"#fffee8\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">");
printHeader(bedList, erHash, itemName);
for(i=0; i<bedList->expCount; i++)
    {
    printRow(bedList, erHash, i, expName, maxScore, colorScheme);
    }
printf("</table>");
printf("</td></tr></table>");
printf("</basefont>");
}
开发者ID:CEpBrowser,项目名称:CEpBrowser--from-UCSC-CGI-BIN,代码行数:30,代码来源:expClick.c


示例20: main

int main(){
    int i;

    // Read in the input glass
    char filename[100] = "glass.std";
    printf("Reading: %s\n", filename);
    tipsy* tipsyIn = readTipsyStd(filename);
    // Set attributes not set by readTipsy
    tipsyIn->attr->xmin = -0.5; tipsyIn->attr->xmax = 0.5;
    tipsyIn->attr->ymin = -0.5; tipsyIn->attr->ymax = 0.5;
    tipsyIn->attr->zmin = -0.5; tipsyIn->attr->zmax = 0.5;
    printf("Input ");
    printHeader(tipsyIn->head);
    printAttr(tipsyIn->attr);
    printf("=================================================\n");

    // Create 1/8x compressed glass
    printf("\nCreating 1/8x compressed glass:\n");
    tipsy* glass8f = tipsyClone(tipsyIn);
    tipsyScaleExpand(glass8f, 2, 2, 2);
    tipsyCenter(glass8f);
    printHeader(glass8f->head);
    printAttr(glass8f->attr);
    printf("=================================================\n");
    writeTipsyStd("glass8f.std", glass8f);

    // Tile the 1/8x compressed glass to 28x2x2
    printf("\nTiling Shocktube:\n");
    tipsy* rcrShock = tipsyClone(glass8f);
    tipsyTesselate(rcrShock, 14, 1, 1);           // creates 28x2x2
    printf("\nCentering:\n");
    tipsyCenter(rcrShock);
    printf("\nEditing Velocities:\n");
    for (i=0; i<rcrShock->head->nsph; i++){
        if (rcrShock->gas[i].pos[AXIS_X] < 0.0)
            rcrShock->gas[i].vel[AXIS_X] = -1;
        else if (rcrShock->gas[i].pos[AXIS_X] > 0.0)
            rcrShock->gas[i].vel[AXIS_X] = 1;
    }
    printHeader(rcrShock->head);
    printAttr(rcrShock->attr);

    writeTipsyStd("RCRShock1.std", rcrShock);

    // Cleanup
    tipsyDestroy(tipsyIn); tipsyDestroy(glass8f); tipsyDestroy(rcrShock);
}
开发者ID:panuelosj,项目名称:tipsyGlassEdit,代码行数:47,代码来源:tipsyCreateRCRShock1.c



注:本文中的printHeader函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ printHelp函数代码示例发布时间:2022-05-30
下一篇:
C++ printGraph函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap