6 #ifndef UTILS_FILE_TYPES_H 7 #define UTILS_FILE_TYPES_H 13 #include <Utils/ExtSTD.h> 56 static const std::map<Type, std::string> file_extensions =
58 { Type::praw,
"praw" },
59 { Type::cogs,
"cogs" },
76 [](
const std::pair<Type, std::string> &pair)->
Type {
return pair.first; });
84 static const std::vector<Type> importable_scan_types
94 static const std::vector<Type> exportable_scan_types
101 static const std::vector<Type> exr_types
110 static const std::vector<Type> importable_point_cloud_types
121 static const std::vector<Type> exportable_point_cloud_types
133 static const std::vector<Type> importable_mesh_types
146 static const std::vector<Type> exportable_mesh_types
157 static const std::vector<Type> image_types
169 static const std::vector<Type> assimp_importable_types
182 static const std::vector<Type> cogs_types
190 static inline std::string GetExt(
const Type type)
194 return file_extensions.at(type);
200 [[nodiscard]]
static inline std::optional<file_types::Type> GetType(
const std::string &filename)
202 static const std::unordered_map<std::string, Type> type_for_ext = []()
204 std::unordered_map<std::string, Type> type_map;
205 for (uint8_t i = 0; i < static_cast<uint8_t>(Type::__count); ++i)
207 const auto type =
static_cast<Type>(i);
208 type_map[GetExt(type)] = type;
216 return type_for_ext.at(ext);
225 const auto etype = GetType(ext);
226 return etype.has_value() && etype == type;
std::string Lowercase(const std::string &text)
Converts text into all lowercase.
Definition: ExtSTD.h:311
bool Contains(const std::string &substring, const std::string &text)
Checks if the text contains substring.
Definition: ExtSTD.h:327
Type
Enum class that specifies (geometry) file types that we recognize.
Definition: FileTypes.h:33
Definitions and functions for file types supported by codebase.
Definition: FileTypes.h:17
auto Transformed(const C &container, F Function)
Simplified wrapper for std::transform.
Definition: ExtSTD.h:831