MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ can_read()

bool MayaFlux::IO::ModelReader::can_read ( const std::string &  filepath) const
overridevirtual

Check if a file can be read by this reader.

Parameters
filepathPath to the file.
Returns
true if the file format is supported.

Implements MayaFlux::IO::FileReader.

Definition at line 227 of file ModelReader.cpp.

228{
229 const auto ext = std::filesystem::path(filepath)
230 .extension()
231 .string();
232
233 if (ext.empty()) {
234 return false;
235 }
236
237 const auto supported = get_supported_extensions();
238 const std::string lower = [&] {
239 std::string s = ext.substr(1);
240 std::ranges::transform(s, s.begin(), ::tolower);
241 return s;
242 }();
243
244 return std::ranges::find(supported, lower) != supported.end();
245}
std::vector< std::string > get_supported_extensions() const override
Get supported file extensions for this reader.

References get_supported_extensions().

+ Here is the call graph for this function: