本文整理汇总了C++中displayHelp函数的典型用法代码示例。如果您正苦于以下问题:C++ displayHelp函数的具体用法?C++ displayHelp怎么用?C++ displayHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayHelp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
示例6: contextMenu
void nineButtonSelector::contextMenuEvent( QContextMenuEvent * )
{
captionMenu contextMenu( windowTitle() );
contextMenu.addAction( embed::getIconPixmap( "help" ), tr( "&Help" ),
this, SLOT( displayHelp() ) );
contextMenu.exec( QCursor::pos() );
}
示例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;
}
示例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
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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 &)));
}
示例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;
};
示例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);
}