MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / hasExtension

Function hasExtension

Source/Falcor/Core/Platform/OS.cpp:232–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232bool hasExtension(const std::filesystem::path& path, std::string_view ext)
233{
234 // Remove leading '.' from ext.
235 if (ext.size() > 0 && ext[0] == '.')
236 ext.remove_prefix(1);
237
238 std::string pathExt = getExtensionFromPath(path);
239
240 if (ext.size() != pathExt.size())
241 return false;
242
243 return std::equal(ext.rbegin(), ext.rend(), pathExt.rbegin(), [](char a, char b) { return std::tolower(a) == std::tolower(b); });
244}
245
246std::string getExtensionFromPath(const std::filesystem::path& path)
247{

Callers 14

loadTextureMethod · 0.85
saveToDDSMethod · 0.85
createFromFileMethod · 0.85
loadGridSequenceMethod · 0.85
createFromFileMethod · 0.85
createMippedFromFilesMethod · 0.85
createFromFileMethod · 0.85
createFromFileMethod · 0.85
createFloatTextureFunction · 0.85
createSpectrumTextureFunction · 0.85
importInternalFunction · 0.85

Calls 4

getExtensionFromPathFunction · 0.85
rbeginMethod · 0.80
rendMethod · 0.80
sizeMethod · 0.45

Tested by 1

CPU_TESTFunction · 0.68