49 lines
945 B
C++
49 lines
945 B
C++
#ifndef __HTTPPageList_h__
|
|
# define __HTTPPageList_h__
|
|
|
|
# include "TCPSession.h"
|
|
# include "ZString.h"
|
|
# include "__index.h"
|
|
# include "__script.h"
|
|
# include "__style.h"
|
|
# include "__favicon_ico.h"
|
|
# include "_image.h"
|
|
|
|
namespace http {
|
|
|
|
class HTTPPageList {
|
|
|
|
public:
|
|
HTTPPageList() {
|
|
add(index, "/");
|
|
add(script, "/script");
|
|
add(style, "/style");
|
|
add(favicon_ico, "/favicon.ico");
|
|
add(image, "/image/{image_name}");
|
|
add(index, "/{path}");
|
|
}
|
|
|
|
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;
|
|
__favicon_ico favicon_ico;
|
|
_image image;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|