1 // Copyright (c) 2022 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 // $hash=6148547c3504062984362b43db9e95ee68ef1358$
13 //
14
15 #include "libcef_dll/cpptoc/post_data_element_cpptoc.h"
16
17 // GLOBAL FUNCTIONS - Body may be edited by hand.
18
cef_post_data_element_create()19 CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() {
20 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
21
22 // Execute
23 CefRefPtr<CefPostDataElement> _retval = CefPostDataElement::Create();
24
25 // Return type: refptr_same
26 return CefPostDataElementCppToC::Wrap(_retval);
27 }
28
29 namespace {
30
31 // MEMBER FUNCTIONS - Body may be edited by hand.
32
33 int CEF_CALLBACK
post_data_element_is_read_only(struct _cef_post_data_element_t * self)34 post_data_element_is_read_only(struct _cef_post_data_element_t* self) {
35 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
36
37 DCHECK(self);
38 if (!self)
39 return 0;
40
41 // Execute
42 bool _retval = CefPostDataElementCppToC::Get(self)->IsReadOnly();
43
44 // Return type: bool
45 return _retval;
46 }
47
48 void CEF_CALLBACK
post_data_element_set_to_empty(struct _cef_post_data_element_t * self)49 post_data_element_set_to_empty(struct _cef_post_data_element_t* self) {
50 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
51
52 DCHECK(self);
53 if (!self)
54 return;
55
56 // Execute
57 CefPostDataElementCppToC::Get(self)->SetToEmpty();
58 }
59
60 void CEF_CALLBACK
post_data_element_set_to_file(struct _cef_post_data_element_t * self,const cef_string_t * fileName)61 post_data_element_set_to_file(struct _cef_post_data_element_t* self,
62 const cef_string_t* fileName) {
63 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
64
65 DCHECK(self);
66 if (!self)
67 return;
68 // Verify param: fileName; type: string_byref_const
69 DCHECK(fileName);
70 if (!fileName)
71 return;
72
73 // Execute
74 CefPostDataElementCppToC::Get(self)->SetToFile(CefString(fileName));
75 }
76
77 void CEF_CALLBACK
post_data_element_set_to_bytes(struct _cef_post_data_element_t * self,size_t size,const void * bytes)78 post_data_element_set_to_bytes(struct _cef_post_data_element_t* self,
79 size_t size,
80 const void* bytes) {
81 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
82
83 DCHECK(self);
84 if (!self)
85 return;
86 // Verify param: bytes; type: simple_byaddr
87 DCHECK(bytes);
88 if (!bytes)
89 return;
90
91 // Execute
92 CefPostDataElementCppToC::Get(self)->SetToBytes(size, bytes);
93 }
94
95 cef_postdataelement_type_t CEF_CALLBACK
post_data_element_get_type(struct _cef_post_data_element_t * self)96 post_data_element_get_type(struct _cef_post_data_element_t* self) {
97 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
98
99 DCHECK(self);
100 if (!self)
101 return PDE_TYPE_EMPTY;
102
103 // Execute
104 cef_postdataelement_type_t _retval =
105 CefPostDataElementCppToC::Get(self)->GetType();
106
107 // Return type: simple
108 return _retval;
109 }
110
111 cef_string_userfree_t CEF_CALLBACK
post_data_element_get_file(struct _cef_post_data_element_t * self)112 post_data_element_get_file(struct _cef_post_data_element_t* self) {
113 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
114
115 DCHECK(self);
116 if (!self)
117 return NULL;
118
119 // Execute
120 CefString _retval = CefPostDataElementCppToC::Get(self)->GetFile();
121
122 // Return type: string
123 return _retval.DetachToUserFree();
124 }
125
126 size_t CEF_CALLBACK
post_data_element_get_bytes_count(struct _cef_post_data_element_t * self)127 post_data_element_get_bytes_count(struct _cef_post_data_element_t* self) {
128 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
129
130 DCHECK(self);
131 if (!self)
132 return 0;
133
134 // Execute
135 size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytesCount();
136
137 // Return type: simple
138 return _retval;
139 }
140
141 size_t CEF_CALLBACK
post_data_element_get_bytes(struct _cef_post_data_element_t * self,size_t size,void * bytes)142 post_data_element_get_bytes(struct _cef_post_data_element_t* self,
143 size_t size,
144 void* bytes) {
145 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
146
147 DCHECK(self);
148 if (!self)
149 return 0;
150 // Verify param: bytes; type: simple_byaddr
151 DCHECK(bytes);
152 if (!bytes)
153 return 0;
154
155 // Execute
156 size_t _retval = CefPostDataElementCppToC::Get(self)->GetBytes(size, bytes);
157
158 // Return type: simple
159 return _retval;
160 }
161
162 } // namespace
163
164 // CONSTRUCTOR - Do not edit by hand.
165
CefPostDataElementCppToC()166 CefPostDataElementCppToC::CefPostDataElementCppToC() {
167 GetStruct()->is_read_only = post_data_element_is_read_only;
168 GetStruct()->set_to_empty = post_data_element_set_to_empty;
169 GetStruct()->set_to_file = post_data_element_set_to_file;
170 GetStruct()->set_to_bytes = post_data_element_set_to_bytes;
171 GetStruct()->get_type = post_data_element_get_type;
172 GetStruct()->get_file = post_data_element_get_file;
173 GetStruct()->get_bytes_count = post_data_element_get_bytes_count;
174 GetStruct()->get_bytes = post_data_element_get_bytes;
175 }
176
177 // DESTRUCTOR - Do not edit by hand.
178
~CefPostDataElementCppToC()179 CefPostDataElementCppToC::~CefPostDataElementCppToC() {}
180
181 template <>
182 CefRefPtr<CefPostDataElement> CefCppToCRefCounted<
183 CefPostDataElementCppToC,
184 CefPostDataElement,
UnwrapDerived(CefWrapperType type,cef_post_data_element_t * s)185 cef_post_data_element_t>::UnwrapDerived(CefWrapperType type,
186 cef_post_data_element_t* s) {
187 NOTREACHED() << "Unexpected class type: " << type;
188 return nullptr;
189 }
190
191 template <>
192 CefWrapperType CefCppToCRefCounted<CefPostDataElementCppToC,
193 CefPostDataElement,
194 cef_post_data_element_t>::kWrapperType =
195 WT_POST_DATA_ELEMENT;
196