///////////////////////////////////////////////////////
| 123 | |
| 124 | //////////////////////////////////////////////////////////// |
| 125 | std::unique_ptr<SoundFileWriter> SoundFileFactory::createWriterFromFilename(const std::filesystem::path& filename) |
| 126 | { |
| 127 | // Test the filename in all the registered factories |
| 128 | for (const auto& [fpCreate, fpCheck] : getWriterFactoryMap()) |
| 129 | { |
| 130 | if (fpCheck(filename)) |
| 131 | return fpCreate(); |
| 132 | } |
| 133 | |
| 134 | // No suitable writer found |
| 135 | err() << "Failed to open sound file (format not supported)\n" << formatDebugPathInfo(filename) << std::endl; |
| 136 | return nullptr; |
| 137 | } |
| 138 | |
| 139 | |
| 140 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected