mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
## Summary * Implement new `StringUtils::checkFileExtension` which does case insensitive checking * Move all checks over to this
20 lines
503 B
C++
20 lines
503 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace StringUtils {
|
|
|
|
/**
|
|
* Sanitize a string for use as a filename.
|
|
* Replaces invalid characters with underscores, trims spaces/dots,
|
|
* and limits length to maxLength characters.
|
|
*/
|
|
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
|