blob: 18d4f9a52451b5f7cb4a92a994af74861e84fee1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#pragma once
#include <sstream>
#include <string>
#include <vector>
namespace bot {
namespace utils {
namespace string {
std::vector<std::string> split_text(const std::string &text,
char delimiter);
std::string join_vector(const std::vector<std::string> &vec,
char delimiter);
std::string join_vector(const std::vector<std::string> &vec);
template <typename T>
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);
std::vector<std::vector<std::string>> separate_by_length(
const std::vector<std::string> &vector, const int &max_length);
std::vector<std::string> separate_by_length(
const std::string &base, const std::vector<std::string> &values,
const std::string &prefix, const std::string &separator,
const long long &max_length);
}
}
}
|