MCPcopy Create free account
hub / github.com/JosephP91/curlcpp / curl_header

Class curl_header

include/curl_header.h:41–84  ·  view source on GitHub ↗

* This class represents a generic header. It allows a user to add * headers without caring about deallocation of resources. */

Source from the content-addressed store, hash-verified

39 * headers without caring about deallocation of resources.
40 */
41 class curl_header {
42 public:
43 /**
44 * The default constructor will initialize the headers list
45 * with nullptr.
46 */
47 curl_header();
48 /**
49 * Overloaded constructor that allows users to initialize the
50 * headers list with a list of values.
51 */
52 curl_header(std::initializer_list<std::string>);
53 /**
54 * Copy constructor. Performs a deep copy of the headers list.
55 */
56 curl_header(const curl_header &);
57 /**
58 * Assignment operator to perform assignment between object of
59 * this class type.
60 */
61 curl_header &operator=(const curl_header &);
62 /**
63 * The destructor will deallocate the resources used to handle
64 * the headers list.
65 */
66 ~curl_header() NOEXCEPT;
67 /**
68 * This method allows users to add a header as string.
69 */
70 void add(const std::string&);
71 /**
72 * This method allows users to add headers specifying an iterable
73 * data structure containing the headers to add.
74 */
75 template<typename Iterator> void add(Iterator, Iterator);
76 /**
77 * Simple getter method that returns the pointer to the headers
78 * list.
79 */
80 const struct curl_slist *get() const;
81 private:
82 int size;
83 struct curl_slist *headers;
84 };
85
86 // Implementation of get method.
87 inline const struct curl_slist *curl_header::get() const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected