2 * Copyright (C) 2009 by Aiwota Programmer
3 * aiwotaprog@tetteke.tk
5 * This file is part of Dialektos.
7 * Dialektos is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * Dialektos is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Dialektos. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef BBS_DETAIL_BASE_HXX
22 #define BBS_DETAIL_BASE_HXX
26 #include "board_subject_item.hxx"
27 #include "http_header.hxx"
36 namespace bbs_detail {
41 Base(const std::string& uri, const std::string& host,
42 const std::string& board, const std::string& thread);
45 virtual std::string get_board_dir_path() const;
46 virtual std::string get_thread_file_path() const;
47 virtual std::string get_thread_idx_path() const;
48 virtual std::string get_thread_dat_uri() const;
49 virtual std::string get_another_thread_uri(const std::string& thread) const;
50 virtual std::string get_board_subject_path() const;
51 virtual std::string get_board_subject_uri() const;
52 virtual std::string get_board_subject_idx_path() const;
53 virtual std::string get_board_idx_dir_path() const;
54 virtual http::Header get_board_subject_request_header() const;
55 virtual http::Header get_thread_dat_request_header() const;
56 virtual std::string get_title_from_string(const std::string& dat) const;
58 virtual const std::string& get_encoding() const;
60 virtual void load_thread(text_view::Layoutable& output) const;
61 virtual void load_thread_from_string(
62 const std::string& dat, text_view::Layoutable& output) const;
63 virtual void load_subject(std::vector<SubjectItem>& output) const;
64 virtual void load_subject_from_string(
65 const std::string&, std::vector<SubjectItem>& output) const;
67 bool is_board() const;
68 bool is_thread() const;
69 // static Base* judge(const std::string& uri);
71 bool operator==(const bbs_detail::Base& rhs) const;
74 explicit Base(const Base& rhs);
76 virtual Base* do_clone() const;
79 virtual const std::string& get_bbs_name() const;
81 const std::string uri_;
82 const std::string host_;
83 const std::string board_;
84 const std::string thread_;
86 static const std::string bbs_name;
87 static const std::string encoding;
91 } // namespace bbs_detail
93 } // namespace dialektos