| 244 | } |
| 245 | |
| 246 | std::string getExtensionFromPath(const std::filesystem::path& path) |
| 247 | { |
| 248 | std::string ext; |
| 249 | if (path.has_extension()) |
| 250 | { |
| 251 | ext = path.extension().string(); |
| 252 | // Remove the leading '.' from ext. |
| 253 | if (ext.size() > 0 && ext[0] == '.') |
| 254 | ext.erase(0, 1); |
| 255 | // Convert to lower-case. |
| 256 | std::transform(ext.begin(), ext.end(), ext.begin(), [](char c) { return std::tolower(c); }); |
| 257 | } |
| 258 | return ext; |
| 259 | } |
| 260 | |
| 261 | std::filesystem::path getTempFilePath() |
| 262 | { |