MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetSourceHash

Function GetSourceHash

shadercompiler/ModifiedTime.cpp:115–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void GetSourceHash( const char* sourcePath, const char* parentData, const char* rootPath, std::set<std::string>& visited, MD5& md5 )
116{
117 if( visited.find( sourcePath ) != end( visited ) )
118 {
119 return;
120 }
121 visited.insert( sourcePath );
122 if( auto opened = s_includeHandler.Open( sourcePath, parentData, rootPath ) )
123 {
124 md5.add( opened->data, opened->size );
125
126 std::cmatch match;
127 auto begin = opened->data;
128 while( std::regex_search( begin, opened->data + opened->size, match, s_include ) )
129 {
130 GetSourceHash( match[1].str().c_str(), opened->data, rootPath, visited, md5 );
131 begin += match.position() + match.length();
132 }
133 }
134}
135
136}
137

Callers 2

CheckHashFunction · 0.85
mainFunction · 0.85

Calls 4

OpenMethod · 0.80
addMethod · 0.80
getHashMethod · 0.80
endFunction · 0.50

Tested by

no test coverage detected