HTTPServer/HTTPPageList.h
2022-06-29 11:38:44 -07:00

72 lines
1.6 KiB
C++

#ifndef __HTTPPageList_h__
# define __HTTPPageList_h__
# include "TCPSession.h"
# include "ZString.h"
# include "__index.h"
# include "__script.h"
# include "__editview.h"
# include "__editview_js.h"
# include "__style.h"
# include "__entrypoints.h"
# include "__favicon_ico.h"
# include "__welcome.h"
# include "__viewlist.h"
# include "__workflow.h"
# include "__workflow_js.h"
# include "__addview.h"
# include "_image.h"
namespace http {
class HTTPPageList {
public:
HTTPPageList() {
add(index, "/");
add(script, "/script");
add(editview, "/editview/{view_name}");
add(editview_js, "/__editview_js");
add(style, "/style");
add(entrypoints, "/entrypoints");
add(favicon_ico, "/favicon.ico");
add(welcome, "/welcome");
add(viewlist, "/viewlist");
add(workflow, "/workflow");
add(workflow_js, "/__workflow_js");
add(image, "/image/{image_name}");
add(addview, "/addview");
}
bool processRequest(HTTPParameters &p);
void add(HTTPPage &page, std::string entryURL);
void remove(HTTPPage &page);
void matchUri(coreutils::ZString &comparator, coreutils::ZString &uri);
protected:
std::map<std::string, HTTPPage *> pages;
private:
__index index;
__script script;
__style style;
__editview editview;
__editview_js editview_js;
__entrypoints entrypoints;
__favicon_ico favicon_ico;
__welcome welcome;
__viewlist viewlist;
__workflow workflow;
__workflow_js workflow_js;
__addview addview;
_image image;
};
}
#endif