LeftHookRoll
An HTTP/1.0 compliant web server, as specified by RFC1945
Loading...
Searching...
No Matches
LocationConf Class Reference

#include <LocationConf.hpp>

Collaboration diagram for LocationConf:

Public Member Functions

 LocationConf ()
 
 LocationConf (const LocationConf &other)
 
LocationConfoperator= (const LocationConf &other)
 
 ~LocationConf ()
 
const std::string & getPath () const
 
const std::string & getRoot () const
 
const AllowedMethodsgetAllowedMethods () const
 
const std::string & getReturnURL () const
 
const std::string & getReturnCode () const
 
bool getAutoIndex () const
 
const std::string & getDefaultPage () const
 
const std::string & getStorageLocation () const
 
std::string getCgiInterpreter (const std::string &ext) const
 
void setPath (const std::string &path)
 
void setRoot (const std::string &root)
 
void addAllowedMethod (HTTPMethod method)
 
void setReturnURL (const std::string &url)
 
void setReturnCode (const std::string &code)
 
void setAutoIndex (bool autoIndex)
 
void setDefaultPage (const std::string &defaultPage)
 
void setStorageLocation (const std::string &storageLocation)
 
void addCgiInterpreter (const std::string &ext, const std::string &interpreterPath)
 
bool isMethodAllowed (HTTPMethod method) const
 Checks if a specific HTTP method is permitted in this location.
 
bool isCgiExtension (const std::string &ext) const
 Checks if a given file extension should be handled by CGI.
 

Private Attributes

std::string _path
 
std::string _root
 
AllowedMethods _allowedMethods
 
std::string _returnURL
 
std::string _returnCode
 
bool _autoIndex
 
std::string _defaultPage
 
std::string _storageLocation
 
std::map< std::string, std::string > _cgiInterpreters
 

Detailed Description

Definition at line 14 of file LocationConf.hpp.

Constructor & Destructor Documentation

◆ LocationConf() [1/2]

LocationConf::LocationConf ( )

Definition at line 3 of file LocationConf.cpp.

◆ LocationConf() [2/2]

LocationConf::LocationConf ( const LocationConf other)

Definition at line 5 of file LocationConf.cpp.

◆ ~LocationConf()

LocationConf::~LocationConf ( )

Definition at line 34 of file LocationConf.cpp.

Member Function Documentation

◆ operator=()

LocationConf & LocationConf::operator= ( const LocationConf other)

Definition at line 17 of file LocationConf.cpp.

◆ getPath()

const std::string & LocationConf::getPath ( ) const

Definition at line 37 of file LocationConf.cpp.

◆ getRoot()

const std::string & LocationConf::getRoot ( ) const

Definition at line 41 of file LocationConf.cpp.

◆ getAllowedMethods()

const AllowedMethods & LocationConf::getAllowedMethods ( ) const

Definition at line 45 of file LocationConf.cpp.

◆ getReturnURL()

const std::string & LocationConf::getReturnURL ( ) const

Definition at line 49 of file LocationConf.cpp.

◆ getReturnCode()

const std::string & LocationConf::getReturnCode ( ) const

Definition at line 53 of file LocationConf.cpp.

◆ getAutoIndex()

bool LocationConf::getAutoIndex ( ) const

Definition at line 57 of file LocationConf.cpp.

◆ getDefaultPage()

const std::string & LocationConf::getDefaultPage ( ) const

Definition at line 61 of file LocationConf.cpp.

◆ getStorageLocation()

const std::string & LocationConf::getStorageLocation ( ) const

Definition at line 65 of file LocationConf.cpp.

◆ getCgiInterpreter()

std::string LocationConf::getCgiInterpreter ( const std::string &  ext) const

Definition at line 109 of file LocationConf.cpp.

◆ setPath()

void LocationConf::setPath ( const std::string &  path)

Definition at line 70 of file LocationConf.cpp.

◆ setRoot()

void LocationConf::setRoot ( const std::string &  root)

Definition at line 74 of file LocationConf.cpp.

◆ addAllowedMethod()

void LocationConf::addAllowedMethod ( HTTPMethod  method)

Definition at line 99 of file LocationConf.cpp.

◆ setReturnURL()

void LocationConf::setReturnURL ( const std::string &  url)

Definition at line 78 of file LocationConf.cpp.

◆ setReturnCode()

void LocationConf::setReturnCode ( const std::string &  code)

Definition at line 82 of file LocationConf.cpp.

◆ setAutoIndex()

void LocationConf::setAutoIndex ( bool  autoIndex)

Definition at line 86 of file LocationConf.cpp.

◆ setDefaultPage()

void LocationConf::setDefaultPage ( const std::string &  defaultPage)

Definition at line 90 of file LocationConf.cpp.

◆ setStorageLocation()

void LocationConf::setStorageLocation ( const std::string &  storageLocation)

Definition at line 94 of file LocationConf.cpp.

◆ addCgiInterpreter()

void LocationConf::addCgiInterpreter ( const std::string &  ext,
const std::string &  interpreterPath 
)

Definition at line 117 of file LocationConf.cpp.

◆ isMethodAllowed()

bool LocationConf::isMethodAllowed ( HTTPMethod  method) const

Checks if a specific HTTP method is permitted in this location.

Parameters
methodThe method to check (e.g., GET, POST).
Returns
true if allowed, false otherwise.

Definition at line 104 of file LocationConf.cpp.

◆ isCgiExtension()

bool LocationConf::isCgiExtension ( const std::string &  ext) const

Checks if a given file extension should be handled by CGI.

Parameters
extThe extension including the dot (e.g., ".py").
Returns
true if this extension is configured as a CGI extension.

Definition at line 122 of file LocationConf.cpp.

Member Data Documentation

◆ _path

std::string LocationConf::_path
private

Definition at line 65 of file LocationConf.hpp.

◆ _root

std::string LocationConf::_root
private

Definition at line 67 of file LocationConf.hpp.

◆ _allowedMethods

AllowedMethods LocationConf::_allowedMethods
private

Definition at line 68 of file LocationConf.hpp.

◆ _returnURL

std::string LocationConf::_returnURL
private

Definition at line 69 of file LocationConf.hpp.

◆ _returnCode

std::string LocationConf::_returnCode
private

Definition at line 70 of file LocationConf.hpp.

◆ _autoIndex

bool LocationConf::_autoIndex
private

Definition at line 71 of file LocationConf.hpp.

◆ _defaultPage

std::string LocationConf::_defaultPage
private

Definition at line 72 of file LocationConf.hpp.

◆ _storageLocation

std::string LocationConf::_storageLocation
private

Definition at line 73 of file LocationConf.hpp.

◆ _cgiInterpreters

std::map<std::string, std::string> LocationConf::_cgiInterpreters
private

Definition at line 74 of file LocationConf.hpp.


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