Webserv
Loading...
Searching...
No Matches
config::IDirective Interface Referenceabstract

Defines the contract for a configuration directive handler. More...

#include <IDirective.hpp>

Inheritance diagram for config::IDirective:
config::AliasDirective config::AllowMethodsDirective config::AutoIndexDirective config::CgiPassDirective config::ClientMaxBodySize config::ErrorPageDirective config::IndexDirective config::ListenDirective config::ReturnDirective config::RootDirective config::ServerNameDirective config::UploadPathDirective

Public Member Functions

virtual ~IDirective ()
 Virtual destructor.
virtual void process (Block &block, ParsedDirectiveArgs const &args) const =0
 The primary logic for processing the directive's arguments.
virtual std::string const & getName () const =0
 Gets the name of the directive.

Detailed Description

Defines the contract for a configuration directive handler.

This interface uses the Strategy Pattern to encapsulate the logic for processing a specific directive (e.g., 'listen', 'root') from the configuration file. Each concrete directive class will implement this interface to handle its specific syntax and validation.

Constructor & Destructor Documentation

◆ ~IDirective()

virtual config::IDirective::~IDirective ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ getName()

virtual std::string const & config::IDirective::getName ( ) const
pure virtual

◆ process()

virtual void config::IDirective::process ( Block & block,
ParsedDirectiveArgs const & args ) const
pure virtual

The primary logic for processing the directive's arguments.

Parameters
blockThe configuration block (ServerBlock or LocationBlock) to modify.
argsThe vector of string arguments for the directive.

Implemented in config::AliasDirective, config::AllowMethodsDirective, config::AutoIndexDirective, config::CgiPassDirective, config::ClientMaxBodySize, config::ErrorPageDirective, config::IndexDirective, config::ListenDirective, config::ReturnDirective, config::RootDirective, config::ServerNameDirective, and config::UploadPathDirective.


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