本文整理汇总了C++中wxCmdLineParser::GetParam方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::GetParam方法的具体用法?C++ wxCmdLineParser::GetParam怎么用?C++ wxCmdLineParser::GetParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCmdLineParser
的用法示例。
在下文中一共展示了wxCmdLineParser::GetParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCmdLineParsed
bool FlashApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if ( parser.GetParamCount() )
m_swf = parser.GetParam(0);
return wxApp::OnCmdLineParsed(parser);
}
示例2: OnCmdLineParsed
bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
for (unsigned int i = 0; i < parser.GetParamCount(); ++i)
{
wxFileName fileName = parser.GetParam(i);
// File names sometimes come in in the short form from Windows, so convert
// to the long form.
if (fileName.GetExt().Lower() == "deproj")
{
// This is a project file, so save the name separately.
wxFileName fileName = parser.GetParam(i);
m_loadProjectName = fileName.GetLongPath();
}
else
{
wxFileName fileName = parser.GetParam(i);
m_loadFileNames.Add(fileName.GetLongPath());
}
}
#ifndef DEDICATED_PRODUCT_VERSION
parser.Found("debugexe", &m_debugExe);
#endif
return true;
}
示例3: ParseParams
void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
{
flagGettext = cmdline.Found("g");
flagVerbose = cmdline.Found("v");
flagCPP = cmdline.Found("c");
flagPython = cmdline.Found("p");
flagH = flagCPP && cmdline.Found("e");
flagValidateOnly = cmdline.Found("validate-only");
flagValidate = flagValidateOnly || cmdline.Found("validate");
cmdline.Found("xrc-schema", &parSchemaFile);
if (!cmdline.Found("o", &parOutput))
{
if (flagGettext)
parOutput = wxEmptyString;
else
{
if (flagCPP)
parOutput = wxT("resource.cpp");
else if (flagPython)
parOutput = wxT("resource.py");
else
parOutput = wxT("resource.xrs");
}
}
if (!parOutput.empty())
{
wxFileName fn(parOutput);
fn.Normalize();
parOutput = fn.GetFullPath();
parOutputPath = wxPathOnly(parOutput);
}
if (!parOutputPath) parOutputPath = wxT(".");
if (!cmdline.Found("n", &parFuncname))
parFuncname = wxT("InitXmlResource");
for (size_t i = 0; i < cmdline.GetParamCount(); i++)
{
#ifdef __WINDOWS__
wxString fn=wxFindFirstFile(cmdline.GetParam(i), wxFILE);
while (!fn.empty())
{
parFiles.Add(fn);
fn=wxFindNextFile();
}
#else
parFiles.Add(cmdline.GetParam(i));
#endif
}
}
示例4:
bool Pcsx2App::OnCmdLineParsed( wxCmdLineParser& parser )
{
if( parser.Found(L"console") )
{
Startup.ForceConsole = true;
OpenProgramLog();
}
// Suppress wxWidgets automatic options parsing since none of them pertain to PCSX2 needs.
//wxApp::OnCmdLineParsed( parser );
m_UseGUI = !parser.Found(L"nogui");
if( !ParseOverrides(parser) ) return false;
// --- Parse Startup/Autoboot options ---
Startup.NoFastBoot = parser.Found(L"fullboot");
Startup.ForceWizard = parser.Found(L"forcewiz");
Startup.PortableMode = parser.Found(L"portable");
if( parser.GetParamCount() >= 1 )
{
Startup.IsoFile = parser.GetParam( 0 );
Startup.SysAutoRun = true;
}
if( parser.Found(L"usecd") )
{
Startup.CdvdSource = CDVDsrc_Plugin;
Startup.SysAutoRun = true;
}
return true;
}
示例5: OnCmdLineParsed
// Handle command line options
//
bool TestApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (parser.GetParamCount())
{
for (size_t i = 0; i < parser.GetParamCount(); i++)
m_registries.push_back(parser.GetParam(i));
}
m_longlist = parser.Found("longlist");
m_list = m_longlist || parser.Found("list");
m_timing = parser.Found("timing");
m_detail = !m_timing && parser.Found("detail");
wxString loc;
if ( parser.Found("locale", &loc) )
{
const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(loc);
if ( !info )
{
cerr << "Locale \"" << string(loc.mb_str()) << "\" is unknown.\n";
return false;
}
m_locale = new wxLocale(info->Language);
if ( !m_locale->IsOk() )
{
cerr << "Using locale \"" << string(loc.mb_str()) << "\" failed.\n";
return false;
}
}
return TestAppBase::OnCmdLineParsed(parser);
}
示例6: ShowCmdLine
static void ShowCmdLine( const wxCmdLineParser& parser )
{
wxString s = wxT("Input files: ");
size_t count = parser.GetParamCount();
for ( size_t param = 0; param < count; param++ )
{
s << parser.GetParam( param ) << ' ';
}
s << '\n'
<< wxT("Verbose:\t") << ( parser.Found(wxT("v")) ? wxT("yes") : wxT("no") ) << '\n'
<< wxT("Quiet:\t") << ( parser.Found(wxT("q")) ? wxT("yes") : wxT("no") ) << '\n';
wxString strVal;
long lVal;
wxDateTime dt;
if ( parser.Found( wxT("o"), &strVal ) )
s << wxT("Output file:\t") << strVal << '\n';
if ( parser.Found( wxT("i"), &strVal ) )
s << wxT("Input dir:\t") << strVal << '\n';
if ( parser.Found( wxT("s"), &lVal ) )
s << wxT("Size:\t") << lVal << '\n';
if ( parser.Found( wxT("d"), &dt ) )
s << wxT("Date:\t") << dt.FormatISODate() << '\n';
if ( parser.Found( wxT("project_name"), &strVal ) )
s << wxT("Project:\t") << strVal << '\n';
wxLogMessage( s );
}
示例7:
void Rpcs3App::OnArguments(const wxCmdLineParser& parser)
{
// Usage:
// rpcs3-*.exe Initializes RPCS3
// rpcs3-*.exe [(S)ELF] Initializes RPCS3, then loads and runs the specified (S)ELF file.
if (parser.FoundSwitch("t"))
{
if (parser.GetParamCount() != 1)
{
wxLogDebug("A (S)ELF file needs to be given in test mode, exiting.");
this->Exit();
}
// TODO: clean implementation
g_cfg_autostart = true;
g_cfg_autoexit = true;
}
if (parser.GetParamCount() > 0)
{
Emu.SetPath(fmt::ToUTF8(parser.GetParam(0)));
Emu.Load();
Emu.Run();
}
}
示例8: OnCmdLineParsed
bool CGMSKRepeaterApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (!wxApp::OnCmdLineParsed(parser))
return false;
m_nolog = parser.Found(NOLOGGING_SWITCH);
m_gui = parser.Found(GUI_SWITCH);
wxString logDir;
bool found = parser.Found(LOGDIR_OPTION, &logDir);
if (found)
m_logDir = logDir;
wxString confDir;
found = parser.Found(CONFDIR_OPTION, &confDir);
if (found)
m_confDir = confDir;
wxString audioDir;
found = parser.Found(AUDIODIR_OPTION, &audioDir);
if (found)
m_audioDir = audioDir;
else
m_audioDir = ::wxGetHomeDir();
if (parser.GetParamCount() > 0U)
m_name = parser.GetParam(0U);
return true;
}
示例9: 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;
}
}
}
示例10: OnCmdLineParsed
bool MainApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
mStartHidden = false;
mBatchMode = parser.Found(wxT("b"));
mEnableAppProfiles = parser.Found(wxT("a"));
if (mBatchMode || mEnableAppProfiles)
{
mStartHidden = true;
}
if (!parser.Found(wxT("c"), &mColorTemp))
{
mColorTemp = 0;
}
else
{
mStartHidden = true;
}
if (!parser.Found(wxT("i"), &mGPUIndex))
{
mGPUIndex = 0;
}
if (parser.GetParamCount() > 0)
{
mProfileName = parser.GetParam(0);
mStartHidden = true;
}
return true;
}
示例11: OnInitCmdLine
void RaceAnalyzerApp::OnInitCmdLine(wxCmdLineParser& parser){
parser.AddParam("",wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.Parse(false);
if (parser.GetParamCount() > 0){
wxString mjljConfigFile = parser.GetParam(0);
_mainFrame->OpenRaceEvent(mjljConfigFile);
}
}
示例12: OnCmdLineParsed
bool App::OnCmdLineParsed(wxCmdLineParser& parser)
{
for (size_t i = 0; i < parser.GetParamCount(); i++)
{
m_cmdLine.m_fileNames.Add(wxFileName(parser.GetParam(i)));
}
return wxApp::OnCmdLineParsed(parser);
}
示例13: OnCmdLineParsed
bool CModelViewerApp::OnCmdLineParsed( wxCmdLineParser& parser )
{
//Last parameter is the model to load.
if( parser.GetParamCount() > 0 )
m_szModel = parser.GetParam( parser.GetParamCount() - 1 );
return wxApp::OnCmdLineParsed( parser );
}
示例14: OnCmdLineParsed
bool DecisionLogicApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (parser.GetParamCount() > 0)
{
fileToOpen = parser.GetParam(0);
}
return true;
}
示例15: OnCmdLineParsed
bool ErrorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
errorMsg = wxT("{NO ERROR MESSAGE RECEIVED}");
if (parser.GetParamCount() > 0)
errorMsg = parser.GetParam(0);
return true;
}