| 693 | } |
| 694 | |
| 695 | void DataCompiler::remove_tree(const char *path) |
| 696 | { |
| 697 | TempAllocator512 ta; |
| 698 | DynamicString tree_path(ta); |
| 699 | tree_path = path; |
| 700 | tree_path += '/'; |
| 701 | |
| 702 | Vector<DynamicString> dangling_paths(default_allocator()); |
| 703 | |
| 704 | auto cur = hash_map::begin(_source_index._paths); |
| 705 | auto end = hash_map::end(_source_index._paths); |
| 706 | for (; cur != end; ++cur) { |
| 707 | HASH_MAP_SKIP_HOLE(_source_index._paths, cur); |
| 708 | |
| 709 | // Skip if it is not a sub-path |
| 710 | if (!cur->first.has_prefix(tree_path.c_str())) |
| 711 | continue; |
| 712 | |
| 713 | // Skip if is has been deleted previously |
| 714 | if (cur->second.file_type == Stat::NO_ENTRY) |
| 715 | continue; |
| 716 | |
| 717 | vector::push_back(dangling_paths, cur->first); |
| 718 | } |
| 719 | |
| 720 | for (u32 ii = 0; ii < vector::size(dangling_paths); ++ii) |
| 721 | remove_file(dangling_paths[ii].c_str()); |
| 722 | |
| 723 | notify_remove_tree(path); |
| 724 | } |
| 725 | |
| 726 | void DataCompiler::remove_file_or_tree(const char *path) |
| 727 | { |
nothing calls this directly
no test coverage detected