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

C++ displayHelp函数代码示例

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

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



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

示例1: getopt_process_args

void	getopt_process_args(int argc, char *argv[])
{
	int opt;
	while ((opt = getopt(argc, argv, "xc:p:l:")) != -1) {
		switch(opt) {
			case 'x':
				runAsDaemon = FALSE;
				break;
			case 'c':
				config_filename = strdup(optarg);
				break;
			case 'p':
				pid_filename = strdup(optarg);
				break;
			case 'h':
				displayHelp ();
				exit (EXIT_SUCCESS);
				break;
			case 'l':
				log_filename = strdup(optarg);
				break;
			default:
				displayHelp ();
				exit (EXIT_FAILURE);
		}
	}
}
开发者ID:m3l3m01t,项目名称:antinat,代码行数:27,代码来源:main.c


示例2: displayHelp

void Wrapper::assignVariables() {
    //set file name
    fileName = args.value("arg-1");

    //set typesystem filename
    typesystemFileName = args.value("arg-2");
    if (args.contains("arg-3"))
        displayHelp(gs);

    //set filename to default masterinclude if is empty
    if (fileName.isEmpty())
        fileName = default_file;

    //if type system filename is empty, set it to default system file...
    if (typesystemFileName.isEmpty())
        typesystemFileName = default_system;

    //if filename or typesystem filename is still empty, show help
    if (fileName.isEmpty() || typesystemFileName.isEmpty())
        displayHelp(gs);

    //if generatorset can't read arguments, show help
    if (!gs->readParameters(args))
        displayHelp(gs);
}
开发者ID:dylan-foundry,项目名称:qt-generator,代码行数:25,代码来源:wrapper.cpp


示例3: main

int main (int argc, char **argv)
{
    char *datasourceName;
    char *datasourceArg;
    char  datasourceResult[SNOOPY_DATASOURCE_MESSAGE_MAX_SIZE];
    int   retVal;


    /* Initialize Snoopy */
    snoopy_inputdatastorage_store_filename(argv[0]);
    snoopy_inputdatastorage_store_argv(argv);


    /* Check if there is a data source name passed as an argument */
    if (argc < 2) {
        displayHelp();
        return fatalError("Missing argument: datasource name or '--list'");
    }
    datasourceName = argv[1];


    /* Is second argument --list? */
    if (0 == strcmp(argv[1], "--list")) {

        /* Loop throught all data sources and just append the output */
        int i = 0;
        while (strcmp(snoopy_datasourceregistry_names[i], "") != 0) {
            printf("%s\n", snoopy_datasourceregistry_names[i]);
            i++;
        }
        return 0;
    }


    /* Check if what we got is a valid datasource name */
    if (SNOOPY_FALSE == snoopy_datasourceregistry_isRegistered(datasourceName)) {
        displayHelp();
        return fatalError("Invalid datasource name given");
    }

    /* Is there an argument for this data source */
    if (2 < argc) {
        datasourceArg = argv[2];
    } else {
        datasourceArg = "";
    }


    /* Call the datasource */
    retVal = snoopy_datasourceregistry_call(datasourceName, datasourceResult, datasourceArg);
    if (SNOOPY_DATASOURCE_FAILED(retVal)) {
        return fatalError("Datasource failed");
    }


    /* Display and return */
    printf("%s\n", datasourceResult);
    return 0;
}
开发者ID:liorco300,项目名称:snoopy,代码行数:59,代码来源:snoopy-test-datasource.c


示例4: main

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

    //Parsing arguments
    //There will be only three arguments, so no detailed parsing is required.
    std::cout<<"zimpatch\n"<<std::flush;
    for(int i=0; i<argc; i++)
    {
        if(std::string(argv[i])=="-h")
        {
            displayHelp();
            return 0;
        }

        if(std::string(argv[i])=="-H")
        {
            displayHelp();
            return 0;
        }

        if(std::string(argv[i])=="--help")
        {
            displayHelp();
            return 0;
        }
    }
    if(argc<4)
    {
        std::cout<<"\n[ERROR] Not enough Arguments provided\n";
        displayHelp();
        return -1;
    }

    //Strings containing the filenames of the start_file, diff_file and end_file.
    std::string start_filename =argv[1];
    std::string diff_filename =argv[2];
    std::string end_filename= argv[3];
    std::cout<<"\nStart File: "<<start_filename;
    std::cout<<"\nDiff File: "<<diff_filename;
    std::cout<<"\nEnd File: "<<end_filename<<"\n";
    try
    {
        //Callling zimwriter to create the diff_file

        zim::writer::ZimCreator c(argc, argv);
        //Create the article source class, from which the content for the file will be read.
        ArticleSource src(start_filename,diff_filename);
        //Create the actual file.
        c.create(end_filename,src);

    }
    catch (const std::exception& e)
    {
        std::cerr << e.what() << std::endl;
    }
}
开发者ID:kelson42,项目名称:zimpatch,代码行数:56,代码来源:zimpatch.cpp


示例5: displayHelp

// ------------------------------------Display Help----------------------------------------------- 
// Description: Displays contents of tree recursively inorder
// -------------------------------------------------------------------------------------------------------------
string BinTree::displayHelp(string john, Node *node) const
{
    if(node->left != NULL)
        displayHelp(john, node->left);

    cout << *node->data << " ";

    if(node->right != NULL)
        displayHelp(john, node->right);

     return john;
}
开发者ID:JohnFZoeller,项目名称:Class---BinarySearchTree,代码行数:15,代码来源:bintree.cpp


示例6: contextMenu

void nineButtonSelector::contextMenuEvent( QContextMenuEvent * )
{
	captionMenu contextMenu( windowTitle() );
	contextMenu.addAction( embed::getIconPixmap( "help" ), tr( "&Help" ),
			       this, SLOT( displayHelp() ) );
	contextMenu.exec( QCursor::pos() );
}
开发者ID:Orpheon,项目名称:lmms,代码行数:7,代码来源:nine_button_selector.cpp


示例7: main

	int main(const std::vector<std::string>& args)
	{
		if (_helpRequested)
		{
			displayHelp();
		}
		else
		{
			// get parameters from configuration file
			unsigned short port = (unsigned short)config().getInt("TimeServer.port", 9911);
			std::string format(config().getString("TimeServer.format", Poco::DateTimeFormat::ISO8601_FORMAT));

			// set-up a server socket
			Poco::Net::ServerSocket svs(port);
			// set-up a TCPServer instance
			Poco::Net::TCPServer srv(new TimeServerConnectionFactory(format), svs);
			// start the TCPServer
			srv.start();

			// start push thread
			Poco::Thread thread;
			PushRunnable runnable;
			thread.start(runnable);

			// wait for CTRL-C or kill
			waitForTerminationRequest();
			// Stop the TCPServer
			srv.stop();
		}
		return Application::EXIT_OK;
	}
开发者ID:jacking75,项目名称:Poco_network_sample,代码行数:31,代码来源:tcpserver_EchoServerEx.cpp


示例8: handleCommand

static void handleCommand(char *input) {
	int arg;
	char *newline;

	newline = strchr(input, '\n');
	if (newline != NULL) {
		*newline = '\0';
	}
	if (sscanf(input, "hidePid %d", &arg) == 1) {
		hideProcess(arg);
	} else if (sscanf(input, "showPid %d", &arg) == 1) {
		showProcess(arg);
	} else if (!strcmp(input, "showModule")) {
		moduleHide_stop();
	} else if (!strcmp(input, "hideModule")) {
		moduleHide_start();
	} else if (!strcmp(input, "startLog")) {
		logInput_init();
	} else if (!strcmp(input, "stopLog")) {
		logInput_exit();
	} else if (!strcmp(input, "getRoot")) {
		getRoot();
	} else if (!strcmp(input, "help")) {
		displayHelp();
	} else {
		addStringToOutputDevice("command not recognised\n");
	}

	//TODO: add a command to display hidden pids
}
开发者ID:dean2020,项目名称:rootkit,代码行数:30,代码来源:communication.c


示例9: glClear

void KinematicMovementDemo::display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    gluLookAt(-53.0f, 53.0f, 0.0f,
              0.0f, -30.0f, 0.0f,
              0.0f, 1.0f, 0.0f);

    // Draw the characters.
    glColor3f(0.6f, 0.0f, 0.0f);
    renderAgent(location[0]);
    glColor3f(0.0f, 0.6f, 0.0f);
    renderAgent(location[1]);

    // Draw some scale lines
    glColor3f(0.8, 0.8, 0.8);
    glBegin(GL_LINES);
    for (int i = -WORLD_SIZE; i <= WORLD_SIZE; i += GRID_SIZE) {

        glVertex3i(-WORLD_SIZE, -1, i);
        glVertex3i(WORLD_SIZE, -1, i);

        glVertex3i(i, -1, WORLD_SIZE);
        glVertex3i(i, -1, -WORLD_SIZE);
    }
    glEnd();

    // Draw the help (the method decides if it should be displayed)
    displayHelp();
}
开发者ID:AdamFarhat,项目名称:aicore,代码行数:30,代码来源:kinematic_demo.cpp


示例10: main

  int main(const std::vector<std::string>& args)
  {
    ScopedLogMessage msg(" main() ", "start", "end");
 
    if(m_helpRequested)
      {
	displayHelp();
      }
    else
      {
	CommandDispatcher	commandDispatcher(msg);
 
	unsigned short port = (unsigned short) config().getInt("MyTCPServer.port", 9923);
	Poco::Net::ServerSocket svs(port);
	Poco::Net::TCPServer srv(new TCPConnectionFactory(msg, commandDispatcher),
				 svs, new Poco::Net::TCPServerParams);
	srv.start();
 
	// wait for CTRL-C or kill
	waitForTerminationRequest();
 
	srv.stop();
      }
    return Poco::Util::Application::EXIT_OK;
  }
开发者ID:ppatoria,项目名称:cpp,代码行数:25,代码来源:tcp-server.cpp


示例11: QDialog

FilenameFolderDialog::FilenameFolderDialog(QWidget *parent) : QDialog(parent)
{
    int		i_minWidth = 8*fontMetrics().width( 'w' ) + 2;

// **********************************************************************************************
// Dialog

    setupUi( this );

    connect( OKButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( CancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( HelpButton, SIGNAL( clicked() ), this, SLOT( displayHelp() ) );
    connect( browseFilenameListFileButton, SIGNAL( clicked() ), this, SLOT( browseFilenameListFileDialog() ) );
    connect( browseTargetDirectoryButton, SIGNAL( clicked() ), this, SLOT( browseTargetDirectoryDialog() ) );
    connect( FilenameListFileLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( enableOKButton() ) );
    connect( TargetDirectoryLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( enableOKButton() ) );

// **********************************************************************************************

    FileTextLabel->setMinimumWidth( i_minWidth );
    DirTextLabel->setMinimumWidth( i_minWidth );

    enableOKButton();

    OKButton->setFocus();
}
开发者ID:rsieger,项目名称:PanTool,代码行数:26,代码来源:FilenameFolderDialog.cpp


示例12: captionMenu

void FxLine::contextMenuEvent( QContextMenuEvent * )
{
	FxMixer * mix = engine::fxMixer();
	QPointer<captionMenu> contextMenu = new captionMenu( mix->effectChannel( m_channelIndex )->m_name );
	if( m_channelIndex != 0 ) // no move-options in master 
	{
		contextMenu->addAction( tr( "Move &left" ),	this, SLOT( moveChannelLeft() ) );
		contextMenu->addAction( tr( "Move &right" ), this, SLOT( moveChannelRight() ) );
	}
	contextMenu->addAction( tr( "Rename &channel" ), this, SLOT( renameChannel() ) );
	contextMenu->addSeparator();
	
	if( m_channelIndex != 0 ) // no remove-option in master
	{
		contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "R&emove channel" ),
							this, SLOT( removeChannel() ) );
		contextMenu->addSeparator();
	}
	
	contextMenu->addAction( embed::getIconPixmap( "help" ),
						tr( "&Help" ),
						this, SLOT( displayHelp() ) );
	contextMenu->exec( QCursor::pos() );
	delete contextMenu;
}
开发者ID:Cubiicle,项目名称:lmms,代码行数:25,代码来源:FxLine.cpp


示例13: QWidget

toSearchReplace::toSearchReplace(QWidget *parent)
    : QWidget(parent)
    , toHelpContext(QString::fromLatin1("searchreplace.html"))
{
    setupUi(this);
    SearchNext->setIcon(QIcon(":/icons/find_next.png"));
    SearchPrevious->setIcon(QIcon(":/icons/find_prev.png"));
    Replace->setIcon(QIcon(":/icons/replace_next.png"));
    ReplaceAll->setIcon(QIcon(":/icons/replace_all.png"));

    hideButton->setIcon(QPixmap(const_cast<const char**>(close_xpm)));

    QAction *action = new QAction(this);
    action->setShortcut(QKeySequence::HelpContents);
    connect(action, SIGNAL(triggered()), this, SLOT(displayHelp()));

    action = new QAction(Replace);
    action->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_R);
    Replace->addAction(action);

    connect(SearchNext, SIGNAL(clicked()), this, SLOT(act_searchNext()));
    connect(SearchPrevious, SIGNAL(clicked()), this, SLOT(act_searchPrevious()));
    connect(Replace, SIGNAL(clicked()), this, SLOT(act_replace()));
    connect(ReplaceAll, SIGNAL(clicked()), this, SLOT(act_replaceAll()));
    connect(hideButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(SearchText, SIGNAL(editTextChanged(const QString &)),
            this, SLOT(act_searchChanged(const QString &)));
}
开发者ID:nguyentienlong,项目名称:tora,代码行数:28,代码来源:tosearchreplace.cpp


示例14: main

 virtual int main(const std::vector<std::string> &args) override {
     if(args.size() > 0) {
         logger().warning("You supplied arguments; program does not take any");
         displayHelp();
         return TwitterSubliminalDecode::EXIT_USAGE;
     }
     if (terminate_early) {
         return TwitterSubliminalDecode::EXIT_OK;
     }
     block_size = config().getUInt("blocksize");
     logger().information("Decoding subliminal message with block size %?u from Twitter.", block_size);
     std::string result;
     DO_CASE(block_size);
     logger().information("Successfully decoded message of size %?u bytes.", result.size());
     if(!config().has("output_path")) {
         logger().information(result);
     } else {
         auto output_path = config().getString("output_path");
         std::ofstream file_out(output_path);
         if(file_out.fail()) {
             logger().critical("Unable to open %s for writing.", output_path);
             return TwitterSubliminalDecode::EXIT_IOERR;
         }
         file_out << result;
         logger().information("Wrote output to %s", output_path);
     }
     return TwitterSubliminalDecode::EXIT_OK;
 };
开发者ID:JLospinoso,项目名称:twitter-subliminal,代码行数:28,代码来源:decode_main.cpp


示例15: main

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

    //at least one projectors has to be connected
    if (argc < 2
        || 0 == strcasecmp(argv[1], "-h")
        || 0 == strcasecmp(argv[1], "--help"))
    {
        displayHelp(argv[0]);
        exit(-1);
    }

// ----- create default values for all options
#ifdef __linux__
    static const char *DEF_SERIAL = "/dev/ttyS1";
#else
    static const char *DEF_SERIAL = "/dev/ttyd1";
#endif

    const char *serialPort = arg.getOpt("-d", "--device", DEF_SERIAL);

    ////// Echo it
    fprintf(stderr, "\n");
    fprintf(stderr, "  +-----------------------------------------------------+\n");
    fprintf(stderr, "  + %25s  (C) 2005 VISENSO GmbH   +\n", VesaVersion);
    fprintf(stderr, "  +-----------------------------------------------------+\n");
    fprintf(stderr, "  + Settings:                                           +\n");
    fprintf(stderr, "  + \n");
    fprintf(stderr, "  +   Serial Interface:  %-30s +\n", serialPort);
    fprintf(stderr, "  +-----------------------------------------------------+\n");
    fprintf(stderr, "\n");

    /// establich some signal handlers
    signal(SIGINT, sigHandler);
    signal(SIGPIPE, sigHandler);
    signal(SIGCHLD, sigHandler);
    signal(SIGTERM, sigHandler);
    signal(SIGHUP, sigHandler);
