| 585 | } |
| 586 | |
| 587 | void FileRules::Impl::validatePosition(size_t ruleIndex, DefaultAllowed allowDefault) const |
| 588 | { |
| 589 | const auto numRules = m_rules.size(); |
| 590 | if (ruleIndex >= numRules) |
| 591 | { |
| 592 | std::ostringstream oss; |
| 593 | oss << "File rules: rule index '" << ruleIndex << "' invalid." |
| 594 | << " There are only '" << numRules << "' rules."; |
| 595 | throw Exception(oss.str().c_str()); |
| 596 | } |
| 597 | if (allowDefault == DEFAULT_NOT_ALLOWED && ruleIndex + 1 == numRules) |
| 598 | { |
| 599 | std::ostringstream oss; |
| 600 | oss << "File rules: rule index '" << ruleIndex << "' is the default rule."; |
| 601 | throw Exception(oss.str().c_str()); |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | void FileRules::Impl::validateNewRule(size_t ruleIndex, const char * name) const |
| 606 | { |
no test coverage detected