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

C++ processArgs函数代码示例

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

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



在下文中一共展示了processArgs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("plasmadiscover")));
    app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
    app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
    KCrash::initialize();
    KLocalizedString::setApplicationDomain("plasma-discover");
    KAboutData about(QStringLiteral("discover"), i18n("Discover"), version, i18n("An application explorer"),
                     KAboutLicense::GPL, i18n("© 2010-2016 Plasma Development Team"));
    about.addAuthor(i18n("Aleix Pol Gonzalez"), QString(), QStringLiteral("[email protected]"));
    about.addAuthor(i18n("Jonathan Thomas"), QString(), QStringLiteral("[email protected]"));
    about.setProductName("discover/discover");
    KAboutData::setApplicationData(about);

    DiscoverMainWindow *mainWindow = nullptr;
    {
        QScopedPointer<QCommandLineParser> parser(createParser());
        parser->process(app);
        about.processCommandLine(parser.data());
        DiscoverBackendsFactory::processCommandLine(parser.data(), parser->isSet(QStringLiteral("test")));

        if (parser->isSet(QStringLiteral("test"))) {
            QStandardPaths::setTestModeEnabled(true);
        }

        KDBusService* service = new KDBusService(KDBusService::Unique, &app);

        mainWindow = new DiscoverMainWindow(s_decodeCompactMode->value(parser->value(QStringLiteral("compact")), DiscoverMainWindow::Full));
        QObject::connect(&app, &QCoreApplication::aboutToQuit, mainWindow, &DiscoverMainWindow::deleteLater);
        QObject::connect(service, &KDBusService::activateRequested, mainWindow, [mainWindow](const QStringList &arguments, const QString &/*workingDirectory*/){
            mainWindow->rootObject()->raise();
            if (arguments.isEmpty())
                return;
            QScopedPointer<QCommandLineParser> parser(createParser());
            parser->process(arguments);
            processArgs(parser.data(), mainWindow);
        });

        processArgs(parser.data(), mainWindow);

        if(parser->isSet(QStringLiteral("listmodes"))) {
            QTextStream(stdout) << i18n("Available modes:\n");
            foreach(const QString& mode, mainWindow->modes())
                QTextStream(stdout) << " * " << mode << '\n';
            return 0;
        }

        if (parser->isSet(QStringLiteral("test"))) {
            const QUrl testFile = QUrl::fromUserInput(parser->value(QStringLiteral("test")), {}, QUrl::AssumeLocalFile);
            Q_ASSERT(!testFile.isEmpty() && testFile.isLocalFile());

            mainWindow->loadTest(testFile);
        }
    }
开发者ID:KDE,项目名称:discover,代码行数:55,代码来源:main.cpp


示例2: main

int main(int argc, char *argv[]){
    PaStream *stream;

    sharedBuffer = (Packet *)malloc(sizeof(Packet) * BUFFER_SIZE);

    processArgs(argc, argv);

    if (!startAudio(stream, argv[1])){
        exit(1);
    }

    // TODO - get rid of glut stuff and set up context manually
    setupGlut(argc, argv);

    GLenum err = glewInit();
    if (GLEW_OK != err){
        fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err));
        exit(1);
    }

    SetupRC();
    glutMainLoop();

    free(sharedBuffer);
    endAudio(stream);
    exit(0);
}
开发者ID:deckycoss,项目名称:Audio-Visualizer,代码行数:27,代码来源:Visualizer.cpp


示例3: main

