Wexus2 0.20
|
00001 00002 /* 00003 * Copyright (c) 2011 Aleksander B. Demko 00004 * This source code is distributed under the MIT license. 00005 * See the accompanying file LICENSE.MIT.txt for details. 00006 */ 00007 00008 #ifndef __INCLUDED_WEXUS_REDIRECTAPP_H__ 00009 #define __INCLUDED_WEXUS_REDIRECTAPP_H__ 00010 00011 #include <wexus/Application.h> 00012 00013 namespace wexus 00014 { 00015 class RedirectApp; 00016 } 00017 00018 /** 00019 * An app that, based on a list, does redirections. 00020 * 00021 * INI parameters: 00022 * linkX = "/src dest" 00023 * X is a number, 1, 2, etc 00024 * /src is url to match, leading / is required 00025 * dest is the url to return, can be relative to have a / or hostname, etc 00026 * 00027 * @author Aleksander Demko 00028 */ 00029 class wexus::RedirectApp : public wexus::Application 00030 { 00031 public: 00032 RedirectApp(void); 00033 00034 virtual void init(const QVariantMap &settings); 00035 00036 virtual void handleApplicationRequest(QString &filteredRequest, wexus::HTTPRequest &req, wexus::HTTPReply &reply); 00037 00038 protected: 00039 QMap<QString, QString> dm_redirs; 00040 }; 00041 00042 00043 #endif 00044