本文整理汇总了C++中wxCmdLineParser::Found方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::Found方法的具体用法?C++ wxCmdLineParser::Found怎么用?C++ wxCmdLineParser::Found使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxCmdLineParser
的用法示例。
在下文中一共展示了wxCmdLineParser::Found方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCmdLineParsed
bool MultiMC::OnCmdLineParsed(wxCmdLineParser& parser)
{
wxString parsedOption;
if(parser.Found("d", &parsedOption))
{
if (!wxDirExists(parsedOption))
{
std::cerr << "Provided directory doesn't exist!" << std::endl;
return false;
}
providedDir.AssignDir( parsedOption );
if(!providedDir.IsDirReadable() || !providedDir.IsDirWritable())
{
std::cerr << "You don't have read or write rights for the provided directory!" << std::endl;
return false;
}
useProvidedDir = true;
}
if (parser.Found("u", &parsedOption))
{
updateQuiet = parser.Found("U");
thisFileName = wxStandardPaths::Get().GetExecutablePath();
updateTarget = parsedOption;
startMode = START_INSTALL_UPDATE;
return true;
}
else if(parser.Found("l", &parsedOption))
{
launchInstance = parsedOption;
startMode = START_LAUNCH_INSTANCE;
return true;
}
return true;
}
示例2: 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);
}
示例3: OnCmdLineParsed
bool EViacamApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
bool debug_mode= parser.Found(wxT("d"));
#ifndef NDEBUG
debug_mode = true;
#endif
if (debug_mode) {
// Set log priority level
slog_set_priority (SLOG_PRIO_DEBUG);
#if defined(WIN32)
AllocConsole();
freopen("CONOUT$", "wb", stdout);
freopen("CONOUT$", "wb", stderr);
slog_write (SLOG_PRIO_INFO, "debug mode enabled");
#endif
}
wxString custom_config_path;
bool custom_config= parser.Found(wxT("c"), &custom_config_path);
if (custom_config) {
wxFileConfig* customFileConfig = new wxFileConfig(wxEmptyString, wxEmptyString,
custom_config_path, custom_config_path,
wxCONFIG_USE_LOCAL_FILE);
wxConfigBase::Set(customFileConfig);
}
return true;
}
示例4: 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;
}
示例5: OnCmdLineParsed
bool SpinEditorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
spin::spinApp &spin = spin::spinApp::Instance();
if (parser.Found(wxT("v")))
{
std::cout << "SPIN Framework: version " << VERSION << std::endl;
return false;
}
wxString sceneID;
if (parser.Found(wxT("s"), &sceneID))
spin.setSceneID(sceneID.ToStdString());
wxString userID;
if (parser.Found(wxT("u"), &userID))
spin.setUserID(userID.ToStdString());
wxString serverAddr;
if (parser.Found(wxT("r"), &serverAddr))
{
spinListener.lo_txAddrs_.clear();
spinListener.lo_txAddrs_.push_back(lo_address_new_from_url(serverAddr.c_str()));
}
return true;
}
示例6: OnCmdLineParsed
bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
int numModeOptions = 0;
#if wxUSE_MDI_ARCHITECTURE
if ( parser.Found(CmdLineOption::MDI) )
{
m_mode = Mode_MDI;
numModeOptions++;
}
#endif // wxUSE_MDI_ARCHITECTURE
if ( parser.Found(CmdLineOption::SDI) )
{
m_mode = Mode_SDI;
numModeOptions++;
}
if ( parser.Found(CmdLineOption::SINGLE) )
{
m_mode = Mode_Single;
numModeOptions++;
}
if ( numModeOptions > 1 )
{
wxLogError("Only a single option choosing the mode can be given.");
return false;
}
return wxApp::OnCmdLineParsed(parser);
}
示例7: 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;
}
}
}
示例8: OnCmdLineParsed
bool CubicSDR::OnCmdLineParsed(wxCmdLineParser& parser) {
wxString *confName = new wxString;
if (parser.Found("c",confName)) {
if (confName) {
config.setConfigName(confName->ToStdString());
}
}
config.load();
#ifdef BUNDLE_SOAPY_MODS
if (parser.Found("b")) {
useLocalMod.store(false);
} else {
useLocalMod.store(true);
}
#else
useLocalMod.store(true);
#endif
wxString *modPath = new wxString;
if (parser.Found("m",modPath)) {
if (modPath) {
modulePath = modPath->ToStdString();
} else {
modulePath = "";
}
}
return true;
}
示例9: 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;
}
示例10:
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;
}
示例11: OnCmdLineParsed
bool MacUninstallApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
m_bBatchMode = parser.Found(wxT("batch"));
m_bTestMode = parser.Found(wxT("test"));
if (m_bTestMode)
m_bBatchMode = true;
return true;
}
示例12: OnCmdLineParsed
bool VisualCreatePatch::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (!parser.Found(wxT("o"), &m_oldDirectory)) return false;
if (!parser.Found(wxT("n"), &m_newDirectory)) return false;
if (!parser.Found(wxT("p"), &m_outputFilename)) return false;
return true;
}
示例13: OnCmdLineParsed
bool
AnsiConvApp::OnCmdLineParsed(wxCmdLineParser &parser)
{
parser.Found("i", &input_name);
parser.Found("o", &output_name);
parser.Found("e", &encoding);
return wxAppConsole::OnCmdLineParsed(parser);
}
示例14: OnCmdLineParsed
bool EkstrApp::OnCmdLineParsed(wxCmdLineParser &parser) {
if (!parser.Found(_T("geometry"), &geometry)) {
geometry = wxString();
}
if (!parser.Found(_T("base"), &base)) {
base = wxString();
}
return true;
}
示例15: checkCreateOption
/**
* Checks the compatibility of the create option with other options or switchs.
*
* @param parser Command line parser.
* @return <CODE>true</CODE> if the create option is compatible with other
* options or switchs, <CODE>false</CODE> otherwise.
*/
bool CmdLineOptions::checkCreateOption(const wxCmdLineParser& parser)
{
wxString param;
if (parser.Found(wxT("c"), ¶m))
{
param = param.Strip(wxString::both);
// Remove the path separators at the end of the file name
wxString seps = wxFileName::GetPathSeparators();
while (!param.empty() && seps.Find(param.Last()) != -1)
param.RemoveLast();
wxFileName fn(param);
// Checks for incompatible switchs or options.
if (parser.Found(wxT("v")))
{
msgOut->Printf(_("The create option and the verify switch are incompatibles."));
return false;
}
if (parser.Found(wxT("a")))
{
msgOut->Printf(_("The create and append options are incompatibles."));
return false;
}
// Checks if the file name to create is empty.
if (param.empty())
{
msgOut->Printf(_("The name of the checksums' file to create is empty."));
return false;
}
// Make the file name to create absolute if needed.
if (!fn.IsAbsolute())
fn.MakeAbsolute(wxFileName::GetCwd());
// checks if the directory of the file to create exists
if (!wxFileName::DirExists(fn.GetPath(wxPATH_GET_VOLUME)))
{
msgOut->Printf(_("The directory %s doesn't exist."), fn.GetPath(wxPATH_GET_VOLUME).c_str());
return false;
}
// Make the names of the files to add absolute.
makeFilesListAbsolute(::wxGetCwd());
checksumsFileName = fn.GetFullPath();
// Set the action to do.
action = aCreate;
}
return true;
}