requestUnsetRequiredOptions();
}
- RequestsClearer clearRequestsOnExit(&requests_);
+ RequestsClearer clearRequestsOnExit(&requests_);
SelectionList::const_iterator first = selections.begin();
- SelectionList::const_iterator last = first;
- RequestList::const_iterator i;
+ SelectionList::const_iterator last = first;
+ RequestList::const_iterator i;
for (i = requests_.begin(); i != requests_.end(); ++i)
{
const SelectionRequest &request = *i;
{
int assigned = first - selections.begin();
GMX_THROW(InvalidInputError(formatString(
- "Too few selections provided for '%s': "
- "Expected %d selections, but only %d left "
- "after assigning the first %d to other selections.",
- request.name().c_str(), request.count(),
- remaining, assigned)));
+ "Too few selections provided for '%s': "
+ "Expected %d selections, but only %d left "
+ "after assigning the first %d to other selections.",
+ request.name().c_str(), request.count(),
+ remaining, assigned)));
}
last = first + request.count();
}
++nextRequest;
if (nextRequest != requests_.end())
{
- const char *name = request.name().c_str();
+ const char *name = request.name().c_str();
const char *conflictName = nextRequest->name().c_str();
GMX_THROW(InvalidInputError(formatString(
- "Ambiguous selections for '%s' and '%s': "
- "Any number of selections is acceptable for "
- "'%s', but you have requested subsequent "
- "selections to be assigned to '%s'. "
- "Resolution for such cases is not implemented, "
- "and may be impossible.",
- name, conflictName, name, conflictName)));
+ "Ambiguous selections for '%s' and '%s': "
+ "Any number of selections is acceptable for "
+ "'%s', but you have requested subsequent "
+ "selections to be assigned to '%s'. "
+ "Resolution for such cases is not implemented, "
+ "and may be impossible.",
+ name, conflictName, name, conflictName)));
}
last = selections.end();
}
}
if (last != selections.end())
{
- int count = selections.end() - selections.begin();
+ int count = selections.end() - selections.begin();
int remaining = selections.end() - last;
- int assigned = last - selections.begin();
+ int assigned = last - selections.begin();
GMX_THROW(InvalidInputError(formatString(
- "Too many selections provided: "
- "Expected %d selections, but %d provided. "
- "Last %d selections could not be assigned to any option.",
- assigned, count, remaining)));
+ "Too many selections provided: "
+ "Expected %d selections, but %d provided. "
+ "Last %d selections could not be assigned to any option.",
+ assigned, count, remaining)));
}
}
void
SelectionOptionManager::convertOptionValue(SelectionOptionStorage *storage,
- const std::string &value)
+ const std::string &value)
{
SelectionList selections = impl_->collection_.parseFromString(value);
storage->addSelections(selections, false);
void
SelectionOptionManager::parseRequestedFromStdin(bool bInteractive)
{
- Impl::RequestsClearer clearRequestsOnExit(&impl_->requests_);
+ Impl::RequestsClearer clearRequestsOnExit(&impl_->requests_);
Impl::RequestList::const_iterator i;
for (i = impl_->requests_.begin(); i != impl_->requests_.end(); ++i)
catch (GromacsException &ex)
{
ex.prependContext(formatString(
- "Error in adding selections from file '%s'",
- filename.c_str()));
+ "Error in adding selections from file '%s'",
+ filename.c_str()));
throw;
}
}
SelectionOptionManager *manager_;
};
-} // namespace
+} // namespace
-void setManagerForSelectionOptions(Options *options,
+void setManagerForSelectionOptions(Options *options,
SelectionOptionManager *manager)
{
SelectionOptionManagerSetter(manager).visitSubSection(options);