예제 #1
0
파일: util_path.cpp 프로젝트: UPBGE/blender
static void path_files_md5_hash_recursive(MD5Hash& hash, const string& dir)
{
	if(path_exists(dir)) {
		directory_iterator it(dir), it_end;

		for(; it != it_end; ++it) {
			if(path_is_directory(it->path())) {
				path_files_md5_hash_recursive(hash, it->path());
			}
			else {
				string filepath = it->path();

				hash.append((const uint8_t*)filepath.c_str(), filepath.size());
				hash.append_file(filepath);
			}
		}
	}
}
예제 #2
0
static void path_files_md5_hash_recursive(MD5Hash& hash, const string& dir)
{
	if(boost::filesystem::exists(dir)) {
		boost::filesystem::directory_iterator it(dir), it_end;

		for(; it != it_end; it++) {
			if(boost::filesystem::is_directory(it->status())) {
				path_files_md5_hash_recursive(hash, it->path().string());
			}
			else {
				string filepath = it->path().string();

				hash.append((const uint8_t*)filepath.c_str(), filepath.size());
				hash.append_file(filepath);
			}
		}
	}
}