C++ Web Framework  3.0
filter.h
1 /*
2  Copyright 2017 Herik Lima de Castro and Marcelo Medeiros Eler
3  Distributed under MIT license, or public domain if desired and
4  recognized in your jurisdiction.
5  See file LICENSE for detail.
6 */
7 
8 #ifndef FILTER_H
9 #define FILTER_H
10 
11 #include "request.h"
12 #include "response.h"
13 #include "filterchain.h"
14 #include "cppwebframework_global.h"
15 
16 CWF_BEGIN_NAMESPACE
23 class CPPWEBFRAMEWORKSHARED_EXPORT Filter
24 {
25 public:
29  virtual ~Filter() {}
91  virtual void doFilter(CWF::Request &request, CWF::Response &response, FilterChain &chain) { chain.doFilter(request, response); }
92 };
93 
94 CWF_END_NAMESPACE
95 
96 #endif // FILTER_H
virtual ~Filter()
Virtual destructor.
Definition: filter.h:29
The FilterChain class is responsable to dispatch a requisition. This class was built to work with Fil...
Definition: filterchain.h:29
The Filter class works like a filter. You can use this class to validate sessions or measuring runtim...
Definition: filter.h:23
void doFilter(CWF::Request &request, CWF::Response &response)
This method dispaches a requisition to a Request or, if the requesition is for a file, it can reads and send the file through the Response.
Definition: filterchain.cpp:18
virtual void doFilter(CWF::Request &request, CWF::Response &response, FilterChain &chain)
This method will be called always that the CppWebServer receives a requisition.
Definition: filter.h:91