stamdStatic Markdown Page Generator |
git clone git://git.dimitrijedobrota.com/stamd.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
indexer.hpp (908B)
0 #pragma once
2 #include <memory>
3 #include <string>
4 #include <vector>
6 #include "article.hpp"
7 #include "options.hpp"
9 namespace stamd
10 {
12 class Indexer
13 {
14 public:
15 using article_s = std::shared_ptr<Article>;
17 using article_list = std::vector<article_s>;
18 using categories_t = Article::categories_t;
20 explicit Indexer(options_t options)
21 : m_options(std::move(options))
22 {
23 }
25 void add(const article_s& article);
26 void add(categories_t categories);
28 void sort();
30 void create_robots(std::ostream& ost) const;
31 void create_sitemap(std::ostream& ost) const;
33 void create_atom(std::ostream& ost, const std::string& doc_title) const;
34 void create_rss(std::ostream& ost, const std::string& doc_title) const;
35 void create_index(std::ostream& ost, const std::string& doc_title);
37 private:
38 options_t m_options;
39 categories_t m_categories;
41 article_list m_articles;
42 };
44 } // namespace stamd