68 lines
1.8 KiB
C++
68 lines
1.8 KiB
C++
#ifndef seafire__resources__preconditions_hxx_
|
|
#define seafire__resources__preconditions_hxx_
|
|
|
|
#include <seafire/protocol/rfc7232/if-match.hxx>
|
|
#include <seafire/protocol/rfc7232/if-modified-since.hxx>
|
|
#include <seafire/protocol/rfc7232/if-none-match.hxx>
|
|
#include <seafire/protocol/rfc7232/if-unmodified-since.hxx>
|
|
#include <seafire/resources/concepts.hxx>
|
|
#include <seafire/resources/traits.hxx>
|
|
#include <seafire/server/request.hxx>
|
|
#include <seafire/server/response.hxx>
|
|
|
|
#include <seafire/representation/concepts.hxx>
|
|
#include <seafire/representation/traits.hxx>
|
|
|
|
#include <chrono>
|
|
|
|
namespace seafire::resources
|
|
{
|
|
|
|
bool
|
|
check_preconditions(
|
|
server::request_t& req,
|
|
server::response_t& res,
|
|
representation::BasicRepresentation auto const& r);
|
|
|
|
// If-Match
|
|
//
|
|
bool
|
|
check_if_match(
|
|
server::request_t& req,
|
|
server::response_t& res,
|
|
representation::BasicRepresentation auto const& r,
|
|
protocol::rfc7232::if_match_t const& if_match);
|
|
|
|
// If-Unmodified-Since
|
|
//
|
|
bool
|
|
check_if_unmodified_since(
|
|
server::request_t& req,
|
|
server::response_t& res,
|
|
representation::BasicRepresentation auto const& representation,
|
|
std::chrono::system_clock::time_point const& if_unmodified_since);
|
|
|
|
// If-None-Match
|
|
//
|
|
bool
|
|
check_if_none_match(
|
|
server::request_t& req,
|
|
server::response_t& res,
|
|
representation::BasicRepresentation auto const& r,
|
|
protocol::rfc7232::if_none_match_t const& if_none_match);
|
|
|
|
// If-Modified-Since
|
|
//
|
|
bool
|
|
check_if_modified_since(
|
|
server::request_t& req,
|
|
server::response_t& res,
|
|
representation::BasicRepresentation auto const& r,
|
|
std::chrono::system_clock::time_point const& if_modified_since);
|
|
|
|
} // namespace seafire::resources
|
|
|
|
#include <seafire/resources/preconditions.txx>
|
|
|
|
#endif
|