| 231 | } |
| 232 | |
| 233 | void SlideInfoProcessor::ApplyMappings(MappedFileAccessor& accessor, const std::vector<SlideMappingInfo>& mappings) const |
| 234 | { |
| 235 | // TODO: HACK: to prevent applying slide info twice we use check to see if the accessor has been written to |
| 236 | // TODO: prior to this function, because this is currently the ONLY place where writes happen this is safe |
| 237 | // TODO: but if we add more places that write to the accessor than we will need to likely need to be more specific |
| 238 | // TODO: and/or have the backing file accessor store some additional state. |
| 239 | if (accessor.IsDirty()) |
| 240 | return; |
| 241 | |
| 242 | // Apply the slide information to the mapped file. |
| 243 | for (const auto& mapping : mappings) |
| 244 | { |
| 245 | switch (mapping.slideInfoVersion) |
| 246 | { |
| 247 | case 2: |
| 248 | ApplySlideInfoV2(accessor, mapping); |
| 249 | break; |
| 250 | case 3: |
| 251 | ApplySlideInfoV3(accessor, mapping); |
| 252 | break; |
| 253 | case 5: |
| 254 | ApplySlideInfoV5(accessor, mapping); |
| 255 | break; |
| 256 | default: |
| 257 | m_logger->LogError( |
| 258 | "Cannot apply slide info version: %d @ %llx", mapping.slideInfoVersion, mapping.mappingInfo.address); |
| 259 | break; |
| 260 | } |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | std::vector<SlideMappingInfo> SlideInfoProcessor::ProcessEntry(MappedFileAccessor& accessor, const CacheEntry& entry) const |
| 265 | { |
nothing calls this directly
no test coverage detected