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.
5 // ---------------------------------------------------------------------------
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.
13 #include "libcef_dll/ctocpp/response_ctocpp.h"
14 #include "libcef_dll/transfer_util.h"
17 // STATIC METHODS - Body may be edited by hand.
19 CefRefPtr<CefResponse> CefResponse::Create() {
20 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
23 cef_response_t* _retval = cef_response_create();
25 // Return type: refptr_same
26 return CefResponseCToCpp::Wrap(_retval);
30 // VIRTUAL METHODS - Body may be edited by hand.
32 bool CefResponseCToCpp::IsReadOnly() {
33 cef_response_t* _struct = GetStruct();
34 if (CEF_MEMBER_MISSING(_struct, is_read_only))
37 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
40 int _retval = _struct->is_read_only(_struct);
43 return _retval?true:false;
46 cef_errorcode_t CefResponseCToCpp::GetError() {
47 cef_response_t* _struct = GetStruct();
48 if (CEF_MEMBER_MISSING(_struct, get_error))
51 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
54 cef_errorcode_t _retval = _struct->get_error(_struct);
56 // Return type: simple
60 void CefResponseCToCpp::SetError(cef_errorcode_t error) {
61 cef_response_t* _struct = GetStruct();
62 if (CEF_MEMBER_MISSING(_struct, set_error))
65 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
68 _struct->set_error(_struct,
72 int CefResponseCToCpp::GetStatus() {
73 cef_response_t* _struct = GetStruct();
74 if (CEF_MEMBER_MISSING(_struct, get_status))
77 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
80 int _retval = _struct->get_status(_struct);
82 // Return type: simple
86 void CefResponseCToCpp::SetStatus(int status) {
87 cef_response_t* _struct = GetStruct();
88 if (CEF_MEMBER_MISSING(_struct, set_status))
91 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
94 _struct->set_status(_struct,
98 CefString CefResponseCToCpp::GetStatusText() {
99 cef_response_t* _struct = GetStruct();
100 if (CEF_MEMBER_MISSING(_struct, get_status_text))
103 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
106 cef_string_userfree_t _retval = _struct->get_status_text(_struct);
108 // Return type: string
109 CefString _retvalStr;
110 _retvalStr.AttachToUserFree(_retval);
114 void CefResponseCToCpp::SetStatusText(const CefString& statusText) {
115 cef_response_t* _struct = GetStruct();
116 if (CEF_MEMBER_MISSING(_struct, set_status_text))
119 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
121 // Verify param: statusText; type: string_byref_const
122 DCHECK(!statusText.empty());
123 if (statusText.empty())
127 _struct->set_status_text(_struct,
128 statusText.GetStruct());
131 CefString CefResponseCToCpp::GetMimeType() {
132 cef_response_t* _struct = GetStruct();
133 if (CEF_MEMBER_MISSING(_struct, get_mime_type))
136 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
139 cef_string_userfree_t _retval = _struct->get_mime_type(_struct);
141 // Return type: string
142 CefString _retvalStr;
143 _retvalStr.AttachToUserFree(_retval);
147 void CefResponseCToCpp::SetMimeType(const CefString& mimeType) {
148 cef_response_t* _struct = GetStruct();
149 if (CEF_MEMBER_MISSING(_struct, set_mime_type))
152 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
154 // Verify param: mimeType; type: string_byref_const
155 DCHECK(!mimeType.empty());
156 if (mimeType.empty())
160 _struct->set_mime_type(_struct,
161 mimeType.GetStruct());
164 CefString CefResponseCToCpp::GetHeader(const CefString& name) {
165 cef_response_t* _struct = GetStruct();
166 if (CEF_MEMBER_MISSING(_struct, get_header))
169 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
171 // Verify param: name; type: string_byref_const
172 DCHECK(!name.empty());
177 cef_string_userfree_t _retval = _struct->get_header(_struct,
180 // Return type: string
181 CefString _retvalStr;
182 _retvalStr.AttachToUserFree(_retval);
186 void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) {
187 cef_response_t* _struct = GetStruct();
188 if (CEF_MEMBER_MISSING(_struct, get_header_map))
191 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
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);
200 _struct->get_header_map(_struct,
203 // Restore param:headerMap; type: string_map_multi_byref
204 if (headerMapMultimap) {
206 transfer_string_multimap_contents(headerMapMultimap, headerMap);
207 cef_string_multimap_free(headerMapMultimap);
211 void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) {
212 cef_response_t* _struct = GetStruct();
213 if (CEF_MEMBER_MISSING(_struct, set_header_map))
216 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
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);
225 _struct->set_header_map(_struct,
228 // Restore param:headerMap; type: string_map_multi_byref_const
229 if (headerMapMultimap)
230 cef_string_multimap_free(headerMapMultimap);
234 // CONSTRUCTOR - Do not edit by hand.
236 CefResponseCToCpp::CefResponseCToCpp() {
239 template<> cef_response_t* CefCToCppRefCounted<CefResponseCToCpp, CefResponse,
240 cef_response_t>::UnwrapDerived(CefWrapperType type, CefResponse* c) {
241 NOTREACHED() << "Unexpected class type: " << type;
246 template<> base::AtomicRefCount CefCToCppRefCounted<CefResponseCToCpp,
247 CefResponse, cef_response_t>::DebugObjCt = 0;
250 template<> CefWrapperType CefCToCppRefCounted<CefResponseCToCpp, CefResponse,
251 cef_response_t>::kWrapperType = WT_RESPONSE;