Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Types.hpp
Go to the documentation of this file.
1// The Reactive C++ Toolbox.
2// Copyright (C) 2013-2019 Swirly Cloud Limited
3// Copyright (C) 2022 Reactive Markets Limited
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17#ifndef TOOLBOX_HTTP_TYPES_HPP
18#define TOOLBOX_HTTP_TYPES_HPP
19
21
22#include <toolbox/contrib/http_parser.h>
23
24#include <iostream>
25
26namespace toolbox {
27inline namespace http {
28
29enum class First : bool { No = false, Yes = true };
30
31enum class NoCache : bool { No = false, Yes = true };
32
69
70inline const char* enum_string(Method method) noexcept
71{
72 return http_method_str(static_cast<http_method>(method));
73}
74
75template <typename StreamT>
76 requires Streamable<StreamT>
78{
79 os << enum_string(method);
80 return os;
81}
82
95
96TOOLBOX_API const char* enum_string(Status status) noexcept;
97
98template <typename StreamT>
99 requires Streamable<StreamT>
105
107
108} // namespace http
109} // namespace toolbox
110
111#endif // TOOLBOX_HTTP_TYPES_HPP
#define TOOLBOX_API
Definition Config.h:39
ostream & operator<<(ostream &os, const pair< T, U > &p)
Definition Parser.ut.cpp:29
const char * enum_string(Status status) noexcept
Definition Types.cpp:22
constexpr auto bind() noexcept
Definition Slot.hpp:92