Move string helpers out of HomeActivity into StringUtils

This commit is contained in:
Dave Allie
2026-01-14 21:19:12 +11:00
parent fecd1849b9
commit 14643d0225
3 changed files with 30 additions and 28 deletions

View File

@@ -16,4 +16,10 @@ std::string sanitizeFilename(const std::string& name, size_t maxLength = 100);
*/
bool checkFileExtension(const std::string& fileName, const char* extension);
// UTF-8 safe string truncation - removes one character from the end
// Returns the new size after removing one UTF-8 character
size_t utf8RemoveLastChar(std::string& str);
// Truncate string by removing N UTF-8 characters from the end
void utf8TruncateChars(std::string& str, size_t numChars);
} // namespace StringUtils