
.. _program_listing_file_Src_GraphicsEngineVulkan_scene_ModelFileKind.ixx:

Program Listing for File ModelFileKind.ixx
==========================================

|exhale_lsh| :ref:`Return to documentation for file <file_Src_GraphicsEngineVulkan_scene_ModelFileKind.ixx>` (``Src/GraphicsEngineVulkan/scene/ModelFileKind.ixx``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: cpp

   module;
   
   #include <algorithm>
   #include <cctype>
   #include <filesystem>
   #include <string_view>
   
   export module kataglyphis.vulkan.model_file_kind;
   
   namespace {
   
   std::string lowercaseExtension(std::string_view path)
   {
       std::string extension = std::filesystem::path(path).extension().string();
       std::transform(extension.begin(), extension.end(), extension.begin(), [](unsigned char c) {
           return static_cast<char>(std::tolower(c));
       });
       return extension;
   }
   
   }// namespace
   
   export namespace Kataglyphis {
   
   bool isGltfModelPath(std::string_view path)
   {
       const std::string extension = lowercaseExtension(path);
       return extension == ".gltf" || extension == ".glb";
   }
   
   bool isSupportedModelPath(std::string_view path)
   {
       const std::string extension = lowercaseExtension(path);
       return extension == ".obj" || extension == ".gltf" || extension == ".glb";
   }
   
   }// namespace Kataglyphis
