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

Function GetAbsoluteSearchPaths

src/OpenColorIO/Context.cpp:555–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553namespace
554{
555void GetAbsoluteSearchPaths(StringUtils::StringVec & searchpaths,
556 const StringUtils::StringVec & pathStrings,
557 const std::string & workingDir,
558 const EnvMap & map,
559 UsedEnvs & envs)
560{
561 if(pathStrings.empty())
562 {
563 searchpaths.push_back(workingDir);
564 return;
565 }
566
567 // TODO: Improve the algorithm to collect context variables per search_path.
568
569 for (unsigned int i = 0; i < pathStrings.size(); ++i)
570 {
571 // Resolve variables in case the expansion adds slashes
572 const std::string resolved = ResolveContextVariables(pathStrings[i], map, envs);
573
574 // Remove trailing "/", and spaces
575 std::string dirname = StringUtils::RightTrim(StringUtils::Trim(resolved), '/');
576
577 if (!pystring::os::path::isabs(dirname))
578 {
579 dirname = pystring::os::path::join(workingDir, dirname);
580 }
581
582 searchpaths.push_back(pystring::os::path::normpath(dirname));
583 }
584}
585} // anon.
586
587} // namespace OCIO_NAMESPACE

Callers 1

resolveFileLocationMethod · 0.85

Calls 6

ResolveContextVariablesFunction · 0.85
RightTrimFunction · 0.85
TrimFunction · 0.50
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected