44 std::string
const &
path()
const;
Block(std::string const &name)
Definition Block.cpp:11
Represents a single 'location' block from the configuration file.
Definition LocationBlock.hpp:18
MatchType matchType() const
Gets the match type for this location.
Definition LocationBlock.cpp:14
bool autoIndex() const
Gets the autoIndex setting.
Definition LocationBlock.cpp:44
bool isRegex() const
Compatibility wrapper for checking if this is a "regex" (extension) location.
Definition LocationBlock.cpp:18
bool autoIndex_
Whether directory listing is enabled.
Definition LocationBlock.hpp:124
LocationBlock()
Definition LocationBlock.cpp:9
MatchType
Specifies how the location path should be matched against the request URI.
Definition LocationBlock.hpp:23
@ PREFIX
Standard prefix matching (e.g., /static/)
Definition LocationBlock.hpp:24
@ EXTENSION
File extension matching (e.g., .php)
Definition LocationBlock.hpp:25
std::string resolveIndexFile(std::string const &dirPath) const
Tries to find an index file in the given directory.
Definition LocationBlock.cpp:51
ServerBlock * parent_
Pointer to the parent ServerBlock.
Definition LocationBlock.hpp:120
std::string const & path() const
Gets the URI path that this location block matches.
Definition LocationBlock.cpp:12
ServerBlock const * parent() const
Gets a pointer to the parent ServerBlock.
Definition LocationBlock.cpp:42
MatchType matchType_
How this location matches.
Definition LocationBlock.hpp:122
std::string path_
The URI path/pattern this location matches.
Definition LocationBlock.hpp:121
bool hasCgiPass() const
Checks if a 'cgi_pass' directive is configured for this location.
Definition LocationBlock.cpp:35
std::string extension_
The extracted extension if MatchType is EXTENSION.
Definition LocationBlock.hpp:123
std::string const & extension() const
Gets the extension string (including the dot) for EXTENSION match type.
Definition LocationBlock.cpp:16
Represents a single 'server' block from the configuration file.
Definition ServerBlock.hpp:22
Definition ArgumentFactory.hpp:5
std::ostream & operator<<(std::ostream &o, Token const &t)
Definition Token.cpp:29