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