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

Function readFile

source/MaterialXFormat/Util.cpp:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#endif
15
16MATERIALX_NAMESPACE_BEGIN
17
18string readFile(const FilePath& filePath)
19{
20 std::ifstream file(filePath.asString(), std::ios::in);
21 if (file)
22 {
23 std::stringstream stream;
24 stream << file.rdbuf();
25 file.close();
26 if (stream)
27 {
28 return stream.str();
29 }
30 }
31 return EMPTY_STRING;
32}
33
34void getSubdirectories(const FilePathVec& rootDirectories, const FileSearchPath& searchPath, FilePathVec& subDirectories)
35{

Callers 6

loadSourceMethod · 0.50
XmlIo.cppFile · 0.50
getShaderSourceFunction · 0.50
loadSourceMethod · 0.50
addIncludeMethod · 0.50
resolveSourceCodeMethod · 0.50

Calls 3

asStringMethod · 0.45
closeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected