summaryrefslogtreecommitdiff
path: root/include/tgbot/tools/StringTools.h
diff options
context:
space:
mode:
authorllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-10-05 13:57:24 +0200
committerllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-10-05 13:57:24 +0200
commit1d238b70e2655e64b1cb1a51357a9eb0c753181d (patch)
tree225887e2662598a15ce2a98f1ca5ea0a146cd516 /include/tgbot/tools/StringTools.h
parentd9615bbe41c830eb3941e3f6235d47b6a46e584d (diff)
Escape poll options (#128)
Diffstat (limited to 'include/tgbot/tools/StringTools.h')
-rw-r--r--include/tgbot/tools/StringTools.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/tgbot/tools/StringTools.h b/include/tgbot/tools/StringTools.h
index fa3a2f5..a833fc2 100644
--- a/include/tgbot/tools/StringTools.h
+++ b/include/tgbot/tools/StringTools.h
@@ -63,6 +63,15 @@ TGBOT_API
std::string urlDecode(const std::string& value);
/**
+ * Escapes a string with illegal characters ("\/) for json
+ *
+ * @param value input string
+ *
+ * @return An encoded string
+ */
+std::string escapeJsonString(const std::string& value);
+
+/**
* Splits string to smaller substrings which have between them a delimiter. Resulting substrings won't have delimiter.
* @param str Source string
* @param delimiter Delimiter