| 95 | |
| 96 | template <typename T> |
| 97 | void SaveToFile(const std::vector<T> &input, const std::string path) { |
| 98 | if (input.empty()) |
| 99 | return; |
| 100 | std::ofstream file(path, std::ios_base::binary | std::ios_base::out); |
| 101 | DALI_ENFORCE(file, "CocoReader meta file error while saving: " + path); |
| 102 | |
| 103 | unsigned size = input.size(); |
| 104 | Write(file, size, path.c_str()); |
| 105 | Write(file, make_cspan(input), path.c_str()); |
| 106 | DALI_ENFORCE(file.good(), make_string("Error writing to path: ", path)); |
| 107 | } |
| 108 | |
| 109 | template <> |
| 110 | void SaveToFile(const std::vector<RLEMaskPtr> &input, const std::string path) { |
no test coverage detected