49 lines
813 B
C++
Raw Permalink Normal View History

2025-03-07 02:25:54 +01:00
#include <seafire/routing/endpoint.hxx>
namespace seafire::routing
{
endpoint_t::
2025-03-07 22:13:09 +01:00
endpoint_t(std::string host,
std::string path,
server::request_handler_t handler)
: host_{std::move(host)},
path_{std::move(path)},
handler_{std::move(handler)}
2025-03-07 02:25:54 +01:00
{}
std::string const&
endpoint_t::
2025-03-07 22:13:09 +01:00
host() const
2025-03-07 02:25:54 +01:00
{
2025-03-07 22:13:09 +01:00
return host_;
}
std::string const&
endpoint_t::
path() const
{
return path_;
2025-03-07 02:25:54 +01:00
}
server::request_handler_t const&
endpoint_t::
handler() const
{
return handler_;
}
std::ostream&
to_stream(std::ostream& o, endpoint_t const& ep)
{
2025-03-07 22:13:09 +01:00
return o << ep.host() << ": " << ep.path();
2025-03-07 02:25:54 +01:00
}
std::ostream&
operator<<(std::ostream& o, endpoint_t const& ep)
{
return to_stream(o, ep);
}
} // namespace seafire::routing