From d1793df1eda463b10107d41785ad1d7f055ed476 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 14:48:12 +0500 Subject: upd: moved the bot part to a relative subfolder --- bot/src/utils/string.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 bot/src/utils/string.hpp (limited to 'bot/src/utils/string.hpp') diff --git a/bot/src/utils/string.hpp b/bot/src/utils/string.hpp new file mode 100644 index 0000000..c8385ad --- /dev/null +++ b/bot/src/utils/string.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include + +namespace bot { + namespace utils { + namespace string { + std::vector split_text(const std::string &text, + char delimiter); + std::string join_vector(const std::vector &vec, + char delimiter); + std::string join_vector(const std::vector &vec); + + template + std::string str(T begin, T end, char delimiter) { + std::stringstream ss; + bool first = true; + + for (; begin != end; begin++) { + if (!first) ss << delimiter; + ss << *begin; + first = false; + } + return ss.str(); + } + + bool string_contains_sql_injection(const std::string &input); + } + } +} -- cgit v1.2.3