Esempio n. 1
0
void CommandLineTestHelper::setInputFileContents(
        CommandLine *args, const char *option, const char *extension,
        const ConstArrayRef<const char *> &contents)
{
    GMX_ASSERT(extension[0] != '.', "Extension should not contain a dot");
    std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(
                formatString("%d.%s", args->argc(), extension));
    TextWriter  file(fullFilename);
    ConstArrayRef<const char *>::const_iterator i;
    for (i = contents.begin(); i != contents.end(); ++i)
    {
        file.writeLine(*i);
    }
    file.close();
    args->addOption(option, fullFilename);
}
Esempio n. 2
0
CommandLine::CommandLine(const ConstArrayRef<const char *> &cmdline)
    : impl_(new Impl(cmdline.data(), cmdline.size()))
{
}
Esempio n. 3
0
void CommandLine::initFromArray(const ConstArrayRef<const char *> &cmdline)
{
    impl_.reset(new Impl(cmdline.data(), cmdline.size()));
}
Esempio n. 4
0
StringInputStream::StringInputStream(ConstArrayRef<const char *> const &input)
    : input_(joinStrings(input.begin(), input.end(), "\n")), pos_(0)
{
    input_.append("\n");
}