1#ifndef CPR_USERAGENT_H
2#define CPR_USERAGENT_H
3
4#include <initializer_list>
5#include <string>
6
7#include "cpr/cprtypes.h"
8
9namespace cpr {
10class UserAgent : public StringHolder<UserAgent> {
11 public:
12 UserAgent() = default;
13 // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
14 UserAgent(std::string useragent) : StringHolder<UserAgent>(std::move(useragent)) {}
15 // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
16 UserAgent(std::string_view useragent) : StringHolder<UserAgent>(useragent) {}
17 // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
18 UserAgent(const char* useragent) : StringHolder<UserAgent>(useragent) {}
19 UserAgent(const char* str, size_t len) : StringHolder<UserAgent>(str, len) {}
20 UserAgent(const std::initializer_list<std::string> args) : StringHolder<UserAgent>(args) {}
21 UserAgent(const UserAgent& other) = default;
22 UserAgent(UserAgent&& old) noexcept = default;
23 ~UserAgent() override = default;
24
25 UserAgent& operator=(UserAgent&& old) noexcept = default;
26 UserAgent& operator=(const UserAgent& other) = default;
27};
28
29} // namespace cpr
30
31#endif
32