| 141 | } |
| 142 | |
| 143 | bool LibraryManager::ApplyCodePatch(std::string const& mapping) |
| 144 | { |
| 145 | auto it = mappings_.Mappings.find(mapping); |
| 146 | if (it == mappings_.Mappings.end()) { |
| 147 | ERR("Cannot apply patch - no such mapping: '%s'", mapping.c_str()); |
| 148 | return false; |
| 149 | } |
| 150 | |
| 151 | if (it->second.Patches.empty()) { |
| 152 | ERR("Cannot apply patch - mapping '%s' contains no patch entries", mapping.c_str()); |
| 153 | return false; |
| 154 | } |
| 155 | |
| 156 | bool hasChanges = false; |
| 157 | for (auto& patch : it->second.Patches) { |
| 158 | hasChanges = ApplyPatch(patch) || hasChanges; |
| 159 | } |
| 160 | |
| 161 | return hasChanges; |
| 162 | } |
| 163 | |
| 164 | |
| 165 | bool LibraryManager::UndoCodePatch(std::string const& mapping) |