RequestToString.cc 535 B

123456789101112131415161718192021222324252627
  1. #ifndef _D_REQUEST_TO_STRING_H_
  2. #define _D_REQUEST_TO_STRING_H_
  3. #include "Util.h"
  4. #include "Request.h"
  5. #include <string>
  6. using namespace std;
  7. class RequestToString {
  8. private:
  9. Request* req;
  10. public:
  11. RequestToString(Request* req) {
  12. this->req = req;
  13. }
  14. string toString() {
  15. return "url = "+req->url+"\n"+
  16. "protocol = "+req->protocol+"\n"+
  17. "host = "+req->host+"\n"+
  18. "port = "+Util::ulitos(req->port)+"\n"+
  19. "dir = "+req->dir+"\n"+
  20. "file = "+req->file;
  21. }
  22. #endif // _D_REQUEST_TO_STRING_H_