2018-11-03 17:12:20 +01:00
|
|
|
#ifndef PARSER_H
|
|
|
|
#define PARSER_H
|
|
|
|
#include "iparser.h"
|
|
|
|
|
|
|
|
class Parser : public IParser
|
|
|
|
{
|
|
|
|
private:
|
2020-03-18 22:00:15 +01:00
|
|
|
std::string processLink(const PageDao &pageDao, UrlProvider &urlProvider, std::smatch &match) const;
|
2022-04-19 19:50:22 +02:00
|
|
|
std::string processImage(std::smatch &match) const;
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
public:
|
2023-11-27 21:37:54 +01:00
|
|
|
std::string extractFirstTag(std::string tagname, const std::string &content) const override;
|
2023-07-28 15:04:58 +02:00
|
|
|
std::string extractCommand(std::string cmdname, const std::string &content) const override;
|
|
|
|
std::vector<std::string> extractCommands(std::string cmdname, const std::string &content) const override;
|
2022-01-23 10:12:37 +01:00
|
|
|
std::vector<Headline> extractHeadlines(const std::string &content) const override;
|
|
|
|
std::vector<std::string> extractCategories(const std::string &content) const override;
|
2022-03-27 08:31:59 +02:00
|
|
|
using IParser::parse;
|
|
|
|
virtual std::string parse(
|
|
|
|
const PageDao &pagedao, UrlProvider &provider, const std::string &content,
|
|
|
|
const std::function<std::string(std::string_view, std::string_view)> &callback) const override;
|
2022-03-29 22:35:45 +02:00
|
|
|
std::string parseDynamics(
|
|
|
|
const std::string &content,
|
|
|
|
const std::function<std::string(std::string_view, std::string_view)> &callback) const override;
|
2022-03-27 08:31:59 +02:00
|
|
|
|
2018-11-03 17:12:20 +01:00
|
|
|
using IParser::IParser;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PARSER_H
|