MCPcopy Create free account
hub / github.com/SFML/SFML / createWriterFromFilename

Method createWriterFromFilename

src/SFML/Audio/SoundFileFactory.cpp:125–137  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

123
124////////////////////////////////////////////////////////////
125std::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////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

formatDebugPathInfoFunction · 0.85

Tested by

no test coverage detected