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

Class curl_ios

include/curl_ios.h:57–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55namespace curl {
56 // Base class for curl_ios
57 template<class T> class curl_ios {
58 public:
59 // This constructor allows to specifiy a custom stream and a custom callback pointer.
60 curl_ios(T *stream, curlcpp_callback_type callback_ptr) : _stream(stream) {
61 this->set_callback(callback_ptr);
62 }
63
64 // This method allow to specify a custom callback pointer.
65 void set_callback(curlcpp_callback_type callback_ptr) {
66 _callback_ptr = callback_ptr == nullptr ? write_callback<std::ostringstream> : callback_ptr;
67 }
68
69 // This method returns the stream pointer.
70 T *get_stream() const {
71 return _stream;
72 }
73
74 // This method return the callback function pointer.
75 curlcpp_callback_type get_function() const {
76 return _callback_ptr;
77 }
78 private:
79 // Callback pointer.
80 curlcpp_callback_type _callback_ptr;
81
82 // Generic stream pointer.
83 T* _stream;
84 };
85
86
87 // Template specialization for fstream

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected