Skip to content

Commit e39c485

Browse files
committed
Add function to return list of all external files in a config
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
1 parent c09951e commit e39c485

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

src/OpenColorIO/Config.cpp

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,16 @@ class Config::Impl
11031103
// That should never happen.
11041104
return -1;
11051105
}
1106+
1107+
void GetAllFileReferences(std::set<std::string> & files) const
1108+
{
1109+
ConstTransformVec allTransforms;
1110+
this->getAllInternalTransforms(allTransforms);
1111+
for(const auto & transform : allTransforms)
1112+
{
1113+
GetFileReferences(files, transform);
1114+
}
1115+
}
11061116
};
11071117

11081118

@@ -1956,14 +1966,8 @@ void Config::validate() const
19561966
///// Resolve all file Transforms using context variables.
19571967

19581968
{
1959-
ConstTransformVec allTransforms;
1960-
getImpl()->getAllInternalTransforms(allTransforms);
1961-
19621969
std::set<std::string> files;
1963-
for (const auto & transform : allTransforms)
1964-
{
1965-
GetFileReferences(files, transform);
1966-
}
1970+
getImpl()->GetAllFileReferences(files);
19671971

19681972
// Check that at least one of the search paths can be resolved into a valid path.
19691973
// Note that a search path without context variable(s) always correctly resolves.
@@ -4890,14 +4894,8 @@ const char * Config::getCacheID(const ConstContextRcPtr & context) const
48904894
{
48914895
std::ostringstream filehash;
48924896

4893-
ConstTransformVec allTransforms;
4894-
getImpl()->getAllInternalTransforms(allTransforms);
4895-
48964897
std::set<std::string> files;
4897-
for(const auto & transform : allTransforms)
4898-
{
4899-
GetFileReferences(files, transform);
4900-
}
4898+
getImpl()->GetAllFileReferences(files);
49014899

49024900
for(const auto & iter : files)
49034901
{
@@ -5590,14 +5588,8 @@ bool Config::isArchivable() const
55905588
/////////////////////////////////
55915589
// FileTransform verification. //
55925590
/////////////////////////////////
5593-
ConstTransformVec allTransforms;
5594-
getImpl()->getAllInternalTransforms(allTransforms);
5595-
55965591
std::set<std::string> files;
5597-
for(const auto & transform : allTransforms)
5598-
{
5599-
GetFileReferences(files, transform);
5600-
}
5592+
getImpl()->GetAllFileReferences(files);
56015593

56025594
// Check that FileTransform sources are not absolute nor have context variables outside of
56035595
// config working directory.

0 commit comments

Comments
 (0)