#ifndef __linux__
    prctl(PR_TERMCHILD); // Exit when parent does
#else
    prctl(PR_SET_PDEATHSIG, SIGTERM);
#endif

    /// open serial port
    SerialCom serial(serialPort, 2400, 8, 'N', 2);
    if (serial.isBad())
    {
        cerr << serialPort << ": "
             << serial.errorMessage() << endl;
        return -1;
    }

    char buf[8];
    sprintf(buf, ".DM41!");
    serial.write((void *)buf, 6);
}
开发者ID:nixz,项目名称:covise,代码行数:58,代码来源:Vesa.cpp


示例16: contextMenu

void vibedView::contextMenuEvent( QContextMenuEvent * )
{

	captionMenu contextMenu( model()->displayName() );
	contextMenu.addAction( embed::getIconPixmap( "help" ), tr( "&Help" ),
					this, SLOT( displayHelp() ) );
	contextMenu.exec( QCursor::pos() );

}
开发者ID:Orpheon,项目名称:lmms,代码行数:9,代码来源:vibed.cpp


示例17: QAction

void toHelp::connectDialog(QDialog *dialog)
{
    QAction *a = new QAction(dialog);
    a->setShortcut(Utils::toKeySequence(tr("F1", "Dialog|Help")));
    connect(a,
            SIGNAL(triggered()),
            &HelpTool,
            SLOT(displayHelp()));
}
开发者ID:Daniel1892,项目名称:tora,代码行数:9,代码来源:tohelp.cpp


示例18: main

int main(int argc, char ** argv)
{
	std::cout << "--------------------------------------------" << std::endl
		      << "Pakunpaker v1.0 by Xesc & Technology 2008-09" << std::endl 
		      << "--------------------------------------------" << std::endl << std::endl;
	
	if (argc > 2)
	{
		// create a new package
		if (strcmp(argv[1], "-i") == 0)
		{
			Packer *packer = new Packer;
			
			for (int param = 3; param < argc; param++)
			{
				packer->addFile(std::string(argv[param]));
				std::cout << "added: " << argv[param] << std::endl;
			}
			
			packer->buildPackage(argv[2]);
			std::cout << "Package build: " << argv[2] << std::endl;
			
			delete packer;
		}
		// extract files from package
		else if ((strcmp(argv[1], "-o") == 0 || strcmp(argv[1], "-oo") == 0) && argc == 4)
		{
			Unpacker *unpacker = new Unpacker;
			
			unpacker->extractPackage(std::string(argv[2]), std::string(argv[3]), strcmp(argv[1], "-o") == 0);
			
			for (int n = 0; n < unpacker->getExtractedFilesCount(); n++)
				std::cout << "Unpacked file " << n + 1 << " to: " << unpacker->getExtractedFileName(n) << std::endl;
			
			delete unpacker;
		}
		else // unknonw parameters
			displayHelp();
	}
	else // invalid parameters
		displayHelp();

	return 0;
}
开发者ID:JoeyPinilla,项目名称:xVideoServiceThief,代码行数:44,代码来源:main.cpp


示例19: glClear

void Application::display()
{
    glClear(GL_COLOR_BUFFER_BIT);

    glBegin(GL_LINES);
    glVertex2i(1, 1);
    glVertex2i(639, 319);
    glEnd();

    displayHelp();
}
开发者ID:AdamFarhat,项目名称:aicore,代码行数:11,代码来源:app.cpp


示例20: init

//-------------------------------------------------------------------------
//  Set OpenGL program initial state.
//-------------------------------------------------------------------------
void init ()
{	
	//  Set the frame buffer clear color to black.
	glClearColor (0.0, 0.0, 0.0, 0.0);

	//  Initialize shapes' attributes
	initShapes ();

	//  Display Help Message
	displayHelp ();
}
开发者ID:AM1244,项目名称:Blog,代码行数:14,代码来源:Shapes.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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