]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/util/string.h
Revert "Fix short 180 degree rotation when using set_bone_position (#10405)" (#10534)
[dragonfireclient.git] / src / util / string.h
index 0d2a6bdb2cbcf6e70008da71ad0380bc5c53a2fd..6fd11fadce21e65d0498f2e28a56b91a65df1d3d 100644 (file)
@@ -31,6 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <cctype>
 #include <unordered_map>
 
+class Translations;
+
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
 
@@ -650,6 +652,8 @@ std::vector<std::basic_string<T> > split(const std::basic_string<T> &s, T delim)
        return tokens;
 }
 
+std::wstring translate_string(const std::wstring &s, Translations *translations);
+
 std::wstring translate_string(const std::wstring &s);
 
 inline std::wstring unescape_translate(const std::wstring &s) {
@@ -742,3 +746,11 @@ inline irr::core::stringw utf8_to_stringw(const std::string &input)
        std::wstring str = utf8_to_wide(input);
        return irr::core::stringw(str.c_str());
 }
+
+/**
+ * Sanitize the name of a new directory. This consists of two stages:
+ * 1. Check for 'reserved filenames' that can't be used on some filesystems
+ *    and prefix them
+ * 2. Remove 'unsafe' characters from the name by replacing them with '_'
+ */
+std::string sanitizeDirName(const std::string &str, const std::string &optional_prefix);