< Helper function that recursively copies all data bytes to a destination file.
| 32 | ///< Helper function that recursively copies all data bytes to a |
| 33 | /// destination file. |
| 34 | uint64_t CopyDataToFile( |
| 35 | const mdf::detail::DataListBlock::BlockList& block_list, // NOLINT |
| 36 | std::streambuf& from_file, std::streambuf& to_file) { |
| 37 | uint64_t count = 0; |
| 38 | for (const auto& block : block_list) { |
| 39 | if (!block) { |
| 40 | continue; |
| 41 | } |
| 42 | const auto* db = dynamic_cast<const mdf::detail::DataBlock*>(block.get()); |
| 43 | const auto* dl = |
| 44 | dynamic_cast<const mdf::detail::DataListBlock*>(block.get()); |
| 45 | if (db != nullptr) { |
| 46 | count += db->CopyDataToFile(from_file, to_file); |
| 47 | } else if (dl != nullptr) { |
| 48 | count += CopyDataToFile(dl->DataBlockList(), from_file, to_file); |
| 49 | } |
| 50 | } |
| 51 | return count; |
| 52 | } |
| 53 | |
| 54 | } // namespace |
| 55 |
nothing calls this directly
no test coverage detected