本文整理汇总了C++中CommandLine::argc方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandLine::argc方法的具体用法?C++ CommandLine::argc怎么用?C++ CommandLine::argc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandLine
的用法示例。
在下文中一共展示了CommandLine::argc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: merge
void CommandLine::merge(const CommandLine &args)
{
// Skip first argument if it is the module name.
const int firstArg = (args.arg(0)[0] == '-' ? 0 : 1);
for (int i = firstArg; i < args.argc(); ++i)
{
append(args.arg(i));
}
}
示例2: initManager
void CommandLineModuleManagerTestBase::initManager(
const CommandLine &args, const char *realBinaryName)
{
impl_->manager_.reset();
impl_->programContext_.reset(
new gmx::CommandLineProgramContext(args.argc(), args.argv()));
impl_->manager_.reset(new gmx::CommandLineModuleManager(
realBinaryName, impl_->programContext_.get()));
impl_->manager_->setQuiet(true);
impl_->manager_->setOutputRedirector(&impl_->redirector_);
}
示例3: rootChecker
void
AbstractTrajectoryAnalysisModuleTestFixture::runTest(const CommandLine &args)
{
TrajectoryAnalysisModule &module = impl_->module();
// Skip first argument if it is the module name.
int firstArg = (args.arg(0)[0] == '-' ? 0 : 1);
for (int i = firstArg; i < args.argc(); ++i)
{
impl_->cmdline_.append(args.arg(i));
}
TestReferenceChecker rootChecker(impl_->data_.rootChecker());
rootChecker.checkString(args.toString(), "CommandLine");
if (!impl_->outputDatasets_.empty())
{
TestReferenceChecker dataChecker(
rootChecker.checkCompound("OutputData", "Data"));
Impl::DatasetNames::const_iterator dataset;
for (dataset = impl_->outputDatasets_.begin();
dataset != impl_->outputDatasets_.end();
++dataset)
{
const char *name = dataset->c_str();
AbstractAnalysisData &dataset = module.datasetFromName(name);
AnalysisDataTestFixture::addReferenceCheckerModule(
dataChecker, name, &dataset);
}
}
TrajectoryAnalysisCommandLineRunner runner(&module);
runner.setPrintCopyright(false);
int rc = 0;
EXPECT_NO_THROW_GMX(rc = runner.run(impl_->cmdline_.argc(), impl_->cmdline_.argv()));
EXPECT_EQ(0, rc);
if (!impl_->outputFiles_.empty())
{
TestReferenceChecker outputChecker(
rootChecker.checkCompound("OutputFiles", "Files"));
Impl::OutputFileList::const_iterator outfile;
for (outfile = impl_->outputFiles_.begin();
outfile != impl_->outputFiles_.end();
++outfile)
{
std::string output = File::readToString(outfile->path);
outputChecker.checkStringBlock(output, outfile->option.c_str());
}
}
}
示例4: gmx_grompp
int
SimulationRunner::callGromppOnThisRank()
{
CommandLine caller;
caller.append("grompp");
caller.addOption("-f", mdpInputFileName_);
caller.addOption("-n", ndxFileName_);
caller.addOption("-p", topFileName_);
caller.addOption("-c", groFileName_);
caller.addOption("-po", mdpOutputFileName_);
caller.addOption("-o", tprFileName_);
return gmx_grompp(caller.argc(), caller.argv());
}
示例5: Impl
CommandLine::CommandLine(const CommandLine &other)
: impl_(new Impl(other.argv(), other.argc()))
{
}