Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
middleware.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "response.h"
4 #include <unordered_map>
5 #include "request.h"
6 
14 class Middleware {
15  std::string nameID;
16 protected:
19  std::unordered_map<std::string, std::string> * map;
20 public:
21 
28  Middleware(const char * nameID);
29 
33  virtual ~Middleware();
34 
43  void setContent(Request * request, Response * response);
44 
53  void addValueToMap(const char * key, const char * value);
54 
65  bool getValueFromMap(const char * key, std::string & value);
66 
73  std::unordered_map<std::string, std::string> * getMap();
74 
81  virtual bool autoExec() = 0;
82 
86  virtual void exec() = 0;
87 
94  std::string getNameID();
95 
99  virtual void clear();
100 };
virtual void clear()
std::unordered_map< std::string, std::string > * map
Definition: middleware.h:19
class wrapper of HTTP response
Definition: response.h:13
virtual bool autoExec()=0
Middleware(const char *nameID)
std::unordered_map< std::string, std::string > * getMap()
std::string getNameID()
void addValueToMap(const char *key, const char *value)
void setContent(Request *request, Response *response)
class wrapper of HTTP request
Definition: request.h:14
virtual void exec()=0
virtual ~Middleware()
class wrapper for middleware
Definition: middleware.h:14
bool getValueFromMap(const char *key, std::string &value)
Request * request
Definition: middleware.h:17
Response * response
Definition: middleware.h:18