MantisBase v0.3.4
Loading...
Searching...
No Matches
types.h File Reference

Type definitions and aliases for MantisBase. More...

#include <httplib.h>
#include <nlohmann/json.hpp>
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mb
 router.h
 

Macros

#define REQUEST_HANDLED   HandlerResponse::Handled;
 
#define REQUEST_PENDING   HandlerResponse::Unhandled;
 

Typedefs

using mb::HandlerResponse = httplib::Server::HandlerResponse
 
using mb::HandlerFn = std::function< void(MantisRequest &, MantisResponse &)>
 

‍Route Handler function shorthand


 
using mb::HandlerWithContentReaderFn = std::function< void(MantisRequest &, MantisResponse &, MantisContentReader &)>
 

‍Route Handler function with content reader shorthand


 
using mb::MiddlewareFn = std::function< HandlerResponse(MantisRequest &, MantisResponse &)>
 

‍Middleware shorthand for the function


 
using mb::Middlewares = std::vector< MiddlewareFn >
 

‍Middleware function arrays


 
using mb::Method = std::string
 

‍Syntactic sugar for request method which is a std::string


 
using mb::Path = std::string
 

‍Syntactic sugar for request path which is a std::string


 
using mb::RouteKey = std::pair< Method, Path >
 

‍Shorthand notation for the request's method, path pair.


 

Detailed Description

Type definitions and aliases for MantisBase.

Defines common types used throughout the MantisBase library including handler functions, middleware types, and route keys.

Macro Definition Documentation

◆ REQUEST_HANDLED

#define REQUEST_HANDLED   HandlerResponse::Handled;

◆ REQUEST_PENDING

#define REQUEST_PENDING   HandlerResponse::Unhandled;