MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / validatePosition

Method validatePosition

src/OpenColorIO/FileRules.cpp:587–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587void 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
605void FileRules::Impl::validateNewRule(size_t ruleIndex, const char * name) const
606{

Callers 14

getNameMethod · 0.45
getPatternMethod · 0.45
setPatternMethod · 0.45
getExtensionMethod · 0.45
setExtensionMethod · 0.45
getRegexMethod · 0.45
setRegexMethod · 0.45
getColorSpaceMethod · 0.45
setColorSpaceMethod · 0.45
getNumCustomKeysMethod · 0.45
getCustomKeyNameMethod · 0.45
getCustomKeyValueMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected