| 286 | } |
| 287 | |
| 288 | const char * ViewingRules::getEncoding(size_t ruleIndex, size_t encodingIndex) const |
| 289 | { |
| 290 | m_impl->validatePosition(ruleIndex); |
| 291 | const auto numEnc = m_impl->m_rules[ruleIndex]->m_encodings.getNumTokens(); |
| 292 | if (static_cast<int>(encodingIndex) >= numEnc) |
| 293 | { |
| 294 | std::ostringstream oss; |
| 295 | oss << "Viewing rules: rule '" << std::string(m_impl->m_rules[ruleIndex]->getName()) |
| 296 | << "' at index '" << ruleIndex << "': encoding index '" << encodingIndex |
| 297 | << "' is invalid. There are only '" << numEnc << "' encodings."; |
| 298 | throw Exception(oss.str().c_str()); |
| 299 | } |
| 300 | return m_impl->m_rules[ruleIndex]->m_encodings.getToken(static_cast<int>(encodingIndex)); |
| 301 | } |
| 302 | |
| 303 | void ViewingRules::addEncoding(size_t ruleIndex, const char * encoding) |
| 304 | { |
no test coverage detected