/* a tester */
int main(int argc, char **argv) {
  int n=0;
  char infile[9]="infile value";
  char outfile[256]="outfile value";
  float fl=-1.0;
  double dbl = -1.0;
  int    flag = 0;

  //Add arguments
  addArg("infile",  'i',  1,  's',  infile,  sizeof(infile), "input file name");
  addArg("outfile", 'o',  1,  's',  outfile, sizeof(infile), "output file name");
  addArg("nSPUs",   'n',  1,  'i',  &n,      0,              "number of SPUs");
  addArg("floater",  0,   1,  'f',  &fl,     0,              "floating number");
  addArg("doubler", 'k',  1,  'd',  &dbl,    0,              "double  number");
  addArg("justFlag",'F',  0,    0,  &flag,   0,              "just a flag");

  // print the argument help
  printArgs();

  // process (and free) arguments
  processArgs(argc,argv);

  // print the variables in the code
  printf("Got n = %d\n",n);
  printf("Got fl = %f\n",fl);
  printf("Got dbl = %lf\n",dbl);
  printf("Got flag = %d\n",flag);
  printf("Got infile = %s\n",infile);
  printf("Got outfile = %s\n",outfile);

  printf("\n\n");
  
  return 0;
}
开发者ID:sbiersdorff,项目名称:CoMD,代码行数:35,代码来源:cmdLineParser.c


示例4: main

int main(int argc, char** argv) {
	processArgs(argc,argv);
	if (detach) child = fork();
	if (!child) run();		// We are the child if we don't have a child so run
	debug("Shutting down");
	return 0;
}
开发者ID:cthulhuology,项目名称:Jawas2,代码行数:7,代码来源:jawasd.c


示例5: main

int main( int argc, char** argv ) 
{ int i, *inputPermutation, *permutation;
  processArgs(argc,argv);

  M2_MAX = NUM_PACKETS*(NUM_PACKETS-1)/2;
  if (0 == NUM_PACKETS % 2) // even
      M3_MAX = (NUM_PACKETS*NUM_PACKETS)/2;
  else                      // odd
      M3_MAX = (NUM_PACKETS*NUM_PACKETS - 1)/2;

  inputPermutation = (int*)malloc(sizeof(int)*NUM_PACKETS); 
  permutation = (int*)malloc(sizeof(int)*NUM_PACKETS); 

  /* init */
  for (i=0;i<NUM_PACKETS;i++)
      inputPermutation[i] = i;  // init initial permutation in perfect order

  m2_histogram = (int*)malloc(sizeof(int)*M2_MAX); 
  m3_histogram = (int*)malloc(sizeof(int)*M3_MAX); 

  /* initial call to permute items */ 
  permuteAndMeasure(permutation, 0, inputPermutation); 

  showFinalStats();
  return EXIT_SUCCESS;
}
开发者ID:estrabd,项目名称:csc7999,代码行数:26,代码来源:measure-ordering-all.c


示例6: main

int main(int argc, char **argv)
{
    srand(time(NULL));

    printIntro();
    initStats();
    processArgs(argc, argv);

    // Start the packet processor
    pthread_t packet_processor;
    pthread_create(&packet_processor, NULL, process_incoming, NULL);

    // Start the syn flood thread
    pthread_t syn_sender;
    pthread_create(&syn_sender, NULL, send_syns, NULL);

    pthread_t status_update;
    pthread_create(&status_update, NULL, print_status, NULL);

    // Wait for the threads to return, which is never.
    pthread_join(syn_sender, NULL);
    pthread_join(packet_processor, NULL);
    pthread_join(status_update, NULL);

    return 0;
}
开发者ID:KiteGh0st,项目名称:opparis,代码行数:26,代码来源:sockstress.c


示例7: main

/**
 * Program entry point.
 */
int main(int argc, char *argv[ ])
{
	SetupSharedThread::install();
	SetupSharedDebug::install(4096);

	{
		SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_console);
#ifdef WIN32
		char buffer[1024];
		GetModuleFileName(GetModuleHandle(NULL), buffer, 1024);
		Filename configName;
		configName.setName(buffer);
		configName.setName("templateCompiler.cfg");
		data.configFile = configName.getFullFilename().c_str();
#endif
		SetupSharedFoundation::install (data);
	}

	SetupSharedRegex::install();

	SetupSharedCompression::install();
	SetupSharedFile::install(false);

	// setup the random number generator
	// @todo need a better seed
	SetupSharedRandom::install(static_cast<uint32>(time(NULL)));

	int result = processArgs(argc, argv);

	// cleanup
	SetupSharedFoundation::remove();
	PerThreadData::threadRemove();

	return result;
}	// main
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:38,代码来源:TemplateDefinitionCompiler.cpp


