#ifndef ____viewlist_h__
#define ____viewlist_h__
#include "HTTPPage.h"
#include "Directory.h"
namespace http {
class __viewlist : public HTTPPage {
int processCommand(HTTPRequest *httpRequest,
core::TCPSession *session,
HTTPSession *httpSession,
std::stringstream &data) override {
coreutils::Directory directory("../../jetserver/views");
data << "
" << std::endl;
data << "
" << std::endl;
data << " Create new view" << std::endl;
data << "
" << std::endl;
while(!directory.eod()) {
if(directory.get().getName().substr(0, 1) == ".") {
directory.next();
continue;
}
data << "
" << std::endl;
data << " " << directory.get().getName() << "" << std::endl;
data << "
" << std::endl;
directory.next();
}
data << "
" << std::endl;
httpRequest->response.addHeader("Content-Type", "text/html");
return true;
}
};
}
#endif