Malloy
Loading...
Searching...
No Matches
Namespaces | Typedefs | Functions
malloy Namespace Reference

Namespaces

namespace  concepts
 
namespace  html
 
namespace  http
 
namespace  tcp
 
namespace  websocket
 

Typedefs

using error_code = boost::beast::error_code
 Error code used to signify errors without throwing. Truthy means it holds an error.
 

Functions

std::string_view to_string (const malloy::http::method method)
 
template<typename Body >
std::string to_string (const http::request< Body > &r)
 
template<typename Body , typename Fields >
std::string to_string (const http::response< Body, Fields > &r)
 
std::vector< std::string_view > split (std::string_view str, std::string_view delimiter)
 
template<typename ... Args>
void log (const server::http::connection_t &conn, spdlog::level::level_enum level, fmt::format_string< Args... > fmt, Args &&... args)
 

Detailed Description

Malloy's top level namespace. Everything is encapsulated in this namespace.

Function Documentation

◆ log()

template<typename ... Args>
void malloy::log ( const server::http::connection_t &  conn,
spdlog::level::level_enum  level,
fmt::format_string< Args... >  fmt,
Args &&...  args 
)

Log to connection logger.

This freestanding function allows logging to the connection logger.

Template Parameters
ArgsArguments parameter pack.
Parameters
connThe connection
levelLog level.
fmtFormat string.
argsArguments.

◆ split()

std::vector< std::string_view > malloy::split ( std::string_view  str,
std::string_view  delimiter 
)
inline

Splits a string.

Note
Passing an empty string will result in the return container containing an empty string.
Passing an empty string as the delimiter returns { str }.
Leading and trailing delimiters will be ignored.
Parameters
strThe string to split.
delimiterThe delimiter.
Returns
The string split into the corresponding parts.

◆ to_string()

std::string_view malloy::to_string ( const malloy::http::method  method)
inline

Convert HTTP method/verb to string.

Parameters
methodThe method.
Returns
String representation.