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

Method insertRule

src/OpenColorIO/FileRules.cpp:819–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

817}
818
819void FileRules::insertRule(size_t ruleIndex, const char * name, const char * colorSpace,
820 const char * pattern, const char * extension)
821{
822 const std::string ruleName(StringUtils::Trim(name ? name : ""));
823
824 m_impl->validateNewRule(ruleIndex, ruleName.c_str());
825
826 auto newRule = std::make_shared<FileRule>(ruleName.c_str());
827 newRule->setColorSpace(colorSpace);
828 newRule->setPattern(pattern);
829 newRule->setExtension(extension);
830 m_impl->m_rules.insert(m_impl->m_rules.begin() + ruleIndex, newRule);
831}
832
833void FileRules::insertRule(size_t ruleIndex, const char * name, const char * colorSpace,
834 const char * regex)

Callers 15

test_copyMethod · 0.95
test_nameMethod · 0.95
test_patternMethod · 0.95
test_extensionMethod · 0.95
test_regexMethod · 0.95
test_color_spaceMethod · 0.95
test_custom_keysMethod · 0.95
test_insert_ruleMethod · 0.95
test_rule_priorityMethod · 0.95
test_using_rulesMethod · 0.95
test_copyMethod · 0.95
_insert_ruleMethod · 0.45

Calls 8

insertMethod · 0.80
TrimFunction · 0.50
validateNewRuleMethod · 0.45
setColorSpaceMethod · 0.45
setPatternMethod · 0.45
setExtensionMethod · 0.45
beginMethod · 0.45
setRegexMethod · 0.45

Tested by 15

test_copyMethod · 0.76
test_nameMethod · 0.76
test_patternMethod · 0.76
test_extensionMethod · 0.76
test_regexMethod · 0.76
test_color_spaceMethod · 0.76
test_custom_keysMethod · 0.76
test_insert_ruleMethod · 0.76
test_rule_priorityMethod · 0.76
test_using_rulesMethod · 0.76
test_copyMethod · 0.76
test_copyMethod · 0.36