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

Method insertRule

src/OpenColorIO/ViewingRules.cpp:384–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void ViewingRules::insertRule(size_t ruleIndex, const char * name)
385{
386 const std::string ruleName(StringUtils::Trim(name ? name : ""));
387
388 m_impl->validateNewRule(ruleName.c_str());
389
390 auto newRule = std::make_shared<ViewingRule>(ruleName.c_str());
391 if (ruleIndex == getNumEntries())
392 {
393 m_impl->m_rules.push_back(newRule);
394 }
395 else
396 {
397 m_impl->validatePosition(ruleIndex);
398 m_impl->m_rules.insert(m_impl->m_rules.begin() + ruleIndex, newRule);
399 }
400}
401
402void ViewingRules::removeRule(size_t ruleIndex)
403{

Callers

nothing calls this directly

Calls 6

insertMethod · 0.80
TrimFunction · 0.50
validateNewRuleMethod · 0.45
push_backMethod · 0.45
validatePositionMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected