Webdar 1.0.0
Web user interface to libdar
disconnected_page.hpp
1/*********************************************************************/
2// webdar - a web server and interface program to libdar
3// Copyright (C) 2013-2025 Denis Corbin
4//
5// This file is part of Webdar
6//
7// Webdar 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.
11//
12// Webdar 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.
16//
17// You should have received a copy of the GNU General Public License
18// along with Webdar. If not, see <http://www.gnu.org/licenses/>
19//
20//----
21// to contact the author: dar.linux@free.fr
22/*********************************************************************/
23
24#ifndef DISCONNECTED_PAGE_HPP
25#define DISCONNECTED_PAGE_HPP
26
27 // C system header files
28#include "my_config.h"
29extern "C"
30{
31
32}
33
34 // C++ system header files
35#include <dar/libdar.hpp>
36
37 // webdar headers
38#include "responder.hpp"
39#include "html_page.hpp"
40#include "html_text.hpp"
41
43
45{
46public:
47 static const std::string changed;
48
50 disconnected_page(const disconnected_page & ref) = delete;
51 disconnected_page(disconnected_page && ref) noexcept = delete;
52 disconnected_page & operator = (const disconnected_page & ref) = delete;
53 disconnected_page & operator = (disconnected_page && ref) noexcept = delete;
54 ~disconnected_page() = default;
55
57 void set_redirect(bool mode) { redir = mode; };
58
60 virtual answer give_answer(const request & req) override;
61
62protected:
64 virtual void prefix_has_changed() override;
65
66private:
67 bool redir;
68 html_page page;
69 html_text msg;
70};
71
72#endif
class answer provides easy means to set an HTTP answer and means to sent it back to a proto_connexion...
Definition: answer.hpp:49
html component used for the user to define a has algorithm
Definition: disconnected_page.hpp:45
void set_redirect(bool mode)
wether to redirect to the uri with trimmed path
Definition: disconnected_page.hpp:57
virtual answer give_answer(const request &req) override
inherited from responder
Definition: disconnected_page.cpp:69
virtual void prefix_has_changed() override
inherited from responder
Definition: disconnected_page.cpp:88
html page root component
Definition: html_page.hpp:45
class html_text manage text and header in html document
Definition: html_text.hpp:52
class holding fields of an HTTP request (method, URI, header, cookies, and so on)
Definition: request.hpp:45
pure virtual class, base class for all classes that can generate an answer to a request
Definition: responder.hpp:46