示例8: main

int main(int argc, char *argv[])
{
	unsigned val;

	nf2.device_name = DEFAULT_IFACE;

	processArgs(argc, argv);

	// Open the interface if possible
	if (check_iface(&nf2))
	{
		exit(1);
	}
	if (openDescriptor(&nf2))
	{
		exit(1);
	}

	// Increment the argument pointer
	argc -= optind;
	argv += optind;

	// Read the registers
	readRegisters(argc, argv);

	closeDescriptor(&nf2);

	return 0;
}
开发者ID:1573472562,项目名称:netfpga,代码行数:29,代码来源:regread.c


示例9: main

int main(int argc, char *argv[])
{
  nf2.device_name = DEFAULT_IFACE;

  processArgs(argc, argv);

  // Open the interface if possible
  if (check_iface(&nf2))
    {
      exit(1);
    }
  if (openDescriptor(&nf2))
    {
      exit(1);
    }
  if(argc > 5){
      printf("Numero de argumentos deve ser < 4\n");
      argc=5;
  } 
  for(int i=0; i< argc-1; i++){
     pdrop[i] = atoi(argv[i+1]);
  }
  dumpCounts();

  closeDescriptor(&nf2);

  return 0;
}
开发者ID:dcardos,项目名称:NetFPGA-Danilo,代码行数:28,代码来源:nffw.c


示例10: main

/*
  Checks for commandline args, intializes globals, then  begins code download.
*/
int main(int argc, char **argv) {

   nf2.device_name = DEFAULT_IFACE;

   processArgs(argc, argv);

   if (check_iface(&nf2))
   {
	   exit(1);
   }
   if (openDescriptor(&nf2))
   {
      exit(1);
   }

   if (strncmp(log_file_name, "stdout",6)) {

      if ((log_file = fopen(log_file_name, "w")) == NULL) {
	 printf("Error: unable to open logfile %s for writing.\n",
		log_file_name);
	 exit(1);
      }
   }
   else
      log_file = stdout;

   InitGlobals();

   BeginCodeDownload(bin_file_name);

   if (!cpci_reprog)
      ResetDevice();

   /* reset the PHYs */
   NF2_WR32(MDIO_0_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_1_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_2_CONTROL_REG, 0x8000);
   NF2_WR32(MDIO_3_CONTROL_REG, 0x8000);

   /* wait until the resets have been completed */
   usleep(100);

   if (intr_enable)
   {
      /* PHY interrupt mask off for link status change */
      NF2_WR32(MDIO_0_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_1_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_2_INTERRUPT_MASK_REG, 0xfffd);
      NF2_WR32(MDIO_3_INTERRUPT_MASK_REG, 0xfffd);
   }

   VerifyDevInfo();

   fclose(log_file);

   closeDescriptor(&nf2);

   return SUCCESS;
}
开发者ID:1573472562,项目名称:netfpga,代码行数:62,代码来源:nf_download.c


示例11: main

int main(int argc,char* argv[])
{
    FILE *fIN=NULL;
    FILE *fOUT=NULL;
    if(processArgs(argc,argv,&fIN,&fOUT))
        readf(fIN);
    return 0;
}
开发者ID:kakas4,项目名称:C_programming,代码行数:8,代码来源:main.c


示例12: main

int main(int argc, char * argv[])
{
	Args args;
	processArgs(argc, argv, args);
	processFile(args.inputFile);

	return 0;
}
开发者ID:jschueths,项目名称:Rosalind,代码行数:8,代码来源:counting_nucleotides.cpp


示例13: main

