| 801 | } |
| 802 | |
| 803 | void FileRules::setCustomKey(size_t ruleIndex, const char * key, const char * value) |
| 804 | { |
| 805 | m_impl->validatePosition(ruleIndex, Impl::DEFAULT_ALLOWED); |
| 806 | try |
| 807 | { |
| 808 | m_impl->m_rules[ruleIndex]->m_customKeys.set(key, value); |
| 809 | } |
| 810 | catch (Exception & e) |
| 811 | { |
| 812 | std::ostringstream oss; |
| 813 | oss << "File rules: rule named '" << std::string(m_impl->m_rules[ruleIndex]->getName()) |
| 814 | << "' error: " << e.what(); |
| 815 | throw Exception(oss.str().c_str()); |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | void FileRules::insertRule(size_t ruleIndex, const char * name, const char * colorSpace, |
| 820 | const char * pattern, const char * extension) |