summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 5e45b6168..dffec3f0c 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -474,7 +474,18 @@ std::string packList(std::list<std::string> &list)
return str;
}
-std::list<std::string> unpackList(const std::string str)
+std::list<std::string> unpackList(const std::string &str)
{
return splitToStringList(str, '|');
}
+
+std::string stringToHexPath(const std::string &str)
+{
+ if (str.empty())
+ return "";
+
+ std::string hex = strprintf("%%%2x/", (int)str[0]);
+ for (unsigned f = 1; f < str.size(); f ++)
+ hex += strprintf("%%%2x", (int)str[f]);
+ return hex;
+}