Webserv
Loading...
Searching...
No Matches
utils Namespace Reference

Classes

struct  IpInfo
class  Logger

Enumerations

enum  HttpMethod {
  GET , POST , PUT , DELETE ,
  UNKNOWN
}
enum  LogLevel {
  TRACE , DEBUG , INFO , WARNING ,
  ERROR , FATAL
}
 Defines the severity levels for log messages. More...

Functions

bool isValidPort (int port)
bool isValidPort (std::string const &)
bool isValidIPv4 (char const *)
bool isValidIPv4 (std::string const &)
bool isAllDigit (std::string const &s)
bool extractIpInfo (std::string const &, IpInfo &)
std::ostream & operator<< (std::ostream &o, HttpMethod)
HttpMethod matchHttpMethod (std::string const &)
std::string getFileExtension (std::string const &fpath)
template<typename T>
std::string toString (T const &v)
template<typename T>
fromString (std::string const &str)
const char * validateDirectoryPath (const char *path)

Enumeration Type Documentation

◆ HttpMethod

Enumerator
GET 
POST 
PUT 
DELETE 
UNKNOWN 

◆ LogLevel

Defines the severity levels for log messages.

Enumerator
TRACE 

Fine-grained messages, typically for detailed debugging.

DEBUG 

Information useful for developers during debugging.

INFO 

Informational messages about application progress.

WARNING 

Indicates a potential issue that is not a critical error.

ERROR 

An error that occurred but the application can recover from.

FATAL 

A critical error that will likely lead to termination.

Function Documentation

◆ extractIpInfo()

bool utils::extractIpInfo ( std::string const & s,
IpInfo & info )

◆ fromString()

template<typename T>
T utils::fromString ( std::string const & str)

◆ getFileExtension()

std::string utils::getFileExtension ( std::string const & fpath)

◆ isAllDigit()

bool utils::isAllDigit ( std::string const & s)

◆ isValidIPv4() [1/2]

bool utils::isValidIPv4 ( char const * s)

◆ isValidIPv4() [2/2]

bool utils::isValidIPv4 ( std::string const & s)

◆ isValidPort() [1/2]

bool utils::isValidPort ( int port)

◆ isValidPort() [2/2]

bool utils::isValidPort ( std::string const & v)

◆ matchHttpMethod()

HttpMethod utils::matchHttpMethod ( std::string const & s)

◆ operator<<()

std::ostream & utils::operator<< ( std::ostream & o,
HttpMethod m )

◆ toString()

template<typename T>
std::string utils::toString ( T const & v)

◆ validateDirectoryPath()

const char * utils::validateDirectoryPath ( const char * path)