| 256 | } |
| 257 | |
| 258 | std::shared_ptr<PerformanceData> Codec::ReadPerformanceData(const void* bytes, |
| 259 | uint32_t byteLength) { |
| 260 | CodecContext context = {}; |
| 261 | DecodeStream stream(&context, reinterpret_cast<const uint8_t*>(bytes), byteLength); |
| 262 | auto bodyBytes = ReadBodyBytes(&stream); |
| 263 | if (context.hasException()) { |
| 264 | return nullptr; |
| 265 | } |
| 266 | auto header = ReadTagHeader(&bodyBytes); |
| 267 | if (context.hasException()) { |
| 268 | return nullptr; |
| 269 | } |
| 270 | |
| 271 | while (header.code != TagCode::End) { |
| 272 | auto tagBytes = bodyBytes.readBytes(header.length); |
| 273 | if (header.code == TagCode::Performance) { |
| 274 | auto data = std::shared_ptr<PerformanceData>(new PerformanceData()); |
| 275 | ReadPerformanceTag(&tagBytes, data.get()); |
| 276 | return data; |
| 277 | } |
| 278 | header = ReadTagHeader(&bodyBytes); |
| 279 | if (context.hasException()) { |
| 280 | return nullptr; |
| 281 | } |
| 282 | } |
| 283 | return nullptr; |
| 284 | } |
| 285 | |
| 286 | void Codec::UpdateFileAttributes(std::shared_ptr<File> file, CodecContext* context, |
| 287 | const std::string& filePath) { |
nothing calls this directly
no test coverage detected