int main(int argc, char **argv)
{
    g_error1 = 0.01f;
    g_error2 = g_error1;

    processArgs( argc, argv );

    OSG::osgInit(argc,argv);
    // GLUT init
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);

    int winid = glutCreateWindow("OpenSG");

    glutReshapeFunc(reshape);
    glutDisplayFunc(display);
    glutIdleFunc(display);
    glutMouseFunc(mouse);
    glutMotionFunc(motion);
    glutKeyboardFunc(keyboard);

    {
        OSG::GLUTWindowRefPtr gwin = OSG::GLUTWindow::create();
        gwin->setGlutId(winid);

        gwin->init();

        // create the scene
        OSG::NodeRefPtr scene;
        scene = makeScene( );

        if ( scene == NULL )
        {
            std::cerr<<"makeScene returned NullFC, exiting..."<<std::endl;
            return -1;
        }

        // create the SimpleSceneManager helper
        mgr = new OSG::SimpleSceneManager;

        // create the window and initial camera/viewport
        mgr->setWindow( gwin );
        // tell the manager what to manage
        mgr->setRoot  ( scene );

        // show the whole scene
        mgr->showAll();
        mgr->redraw();
        OSG::SolidBackgroundRefPtr bgr = OSG::SolidBackground::create();
        bgr->setColor( OSG::Color3f( 0.7f, 0.7f, 0.7f ));
        mgr->getWindow()->getPort(0)->setBackground( bgr );
    }

    // GLUT main loop
    glutMainLoop();

    return 0;
}
开发者ID:rdgoetz,项目名称:OpenSGDevMaster_Toolbox,代码行数:58,代码来源:testSurfaceFatBordersRender.cpp


示例14: main

// usage : ray [option] in.ray out.bmp
// Simply keying in ray will invoke a graphics mode version.
// Use "ray --help" to see the detailed usage.
// OK. I am lying. any illegal option such as "ray blahbalh" will print
// out the usage
//
// Graphics mode will be substantially slower than text mode because of
// event handling overhead.
int main(int argc, char **argv) {
	progname=argv[0];
	srand((unsigned)time(NULL));

	if (argc!=1) {
		// text mode
		if (!processArgs(argc, argv)) {
			usage();
			exit(1);
		}
		
		theRayTracer=new RayTracer();
		theRayTracer->loadScene(rayName);
	
		if (theRayTracer->sceneLoaded()) {
			g_height = (int)(g_width / theRayTracer->aspectRatio() + 0.5);

			theRayTracer->traceSetup(g_width, g_height, 2, 1.0, 0.0001);
		
			clock_t start, end;
			start=clock();

			theRayTracer->traceLines(0, g_height);
		
			end=clock();

			// save image
			unsigned char* buf;

			theRayTracer->getBuffer(buf, g_width, g_height);
			if (buf)
				writeBMP(imgName, g_width, g_height, buf); 

			if (bReport) {
				double t=(double)(end-start)/CLOCKS_PER_SEC;
#ifdef WIN32
				fl_message( "total time = %.3f seconds\n", t); 
#else
				fprintf( stderr, "total time = %.3f seconds\n", t); 
#endif
			}
		}

		return 1;
	} else {
		// graphics mode
		traceUI=new TraceUI();
		theRayTracer=new RayTracer();

		traceUI->setRayTracer(theRayTracer);

		Fl::visual(FL_DOUBLE|FL_INDEX);

		traceUI->show();

		return Fl::run();
	}
}
开发者ID:caomw,项目名称:RayTracer,代码行数:66,代码来源:main.cpp


示例15: main

