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

Method read

src/OpenColorIO/fileformats/FileFormatCC.cpp:81–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79// Raise an exception if it can't be loaded.
80
81CachedFileRcPtr LocalFileFormat::read(std::istream & istream,
82 const std::string & fileName,
83 Interpolation /*interp*/) const
84{
85 LocalCachedFileRcPtr cachedFile = LocalCachedFileRcPtr(new LocalCachedFile());
86
87 CDLParser parser(fileName);
88 try
89 {
90 parser.parse(istream);
91 parser.getCDLTransform(cachedFile->m_transform);
92 }
93 catch(Exception & e)
94 {
95 std::ostringstream os;
96 os << "Error parsing .cc file. ";
97 os << "Does not appear to contain a valid ASC CDL XML:";
98 os << e.what();
99 throw Exception(os.str().c_str());
100 }
101 if (!parser.isCC())
102 {
103 std::ostringstream os;
104 os << "File '" << fileName << "' is not a .cc file.";
105 throw Exception(os.str().c_str());
106 }
107
108 return cachedFile;
109}
110
111void LocalFileFormat::write(const ConstConfigRcPtr & /*config*/,
112 const ConstContextRcPtr & /*context*/,

Callers

nothing calls this directly

Calls 3

getCDLTransformMethod · 0.80
parseMethod · 0.45
isCCMethod · 0.45

Tested by

no test coverage detected