2020-12-26 17:49:59 +01:00
|
|
|
#ifndef UTILS_H
|
|
|
|
#define UTILS_H
|
|
|
|
|
|
|
|
#include <string>
|
2020-12-28 23:13:54 +01:00
|
|
|
#include <vector>
|
2020-12-26 17:49:59 +01:00
|
|
|
|
|
|
|
class Utils {
|
2020-12-28 23:13:54 +01:00
|
|
|
public:
|
|
|
|
static void newline_to_br(std::string *str);
|
|
|
|
//htmlspecialchars
|
2020-12-26 17:49:59 +01:00
|
|
|
|
2020-12-28 23:13:54 +01:00
|
|
|
static void markdown_to_html(std::string *str);
|
|
|
|
|
|
|
|
static std::string get_pagination(const std::string base_url, const uint32_t max, const uint32_t current_index, const uint32_t max_visible_links = 10);
|
|
|
|
static std::string get_pagination_links(const std::string base_url, const std::vector<std::string> &links, const uint32_t current_index, const uint32_t max_visible_links = 10);
|
|
|
|
|
|
|
|
static void str_replace(std::string *str, const std::string &from, const std::string &to);
|
2020-12-27 03:35:41 +01:00
|
|
|
|
2020-12-26 17:49:59 +01:00
|
|
|
protected:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|