| 641 | } |
| 642 | |
| 643 | void DataCompiler::add_file(const char *path) |
| 644 | { |
| 645 | // Get source directory prefix |
| 646 | TempAllocator512 ta; |
| 647 | DynamicString source_dir(ta); |
| 648 | source_dir = hash_map::get(_source_dirs, source_dir, source_dir); |
| 649 | |
| 650 | // Convert to DynamicString |
| 651 | DynamicString str(ta); |
| 652 | str.set(path, strlen32(path)); |
| 653 | |
| 654 | Stat deff_st; |
| 655 | deff_st.file_type = Stat::NO_ENTRY; |
| 656 | deff_st.size = 0; |
| 657 | deff_st.mtime = 0; |
| 658 | Stat prev_st = hash_map::get(_source_index._paths, str, deff_st); |
| 659 | |
| 660 | // Get file status. |
| 661 | FilesystemDisk fs(default_allocator()); |
| 662 | fs.set_prefix(source_dir.c_str()); |
| 663 | Stat st; |
| 664 | st = fs.stat(path); |
| 665 | hash_map::set(_source_index._paths, str, st); |
| 666 | |
| 667 | // Avoid sending spurious add_file() notifications for already known paths. |
| 668 | if (prev_st.file_type == Stat::NO_ENTRY) |
| 669 | notify_add_file(path, st); |
| 670 | } |
| 671 | |
| 672 | void DataCompiler::remove_file(const char *path) |
| 673 | { |
nothing calls this directly
no test coverage detected