#ifndef PAGED_ARTICLE_H #define PAGED_ARTICLE_H #include #include #include #include "core/file_cache.h" #include "core/object.h" #include "core/request.h" struct Article { std::string url; std::string summary_page; std::map pages; FileCache *file_cache; Article() { file_cache = new FileCache(); } ~Article() { for (std::map::iterator it = pages.begin(); it != pages.end(); ++it) { delete ((*it).second); } pages.clear(); delete file_cache; } }; class PagedArticle : public Object { RCPP_OBJECT(PagedArticle, Object); public: void index(Request *request); void load(); Article *load_folder(const std::string &folder, const std::string &path); void generate_summaries(); void generate_summary(Article *article); PagedArticle(); ~PagedArticle(); std::map pages; std::string folder; std::string base_path; }; #endif