AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
anch::rest::EndPoint Class Reference

Router endpoint. More...

#include <endpoint.hpp>

Collaboration diagram for anch::rest::EndPoint:

Public Member Functions

 EndPoint ()
 EndPoint (const EndPoint &other)
 EndPoint (EndPoint &&other)
virtual ~EndPoint ()
bool match (const anch::rest::Request &request) const
void build ()
const std::string & getPathPattern () const
void setPathPattern (const std::string &pathPattern)
const std::regex & getPathRegex () const

Public Attributes

std::string verb
std::string pathPattern
std::string contentType
std::string accept

Detailed Description

Router endpoint.

HTTP router endpoint representation

Author
Vincent Lachenal
Since
0.1

Constructor & Destructor Documentation

◆ EndPoint() [1/3]

anch::rest::EndPoint::EndPoint ( )

EndPoint default constructor

◆ EndPoint() [2/3]

anch::rest::EndPoint::EndPoint ( const EndPoint & other)

EndPoint copy constructor

Parameters
otherthe EndPoint to copy
Here is the call graph for this function:

◆ EndPoint() [3/3]

anch::rest::EndPoint::EndPoint ( EndPoint && other)

EndPoint move constructor

Parameters
otherthe EndPoint to move
Here is the call graph for this function:

◆ ~EndPoint()

virtual anch::rest::EndPoint::~EndPoint ( )
virtual

EndPoint destructor

Member Function Documentation

◆ build()

void anch::rest::EndPoint::build ( )

Finalize EndPoint construction.
This will compute number of separator in path and path regular expression.

◆ getPathPattern()

const std::string & anch::rest::EndPoint::getPathPattern ( ) const

Path pattern getter

Returns
the path pattern

◆ getPathRegex()

const std::regex & anch::rest::EndPoint::getPathRegex ( ) const

Number of '/' getter in path

Returns
the number of '/'

◆ match()

bool anch::rest::EndPoint::match ( const anch::rest::Request & request) const

Check if Request match this endpoint

Parameters
requestthe request to check
Returns
true if request matches, false otherwise

◆ setPathPattern()

void anch::rest::EndPoint::setPathPattern ( const std::string & pathPattern)

Path pattern setter

Parameters
pathPatternthe path pattern to set

Member Data Documentation

◆ accept

std::string anch::rest::EndPoint::accept

Request media type

◆ contentType

std::string anch::rest::EndPoint::contentType

Reponse media type

◆ pathPattern

std::string anch::rest::EndPoint::pathPattern

Path pattern

◆ verb

std::string anch::rest::EndPoint::verb

HTTP verb


The documentation for this class was generated from the following file: