IOLink IOL_v1.8.0_release
Loading...
Searching...
No Matches
HTTPHeaders.h
1#pragma once
2
3#include <array>
4#include <initializer_list>
5#include <string>
6
7#include <iolink/IOLinkAPI.h>
8
9namespace iolink
10{
11
15class IOLINK_API HTTPHeaders
16{
17public:
21 struct Entry
22 {
23 std::string name;
24 std::string value;
25 };
26
31
38 HTTPHeaders(const Entry* values, size_t count);
39
43 explicit HTTPHeaders(std::initializer_list<Entry> init);
44
45 HTTPHeaders(const HTTPHeaders& other);
46 HTTPHeaders& operator=(const HTTPHeaders& other);
47
48 HTTPHeaders(HTTPHeaders&& other) noexcept;
49 HTTPHeaders& operator=(HTTPHeaders&& other) noexcept;
50
52
56 size_t size() const;
57
61 Entry at(size_t i) const;
62
66 inline Entry operator[](size_t i) const { return at(i); }
67
71 void add(const Entry& entry);
72
76 inline void add(const std::string& name, const std::string& value) { add(Entry{name, value}); }
77
78private:
79 class Private;
80 Private* m_private;
81};
82
83} // namespace iolink
An entry of the HTTP header set.
Definition: HTTPHeaders.h:22