int
main(int argc, char *argv[])
{

    processArgs(argc, argv);

    cout << " NumIters " << NumIters << ","
         << " NumEntries " <<  NumEntries << endl;

    if (LockType == FallbackLock::MUTEX_LOCK) {
        GLock = new MutexFallbackLock(PmxLock);
		cout << "Allocated Pthread Mutex lock" << endl;
    } else if (LockType == FallbackLock::SPIN_LOCK) {
        GLock = new SpinFallbackLock(PspLock);
		cout << "Allocated Pthread Spin lock" << endl;
    } else if (LockType == FallbackLock::HLE_LOCK) {
        GLock = new HLELock();
		cout << "Allocated HLE Spin lock" << endl;
    } else if (LockType == FallbackLock::CUSTOM_LOCK) {
        GLock = new CustomSpinLock();
		cout << "Allocated Custom Spin lock" << endl;
    } else {
        cerr << "Error: invalid lock type specified, exiting..." << LockType;
    }

    SharedTable = new KaLib::HashTable<int>(
        NumEntries * NumThreads, GLock);
    for (int ec = NumThreads * NumEntries; ec > 0; --ec) {
        int v = rand();

       	SharedTable->insert(ec, v);
    }

    ThreadWorker_t worker = executeThreadLoopSimple;
	Timer coreTimer("Workers");

	coreTimer.Start();

    createWorkerThreads(NumThreads, worker);
    waitForThreads(NumThreads);

	coreTimer.Stop();

	Timer checker("VerifyHashTable");
	checker.Start();

    checkTable(*SharedTable, NumThreads, NumEntries);

	checker.Stop();

    delete SharedTable;

	coreTimer.PrintElapsedTime("RESULT: Filling up the hash table finished in ");

    checker.PrintElapsedTime("Verification of Hash table done in ");

    return 0;
}
开发者ID:skalyan,项目名称:HaswellTM,代码行数:58,代码来源:rtmHashDriver.cpp


示例16: foreach

void MainWindow::dropEvent(QDropEvent* evt)
{
    if(evt->mimeData()->hasUrls()){
        QStringList paths;
        foreach(const QUrl& url, evt->mimeData()->urls()){
            paths << url.toLocalFile();
        }
        processArgs(paths);
    }
开发者ID:rasmadeus,项目名称:Rragraph,代码行数:9,代码来源:MainWindow.cpp


示例17: resetToDefaults

void Config::init(const QStringList *const args)
{
    resetToDefaults();

    QByteArray envSslCertDir = qgetenv("SSL_CERT_DIR");
    if (!envSslCertDir.isEmpty())
        setSslCertificatesPath(envSslCertDir);

    processArgs(*args);
}
开发者ID:30114,项目名称:phantomjs,代码行数:10,代码来源:config.cpp


示例18: main

int main(int argc, char *argv[])
{
    int result = processArgs(argc, argv);
    if(result > 0) {
        QString fullVer = QString(QString::number(NVER1) + "."
                + QString::number(NVER2) + "."
                + QString::number(NVER3) + "."
                + QString::number(NVER4));
        Translator a(argc, argv, "ZmqTcpTranslator_ver." + fullVer);
        return a.exec();
    }

    return result;
}
开发者ID:someoneinthebox,项目名称:ZmqTcpTranslator,代码行数:14,代码来源:main.cpp


示例19: main

int main(int argc,char* argv[])
{
    FILE* fIN=NULL;
    FILE* fOUT=NULL;
    int n;
    if(processArgs(argc,argv,&fIN,&fOUT))
    {
        double* array=readinp(fIN,&n);
        int beg=0;int end=n-1;
        double fin=divide(array,beg,end);
        fprintf(fOUT,"%g",fin);
    }
    return 0;
}
开发者ID:kakas4,项目名称:C_programming,代码行数:14,代码来源:main.c


示例20: processArgs

// This fuction is used as the main loop in all game states.
const StateEvent& BaseState::start(const StateArgs& args)
{
    stateEvent.reset(); // Must reset the event in case the state still existed in memory after this returned
    processArgs(args);
    onStart();
    handleEvents();
    while (stateEvent.shouldContinue())
    {
        update();
        draw();
        handleEvents(); // This is last so it doesn't have to update and draw an extra frame if the state is supposed to change
    }
    return stateEvent;
}
开发者ID:ayebear,项目名称:undead-mmo,代码行数:15,代码来源:basestate.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ processBlock函数代码示例发布时间:2022-05-30
下一篇:
C++ processActionRoutine函数代码示例发布时间: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