| 723 | |
| 724 | template <class FileType> |
| 725 | string FileCache::MapToDebugString(const DescriptorMap<FileType>& descs, |
| 726 | const string& prefix) { |
| 727 | string ret; |
| 728 | for (const auto& e : descs) { |
| 729 | bool strong = false; |
| 730 | bool deleted = false; |
| 731 | bool opened = false; |
| 732 | shared_ptr<internal::Descriptor<FileType>> d = e.second.lock(); |
| 733 | if (d) { |
| 734 | strong = true; |
| 735 | if (d->base_.deleted()) { |
| 736 | deleted = true; |
| 737 | } |
| 738 | internal::ScopedOpenedDescriptor<FileType> sod(d->base_.LookupFromCache()); |
| 739 | if (sod.opened()) { |
| 740 | opened = true; |
| 741 | } |
| 742 | } |
| 743 | if (strong) { |
| 744 | ret += Substitute("$0: $1 (S$2$3)\n", prefix, e.first, |
| 745 | deleted ? "D" : "", opened ? "O" : ""); |
| 746 | } else { |
| 747 | ret += Substitute("$0: $1\n", prefix, e.first); |
| 748 | } |
| 749 | } |
| 750 | return ret; |
| 751 | } |
| 752 | |
| 753 | template <class FileType> |
| 754 | shared_ptr<internal::Descriptor<FileType>> FileCache::FindDescriptorUnlocked( |
nothing calls this directly
no test coverage detected