]> git.sesse.net Git - casparcg/blob - dependencies64/cef/linux/libcef_dll/ctocpp/response_ctocpp.cc
20a3d905fdc76a514a70d1e9869f804d1a785082
[casparcg] / dependencies64 / cef / linux / libcef_dll / ctocpp / response_ctocpp.cc
1 // Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12
13 #include "libcef_dll/ctocpp/response_ctocpp.h"
14 #include "libcef_dll/transfer_util.h"
15
16
17 // STATIC METHODS - Body may be edited by hand.
18
19 CefRefPtr<CefResponse> CefResponse::Create() {
20   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
21
22   // Execute
23   cef_response_t* _retval = cef_response_create();
24
25   // Return type: refptr_same
26   return CefResponseCToCpp::Wrap(_retval);
27 }
28
29
30 // VIRTUAL METHODS - Body may be edited by hand.
31
32 bool CefResponseCToCpp::IsReadOnly() {
33   cef_response_t* _struct = GetStruct();
34   if (CEF_MEMBER_MISSING(_struct, is_read_only))
35     return false;
36
37   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
38
39   // Execute
40   int _retval = _struct->is_read_only(_struct);
41
42   // Return type: bool
43   return _retval?true:false;
44 }
45
46 cef_errorcode_t CefResponseCToCpp::GetError() {
47   cef_response_t* _struct = GetStruct();
48   if (CEF_MEMBER_MISSING(_struct, get_error))
49     return ERR_NONE;
50
51   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
52
53   // Execute
54   cef_errorcode_t _retval = _struct->get_error(_struct);
55
56   // Return type: simple
57   return _retval;
58 }
59
60 void CefResponseCToCpp::SetError(cef_errorcode_t error) {
61   cef_response_t* _struct = GetStruct();
62   if (CEF_MEMBER_MISSING(_struct, set_error))
63     return;
64
65   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
66
67   // Execute
68   _struct->set_error(_struct,
69       error);
70 }
71
72 int CefResponseCToCpp::GetStatus() {
73   cef_response_t* _struct = GetStruct();
74   if (CEF_MEMBER_MISSING(_struct, get_status))
75     return 0;
76
77   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
78
79   // Execute
80   int _retval = _struct->get_status(_struct);
81
82   // Return type: simple
83   return _retval;
84 }
85
86 void CefResponseCToCpp::SetStatus(int status) {
87   cef_response_t* _struct = GetStruct();
88   if (CEF_MEMBER_MISSING(_struct, set_status))
89     return;
90
91   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
92
93   // Execute
94   _struct->set_status(_struct,
95       status);
96 }
97
98 CefString CefResponseCToCpp::GetStatusText() {
99   cef_response_t* _struct = GetStruct();
100   if (CEF_MEMBER_MISSING(_struct, get_status_text))
101     return CefString();
102
103   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
104
105   // Execute
106   cef_string_userfree_t _retval = _struct->get_status_text(_struct);
107
108   // Return type: string
109   CefString _retvalStr;
110   _retvalStr.AttachToUserFree(_retval);
111   return _retvalStr;
112 }
113
114 void CefResponseCToCpp::SetStatusText(const CefString& statusText) {
115   cef_response_t* _struct = GetStruct();
116   if (CEF_MEMBER_MISSING(_struct, set_status_text))
117     return;
118
119   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
120
121   // Verify param: statusText; type: string_byref_const
122   DCHECK(!statusText.empty());
123   if (statusText.empty())
124     return;
125
126   // Execute
127   _struct->set_status_text(_struct,
128       statusText.GetStruct());
129 }
130
131 CefString CefResponseCToCpp::GetMimeType() {
132   cef_response_t* _struct = GetStruct();
133   if (CEF_MEMBER_MISSING(_struct, get_mime_type))
134     return CefString();
135
136   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
137
138   // Execute
139   cef_string_userfree_t _retval = _struct->get_mime_type(_struct);
140
141   // Return type: string
142   CefString _retvalStr;
143   _retvalStr.AttachToUserFree(_retval);
144   return _retvalStr;
145 }
146
147 void CefResponseCToCpp::SetMimeType(const CefString& mimeType) {
148   cef_response_t* _struct = GetStruct();
149   if (CEF_MEMBER_MISSING(_struct, set_mime_type))
150     return;
151
152   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
153
154   // Verify param: mimeType; type: string_byref_const
155   DCHECK(!mimeType.empty());
156   if (mimeType.empty())
157     return;
158
159   // Execute
160   _struct->set_mime_type(_struct,
161       mimeType.GetStruct());
162 }
163
164 CefString CefResponseCToCpp::GetHeader(const CefString& name) {
165   cef_response_t* _struct = GetStruct();
166   if (CEF_MEMBER_MISSING(_struct, get_header))
167     return CefString();
168
169   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
170
171   // Verify param: name; type: string_byref_const
172   DCHECK(!name.empty());
173   if (name.empty())
174     return CefString();
175
176   // Execute
177   cef_string_userfree_t _retval = _struct->get_header(_struct,
178       name.GetStruct());
179
180   // Return type: string
181   CefString _retvalStr;
182   _retvalStr.AttachToUserFree(_retval);
183   return _retvalStr;
184 }
185
186 void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) {
187   cef_response_t* _struct = GetStruct();
188   if (CEF_MEMBER_MISSING(_struct, get_header_map))
189     return;
190
191   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
192
193   // Translate param: headerMap; type: string_map_multi_byref
194   cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc();
195   DCHECK(headerMapMultimap);
196   if (headerMapMultimap)
197     transfer_string_multimap_contents(headerMap, headerMapMultimap);
198
199   // Execute
200   _struct->get_header_map(_struct,
201       headerMapMultimap);
202
203   // Restore param:headerMap; type: string_map_multi_byref
204   if (headerMapMultimap) {
205     headerMap.clear();
206     transfer_string_multimap_contents(headerMapMultimap, headerMap);
207     cef_string_multimap_free(headerMapMultimap);
208   }
209 }
210
211 void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) {
212   cef_response_t* _struct = GetStruct();
213   if (CEF_MEMBER_MISSING(_struct, set_header_map))
214     return;
215
216   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
217
218   // Translate param: headerMap; type: string_map_multi_byref_const
219   cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc();
220   DCHECK(headerMapMultimap);
221   if (headerMapMultimap)
222     transfer_string_multimap_contents(headerMap, headerMapMultimap);
223
224   // Execute
225   _struct->set_header_map(_struct,
226       headerMapMultimap);
227
228   // Restore param:headerMap; type: string_map_multi_byref_const
229   if (headerMapMultimap)
230     cef_string_multimap_free(headerMapMultimap);
231 }
232
233
234 // CONSTRUCTOR - Do not edit by hand.
235
236 CefResponseCToCpp::CefResponseCToCpp() {
237 }
238
239 template<> cef_response_t* CefCToCppRefCounted<CefResponseCToCpp, CefResponse,
240     cef_response_t>::UnwrapDerived(CefWrapperType type, CefResponse* c) {
241   NOTREACHED() << "Unexpected class type: " << type;
242   return NULL;
243 }
244
245 #if DCHECK_IS_ON()
246 template<> base::AtomicRefCount CefCToCppRefCounted<CefResponseCToCpp,
247     CefResponse, cef_response_t>::DebugObjCt = 0;
248 #endif
249
250 template<> CefWrapperType CefCToCppRefCounted<CefResponseCToCpp, CefResponse,
251     cef_response_t>::kWrapperType = WT_RESPONSE;