2017-01-11 00:00:30 +01:00
|
|
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2014-01-14 03:45:56 +01:00
|
|
|
#include <algorithm>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// STATIC METHODS - Body may be edited by hand.
|
|
|
|
|
2012-06-19 18:29:49 +02:00
|
|
|
CefRefPtr<CefPostData> CefPostData::Create() {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_post_data_t* _retval = cef_post_data_create();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefPostDataCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2012-06-19 18:29:49 +02:00
|
|
|
bool CefPostDataCToCpp::IsReadOnly() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, is_read_only))
|
2012-06-19 18:29:49 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->is_read_only(_struct);
|
2012-06-19 18:29:49 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
2015-12-01 19:22:28 +01:00
|
|
|
bool CefPostDataCToCpp::HasExcludedElements() {
|
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, has_excluded_elements))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->has_excluded_elements(_struct);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
size_t CefPostDataCToCpp::GetElementCount() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_element_count))
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
size_t _retval = _struct->get_element_count(_struct);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefPostDataCToCpp::GetElements(ElementVector& elements) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_elements))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Translate param: elements; type: refptr_vec_same_byref
|
|
|
|
size_t elementsSize = elements.size();
|
|
|
|
size_t elementsCount = std::max(GetElementCount(), elementsSize);
|
|
|
|
cef_post_data_element_t** elementsList = NULL;
|
|
|
|
if (elementsCount > 0) {
|
|
|
|
elementsList = new cef_post_data_element_t*[elementsCount];
|
|
|
|
DCHECK(elementsList);
|
|
|
|
if (elementsList) {
|
|
|
|
memset(elementsList, 0, sizeof(cef_post_data_element_t*)*elementsCount);
|
|
|
|
}
|
|
|
|
if (elementsList && elementsSize > 0) {
|
|
|
|
for (size_t i = 0; i < elementsSize; ++i) {
|
|
|
|
elementsList[i] = CefPostDataElementCToCpp::Unwrap(elements[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
_struct->get_elements(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
&elementsCount,
|
|
|
|
elementsList);
|
|
|
|
|
|
|
|
// Restore param:elements; type: refptr_vec_same_byref
|
|
|
|
elements.clear();
|
|
|
|
if (elementsCount > 0 && elementsList) {
|
|
|
|
for (size_t i = 0; i < elementsCount; ++i) {
|
|
|
|
elements.push_back(CefPostDataElementCToCpp::Wrap(elementsList[i]));
|
|
|
|
}
|
|
|
|
delete [] elementsList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefPostDataCToCpp::RemoveElement(CefRefPtr<CefPostDataElement> element) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, remove_element))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: element; type: refptr_same
|
|
|
|
DCHECK(element.get());
|
|
|
|
if (!element.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->remove_element(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefPostDataElementCToCpp::Unwrap(element));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefPostDataCToCpp::AddElement(CefRefPtr<CefPostDataElement> element) {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, add_element))
|
2012-04-03 03:34:16 +02:00
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: element; type: refptr_same
|
|
|
|
DCHECK(element.get());
|
|
|
|
if (!element.get())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
int _retval = _struct->add_element(_struct,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefPostDataElementCToCpp::Unwrap(element));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefPostDataCToCpp::RemoveElements() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, remove_elements))
|
2012-04-03 03:34:16 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
_struct->remove_elements(_struct);
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPostDataCToCpp::CefPostDataCToCpp() {
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:07:43 +01:00
|
|
|
template<> cef_post_data_t* CefCToCppRefCounted<CefPostDataCToCpp, CefPostData,
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t>::UnwrapDerived(CefWrapperType type, CefPostData* c) {
|
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-02-09 23:07:43 +01:00
|
|
|
template<> base::AtomicRefCount CefCToCppRefCounted<CefPostDataCToCpp,
|
|
|
|
CefPostData, cef_post_data_t>::DebugObjCt = 0;
|
2012-04-03 03:34:16 +02:00
|
|
|
#endif
|
|
|
|
|
2017-02-09 23:07:43 +01:00
|
|
|
template<> CefWrapperType CefCToCppRefCounted<CefPostDataCToCpp, CefPostData,
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_post_data_t>::kWrapperType = WT_POST_DATA;
|