#ifndef ____viewlist_h__ #define ____viewlist_h__ #include "HTTPPage.h" #include "Directory.h" namespace http { class __viewlist : public HTTPPage { int processCommand(std::string request, core::TCPSession *session, HTTPSession *httpSession, HTTPRequest *httpRequest, std::stringstream &data) override { coreutils::Directory directory("/home/bradarant/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