当前位置: 首页>>代码示例>>C++>>正文


C++ wxCmdLineParser::GetParamCount方法代码示例

本文整理汇总了C++中wxCmdLineParser::GetParamCount方法的典型用法代码示例。如果您正苦于以下问题:C++ wxCmdLineParser::GetParamCount方法的具体用法?C++ wxCmdLineParser::GetParamCount怎么用?C++ wxCmdLineParser::GetParamCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxCmdLineParser的用法示例。


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

示例1: OnCmdLineParsed

bool FlashApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    if ( parser.GetParamCount() )
        m_swf = parser.GetParam(0);

    return wxApp::OnCmdLineParsed(parser);
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:7,代码来源:flash.cpp

示例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);
}
开发者ID:gdos,项目名称:wxWidgets,代码行数:35,代码来源:test.cpp

示例3:

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();
	}
}
开发者ID:sergioengineer,项目名称:rpcs3,代码行数:26,代码来源:rpcs3.cpp

示例4: 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 );
}
开发者ID:SamVanheer,项目名称:HL_Tools,代码行数:8,代码来源:CModelViewerApp.cpp

示例5: 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;
}
开发者ID:3dfxmadscientist,项目名称:AMDOverdriveControlled,代码行数:35,代码来源:main.cpp

示例6: 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;

}
开发者ID:AlexHayton,项目名称:decoda,代码行数:32,代码来源:MainApp.cpp

示例7: 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;
}
开发者ID:BackupTheBerlios,项目名称:opendv-svn,代码行数:30,代码来源:GMSKRepeaterApp.cpp

示例8: 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;
		}
	}
}
开发者ID:dreamerc,项目名称:amule,代码行数:35,代码来源:FileView.cpp

示例9:

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;
}
开发者ID:Anoth3rone,项目名称:pcsx2,代码行数:35,代码来源:AppInit.cpp

示例10: 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 );
}
开发者ID:B-Rich,项目名称:wxpack,代码行数:30,代码来源:rootMain.cpp

示例11: 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);
}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:8,代码来源:app.cpp

示例12: 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);
   }
}
开发者ID:autosportlabs,项目名称:RaceAnalyzer,代码行数:8,代码来源:raceAnalyzer.cpp

示例13: OnCmdLineParsed

bool DecisionLogicApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
	if (parser.GetParamCount() > 0)
	{
		fileToOpen = parser.GetParam(0);
	}
	return true;
}
开发者ID:e1d1s1,项目名称:Logician,代码行数:8,代码来源:DecisionLogic.cpp

示例14: OnCmdLineParsed

bool ErrorApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
    errorMsg = wxT("{NO ERROR MESSAGE RECEIVED}");

    if (parser.GetParamCount() > 0)
        errorMsg = parser.GetParam(0);

    return true;
}
开发者ID:greebles,项目名称:greebles-desktop,代码行数:9,代码来源:ErrorApp.cpp

示例15: OnCmdLineParsed

bool DrawApp::OnCmdLineParsed(wxCmdLineParser &parser) {

	wxString geometry;

        /* Reads program geometry (X style) */

	x = y = width = height = -1;

        /* Read 'geometry' option. */
	if (parser.Found(_T("geometry"), &geometry)) 
		get_geometry(geometry, &x, &y, &width, &height);

	if (parser.Found(_T("v")))
    		wxLog::SetVerbose();

	m_full_screen = parser.Found(_T("f"));
	
	m_just_print_version = parser.Found(_("V"));

	parser.Found(_T("base"), &m_base);

	parser.Found(_T("url"), &m_url);

	m_show_logparams = parser.Found(_T("activity"));

	m_url_open_in_existing = parser.Found(_T("e"));

	if (m_base.IsEmpty())
		for (size_t i = 0; i < parser.GetParamCount(); ++i) {
			wxString arg = parser.GetParam(i);
			if (arg.StartsWith(_T("draw://"))) {
				m_url = arg;	
				break;
			}
		}

	long debug;
	if (parser.Found(_T("debug"), &debug))
		sz_loginit((int) debug, "draw3", SZ_LIBLOG_FACILITY_APP);
	else
		sz_loginit(2, "draw3", SZ_LIBLOG_FACILITY_APP);

	if (parser.Found(_T("4")))
		m_base_type = SZ4_BASE;

	if (parser.Found(_T("i"))) {
		m_base_type = IKS_BASE;

		if (!parser.Found(_T("iks-server"), &m_iks_server))
			m_iks_server = m_base;

		parser.Found(_T("iks-server-port"), &m_iks_port);
	}

	return true;
}
开发者ID:Strongc,项目名称:szarp,代码行数:56,代码来源:drawapp.cpp


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