MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / getVersionIntegers

Method getVersionIntegers

source/MaterialXCore/Interface.cpp:534–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534std::pair<int, int> InterfaceElement::getVersionIntegers() const
535{
536 const string& versionString = getVersionString();
537 StringVec splitVersion = splitString(versionString, ".");
538 try
539 {
540 if (splitVersion.size() == 2)
541 {
542 return { std::stoi(splitVersion[0]), std::stoi(splitVersion[1]) };
543 }
544 else if (splitVersion.size() == 1)
545 {
546 return { std::stoi(splitVersion[0]), 0 };
547 }
548 }
549 catch (std::invalid_argument&)
550 {
551 }
552 catch (std::out_of_range&)
553 {
554 }
555 return { 0, 0 };
556}
557
558void InterfaceElement::registerChildElement(ElementPtr child)
559{

Callers

nothing calls this directly

Calls 3

getVersionStringFunction · 0.85
splitStringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected