void AbstractOptionStorage::setMaxValueCount(int count) { GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes), "setMaxValueCount() not supported with efOption_MultipleTimes"); GMX_RELEASE_ASSERT(count >= -1, "Invalid value count"); maxValueCount_ = count; if (isSet() && maxValueCount_ >= 0 && valueCount() > maxValueCount_) { GMX_THROW(InvalidInputError("Too many values")); } }
void AbstractOptionStorage::setMinValueCount(int count) { GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes), "setMinValueCount() not supported with efOption_MultipleTimes"); GMX_RELEASE_ASSERT(count >= 0, "Invalid value count"); minValueCount_ = count; if (isSet() && !hasFlag(efOption_DontCheckMinimumCount) && valueCount() < minValueCount_) { GMX_THROW(InvalidInputError("Too few values")); } }
int QContentSetEngine::count() const { return valueCount(); }
/*! \fn QContentSetEngine::content( int index ) const Returns the content object at the given \a index in the set. */ QContent QContentSetEngine::content( int index ) const { return index >= 0 && index < valueCount() ? value( index ) : QContent(); }