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=027842b89846614ba6d0e3056db65004bc3a6b06$
13 //
14
15 #include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
16
17 // STATIC METHODS - Body may be edited by hand.
18
19 NO_SANITIZE("cfi-icall")
Create()20 CefRefPtr<CefPostDataElement> CefPostDataElement::Create() {
21 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
22
23 // Execute
24 cef_post_data_element_t* _retval = cef_post_data_element_create();
25
26 // Return type: refptr_same
27 return CefPostDataElementCToCpp::Wrap(_retval);
28 }
29
30 // VIRTUAL METHODS - Body may be edited by hand.
31
IsReadOnly()32 NO_SANITIZE("cfi-icall") bool CefPostDataElementCToCpp::IsReadOnly() {
33 cef_post_data_element_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
SetToEmpty()46 NO_SANITIZE("cfi-icall") void CefPostDataElementCToCpp::SetToEmpty() {
47 cef_post_data_element_t* _struct = GetStruct();
48 if (CEF_MEMBER_MISSING(_struct, set_to_empty))
49 return;
50
51 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
52
53 // Execute
54 _struct->set_to_empty(_struct);
55 }
56
57 NO_SANITIZE("cfi-icall")
SetToFile(const CefString & fileName)58 void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) {
59 cef_post_data_element_t* _struct = GetStruct();
60 if (CEF_MEMBER_MISSING(_struct, set_to_file))
61 return;
62
63 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
64
65 // Verify param: fileName; type: string_byref_const
66 DCHECK(!fileName.empty());
67 if (fileName.empty())
68 return;
69
70 // Execute
71 _struct->set_to_file(_struct, fileName.GetStruct());
72 }
73
74 NO_SANITIZE("cfi-icall")
SetToBytes(size_t size,const void * bytes)75 void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) {
76 cef_post_data_element_t* _struct = GetStruct();
77 if (CEF_MEMBER_MISSING(_struct, set_to_bytes))
78 return;
79
80 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
81
82 // Verify param: bytes; type: simple_byaddr
83 DCHECK(bytes);
84 if (!bytes)
85 return;
86
87 // Execute
88 _struct->set_to_bytes(_struct, size, bytes);
89 }
90
91 NO_SANITIZE("cfi-icall")
GetType()92 CefPostDataElement::Type CefPostDataElementCToCpp::GetType() {
93 cef_post_data_element_t* _struct = GetStruct();
94 if (CEF_MEMBER_MISSING(_struct, get_type))
95 return PDE_TYPE_EMPTY;
96
97 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
98
99 // Execute
100 cef_postdataelement_type_t _retval = _struct->get_type(_struct);
101
102 // Return type: simple
103 return _retval;
104 }
105
GetFile()106 NO_SANITIZE("cfi-icall") CefString CefPostDataElementCToCpp::GetFile() {
107 cef_post_data_element_t* _struct = GetStruct();
108 if (CEF_MEMBER_MISSING(_struct, get_file))
109 return CefString();
110
111 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
112
113 // Execute
114 cef_string_userfree_t _retval = _struct->get_file(_struct);
115
116 // Return type: string
117 CefString _retvalStr;
118 _retvalStr.AttachToUserFree(_retval);
119 return _retvalStr;
120 }
121
GetBytesCount()122 NO_SANITIZE("cfi-icall") size_t CefPostDataElementCToCpp::GetBytesCount() {
123 cef_post_data_element_t* _struct = GetStruct();
124 if (CEF_MEMBER_MISSING(_struct, get_bytes_count))
125 return 0;
126
127 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
128
129 // Execute
130 size_t _retval = _struct->get_bytes_count(_struct);
131
132 // Return type: simple
133 return _retval;
134 }
135
136 NO_SANITIZE("cfi-icall")
GetBytes(size_t size,void * bytes)137 size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) {
138 cef_post_data_element_t* _struct = GetStruct();
139 if (CEF_MEMBER_MISSING(_struct, get_bytes))
140 return 0;
141
142 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
143
144 // Verify param: bytes; type: simple_byaddr
145 DCHECK(bytes);
146 if (!bytes)
147 return 0;
148
149 // Execute
150 size_t _retval = _struct->get_bytes(_struct, size, bytes);
151
152 // Return type: simple
153 return _retval;
154 }
155
156 // CONSTRUCTOR - Do not edit by hand.
157
CefPostDataElementCToCpp()158 CefPostDataElementCToCpp::CefPostDataElementCToCpp() {}
159
160 // DESTRUCTOR - Do not edit by hand.
161
~CefPostDataElementCToCpp()162 CefPostDataElementCToCpp::~CefPostDataElementCToCpp() {}
163
164 template <>
165 cef_post_data_element_t* CefCToCppRefCounted<
166 CefPostDataElementCToCpp,
167 CefPostDataElement,
UnwrapDerived(CefWrapperType type,CefPostDataElement * c)168 cef_post_data_element_t>::UnwrapDerived(CefWrapperType type,
169 CefPostDataElement* c) {
170 NOTREACHED() << "Unexpected class type: " << type;
171 return nullptr;
172 }
173
174 template <>
175 CefWrapperType CefCToCppRefCounted<CefPostDataElementCToCpp,
176 CefPostDataElement,
177 cef_post_data_element_t>::kWrapperType =
178 WT_POST_DATA_ELEMENT;
179