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
#ifndef MARKDOWN_H #define MARKDOWN_H 1 #include "../../Content.hpp" #include "../../Filesystem.hpp" using Markdowns = std::unordered_map<std::string, std::shared_ptr<std::string> >; class Markdown : public Content { public: explicit Markdown(std::string uriBasePath, std::string markdownFilesPath, std::string mainTemplatePath = ""); bool Init(); void Shutdown(); bool Render(RequestResponse & rr, RenderData & rd, std::string & out); std::string const & GetUriBasePath() const; std::string const & GetMainTemplate() const; Redirections const & GetRedirections() const; bool HasMarkdownFile(std::string filePath) const; bool HasMarkdownURI(std::string uriPath) const; Markdowns const & GetMarkdowns() const; std::shared_ptr<std::string> const & GetMarkdownHTML(std::string uriPath); private: std::string m_UriBasePath; std::string m_MainTemplatePath; std::string m_MarkdownFilesPath; Redirections m_Redirections; Markdowns m_Markdowns; }; #endif