예제 #1
0
void OptionsAssigner::startOption(const char *name)
{
    GMX_RELEASE_ASSERT(_impl->_currentOption == NULL, "finishOption() not called");
    AbstractOptionStorage *option = _impl->findOption(name);
    if (option == NULL)
    {
        GMX_THROW(InvalidInputError("Unknown option"));
    }
    option->startSet();
    _impl->_currentOption = option;
    _impl->_currentValueCount = 0;
}
예제 #2
0
bool OptionsAssigner::tryStartOption(const char *name)
{
    GMX_RELEASE_ASSERT(impl_->currentOption_ == nullptr, "finishOption() not called");
    AbstractOptionStorage *option = impl_->findOption(name);
    if (option == nullptr)
    {
        return false;
    }
    option->startSet();
    impl_->currentOption_     = option;
    impl_->currentValueCount_ = 0;
    return true;
}