14 lines
331 B
C
14 lines
331 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);
|
||
|
|
|
||
|
|
} // namespace StringUtils
|