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


C++ CommandLine::argc方法代码示例

本文整理汇总了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));
    }
}
开发者ID:pjohansson,项目名称:gromacs,代码行数:9,代码来源:cmdlinetest.cpp

示例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_);
}
开发者ID:rmcgibbo,项目名称:gromacs,代码行数:11,代码来源:cmdlinemodulemanagertest.cpp

示例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());
        }
    }
}
开发者ID:hasagar,项目名称:gromacs,代码行数:51,代码来源:moduletest.cpp

示例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());
}
开发者ID:wangxubo0201,项目名称:gromacs,代码行数:15,代码来源:moduletest.cpp

示例5: Impl

CommandLine::CommandLine(const CommandLine &other)
    : impl_(new Impl(other.argv(), other.argc()))
{
}
开发者ID:pjohansson,项目名称:gromacs,代码行数:4,代码来源:cmdlinetest.cpp


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