Make extension checks case-insensitive (#273)
## Summary * Implement new `StringUtils::checkFileExtension` which does case insensitive checking * Move all checks over to this
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace StringUtils {
|
||||
@@ -10,4 +11,9 @@ namespace StringUtils {
|
||||
*/
|
||||
std::string sanitizeFilename(const std::string& name, size_t maxLength = 100);
|
||||
|
||||
/**
|
||||
* Check if the given filename ends with the specified extension (case-insensitive).
|
||||
*/
|
||||
bool checkFileExtension(const std::string& fileName, const char* extension);
|
||||
|
||||
} // namespace StringUtils
|
||||
|
||||
Reference in New Issue
Block a user