Webserv
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Attributes
Route Class Reference

#include <Route.hpp>

Inheritance diagram for Route:
Inheritance graph
[legend]
Collaboration diagram for Route:
Collaboration graph
[legend]

Public Member Functions

 Route (Server *server, string location, JSONNode *datas)
 Constructor.
 
 ~Route (void)
 Destructor.
 
string getLocation (void)
 
string getRoot (void)
 
string getReturn (void)
 
ServergetServer (void)
 
string getIndex (string uri, string path)
 Search for an index while generating autoindex.
 
string correctUri (string uri)
 Find the local path corresponding to the uri asked by te client.
 

Data Fields

vec_string _indexs
 
vec_string _allowed_methods
 
std::map< string, string > _cgi
 
int _client_max_body_size
 

Protected Attributes

Server_server
 
string _location
 
string _root
 
string _ret
 
bool _autoindex
 

Detailed Description

Definition at line 4 of file Route.hpp.

Constructor & Destructor Documentation

◆ Route()

Route::Route ( Server server,
string  location,
JSONNode datas 
)

Constructor.

A route is an object which define how to handle a request. Each Server is Route inherited and each location block lead to a new Route object.

Parameters
serverThe Server parent of the route. NULL if the object is the server.
locationThe uri associatied to the route.
datasThe JSONNode giving configuration.

Definition at line 20 of file Route.cpp.

Here is the call graph for this function:

◆ ~Route()

Route::~Route ( void  )

Destructor.

Definition at line 51 of file Route.cpp.

Member Function Documentation

◆ correctUri()

string Route::correctUri ( string  uri)

Find the local path corresponding to the uri asked by te client.

Parameters
uriThe uri asked by the client.
Returns
The local path.
Deprecated:
Not used by nginx until config use rewrite keyword.

Definition at line 115 of file Route.cpp.

Here is the call graph for this function:

◆ getIndex()

string Route::getIndex ( string  uri,
string  path 
)

Search for an index while generating autoindex.

Parameters
uriThe uri requested by client.
pathThe correct path associated with uri.
Returns
The index content to give to client or an empty string if there is nothing for him.

Definition at line 66 of file Route.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocation()

string Route::getLocation ( void  )

Definition at line 54 of file Route.cpp.

◆ getReturn()

string Route::getReturn ( void  )

Definition at line 56 of file Route.cpp.

◆ getRoot()

string Route::getRoot ( void  )

Definition at line 55 of file Route.cpp.

Here is the caller graph for this function:

◆ getServer()

Server * Route::getServer ( void  )

Field Documentation

◆ _allowed_methods

vec_string Route::_allowed_methods

Definition at line 11 of file Route.hpp.

◆ _autoindex

bool Route::_autoindex
protected

Definition at line 8 of file Route.hpp.

◆ _cgi

std::map<string, string> Route::_cgi

Definition at line 12 of file Route.hpp.

◆ _client_max_body_size

int Route::_client_max_body_size

Definition at line 13 of file Route.hpp.

◆ _indexs

vec_string Route::_indexs

Definition at line 11 of file Route.hpp.

◆ _location

string Route::_location
protected

Definition at line 7 of file Route.hpp.

◆ _ret

string Route::_ret
protected

Definition at line 7 of file Route.hpp.

◆ _root

string Route::_root
protected

Definition at line 7 of file Route.hpp.

◆ _server

Server* Route::_server
protected

Definition at line 6 of file Route.hpp.


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