本文整理汇总了C++中wxCmdLineParser::Usage方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::Usage方法的具体用法?C++ wxCmdLineParser::Usage怎么用?C++ wxCmdLineParser::Usage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCmdLineParser
的用法示例。
在下文中一共展示了wxCmdLineParser::Usage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCmdLineParsed
bool CFileView::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (parser.Found(wxT("version"))) {
cout << wxString::Format(wxT("MuleFileView version %u.%u.%u\nCopyright (c) 2008 aMule Team\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO);
return false;
} else {
wxString strDecode;
if (parser.Found(wxT("strings"), &strDecode)) {
if (strDecode == wxT("display")) {
SetStringsMode(SD_DISPLAY);
} else if (strDecode == wxT("safe")) {
SetStringsMode(SD_SAFE);
} else if (strDecode == wxT("utf8")) {
SetStringsMode(SD_UTF8);
} else if (strDecode == wxT("none")) {
SetStringsMode(SD_NONE);
} else {
parser.SetLogo(wxT("Error: Invalid argument to --strings option: \"") + strDecode + wxT("\""));
parser.Usage();
return false;
}
} else {
SetStringsMode(SD_DISPLAY);
}
for (size_t n = 0; n < parser.GetParamCount(); n++) {
m_files.push_back(parser.GetParam(n));
}
if (m_files.size() == 0) {
parser.Usage();
return false;
} else {
return true;
}
}
}
示例2: OnCmdLineError
bool wxAppConsoleBase::OnCmdLineError(wxCmdLineParser& parser)
{
parser.Usage();
return false;
}
示例3: OnCmdLineHelp
bool wxAppConsole::OnCmdLineHelp(wxCmdLineParser& parser)
{
parser.Usage();
return false;
}
示例4: OnCmdLineError
bool InjectorApp::OnCmdLineError(wxCmdLineParser& parser) {
//::wxMessageBox(parser.Usage(), "Command Line Error",wxICON_ERROR|wxOK);
parser.Usage();
return false;
}
示例5: OnCmdLineHelp
bool InjectorApp::OnCmdLineHelp(wxCmdLineParser& parser) {
//::wxMessageBox(parser.Usage(), "Command Line Options",wxICON_INFORMATION|wxOK);
parser.Usage();
return false;
}
示例6: OnCmdLineParsed
bool BenchApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if ( parser.Found(OPTION_LIST) )
{
ListBenchmarks();
return false;
}
const size_t count = parser.GetParamCount();
if ( !count )
{
parser.Usage();
ListBenchmarks();
return false;
}
bool numRunsSpecified = false;
if ( parser.Found(OPTION_AVG_COUNT, &m_avgCount) )
numRunsSpecified = true;
if ( parser.Found(OPTION_NUM_RUNS, &m_numRuns) )
numRunsSpecified = true;
parser.Found(OPTION_NUMERIC_PARAM, &m_numParam);
parser.Found(OPTION_STRING_PARAM, &m_strParam);
if ( parser.Found(OPTION_SINGLE) )
{
if ( numRunsSpecified )
{
wxFprintf(stderr, "Incompatible options specified.\n");
return false;
}
m_avgCount =
m_numRuns = 1;
}
// construct sorted array for quick verification of benchmark names
wxSortedArrayString benchmarks;
for ( Bench::Function *func = Bench::Function::GetFirst();
func;
func = func->GetNext() )
{
benchmarks.push_back(func->GetName());
}
for ( size_t n = 0; n < count; n++ )
{
const wxString name = parser.GetParam(n);
if ( benchmarks.Index(name) == wxNOT_FOUND )
{
wxFprintf(stderr, "No benchmark named \"%s\".\n", name);
return false;
}
m_toRun.push_back(name);
}
return BenchAppBase::OnCmdLineParsed(parser);
}
示例7: OnCmdLineError
bool SpinEditorApp::OnCmdLineError(wxCmdLineParser & parser)
{
parser.Usage();
return false;
}
示例8: OnCmdLineHelp
bool DrawApp::OnCmdLineHelp(wxCmdLineParser &parser) {
parser.Usage();
return false;
}
示例9: OnCmdLineParsed
bool CaMuleExternalConnector::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (parser.Found(wxT("version"))) {
printf("%s %s\n", m_appname, (const char *)unicode2char(GetMuleVersion()));
return false;
}
if (!parser.Found(wxT("config-file"), &m_configFileName)) {
m_configFileName = GetConfigDir() + wxT("remote.conf");
}
wxString aMuleConfigFile;
if (parser.Found(wxT("create-config-from"), &aMuleConfigFile)) {
aMuleConfigFile = FinalizeFilename(aMuleConfigFile);
if (!::wxFileExists(aMuleConfigFile)) {
fprintf(stderr, "%s\n", (const char *)unicode2char(wxT("FATAL ERROR: File does not exist: ") + aMuleConfigFile));
exit(1);
}
CECFileConfig aMuleConfig(aMuleConfigFile);
LoadAmuleConfig(aMuleConfig);
SaveConfigFile();
m_configFile->Flush();
exit(0);
}
LoadConfigFile();
if ( !parser.Found(wxT("host"), &m_host) ) {
if ( m_host.IsEmpty() ) {
m_host = wxT("localhost");
}
}
long port;
if (parser.Found(wxT("port"), &port)) {
m_port = port;
}
wxString pass_plain;
if (parser.Found(wxT("password"), &pass_plain)) {
if (!pass_plain.IsEmpty()) {
m_password.Decode(MD5Sum(pass_plain).GetHash());
} else {
m_password.Clear();
}
}
if (parser.Found(wxT("write-config"))) {
m_NeedsConfigSave = true;
}
parser.Found(wxT("locale"), &m_language);
if (parser.Found(wxT("help"))) {
parser.Usage();
return false;
}
m_KeepQuiet = parser.Found(wxT("quiet"));
m_Verbose = parser.Found(wxT("verbose"));
return true;
}
示例10: if
bool KICAD2MCAD::OnCmdLineParsed( wxCmdLineParser& parser )
{
#ifdef SUPPORTS_IGES
if( parser.Found( "fmt-iges" ) )
m_fmtIGES = true;
#endif
if( parser.Found( "f" ) )
m_overwrite = true;
if( parser.Found( "grid-origin" ) )
m_useGridOrigin = true;
if( parser.Found( "drill-origin" ) )
m_useDrillOrigin = true;
if( parser.Found( "no-virtual" ) )
m_includeVirtual = false;
wxString tstr;
if( parser.Found( "user-origin", &tstr ) )
{
std::istringstream istr;
istr.str( std::string( tstr.ToUTF8() ) );
istr >> m_xOrigin;
if( istr.fail() )
{
parser.Usage();
return false;
}
char tmpc;
istr >> tmpc;
if( istr.fail() || ( tmpc != 'x' && tmpc != 'X' ) )
{
parser.Usage();
return false;
}
istr >> m_yOrigin;
if( istr.fail() )
{
parser.Usage();
return false;
}
if( !istr.eof() )
{
std::string tunit;
istr >> tunit;
if( !tunit.compare( "in" ) || !tunit.compare( "inch" ) )
{
m_inch = true;
}
else if( tunit.compare( "mm" ) )
{
parser.Usage();
return false;
}
}