| 113 | } |
| 114 | |
| 115 | void 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 | |