2013-01-17 19:39:09 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2010-10-03 23:04:50 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
2011-12-08 02:38:30 +01:00
|
|
|
// 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.
|
2010-10-03 23:04:50 +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-01-10 00:46:23 +01:00
|
|
|
CefRefPtr<CefPostData> CefPostData::CreatePostData() {
|
2011-12-08 02:38:30 +01: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);
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
size_t CefPostDataCToCpp::GetElementCount() {
|
2011-12-08 02:38:30 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, get_element_count))
|
2010-10-03 23:04:50 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = struct_->get_element_count(struct_);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
void CefPostDataCToCpp::GetElements(ElementVector& elements) {
|
2011-12-08 02:38:30 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, get_elements))
|
2010-10-03 23:04:50 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// 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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-10-03 23:04:50 +02:00
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
struct_->get_elements(struct_,
|
|
|
|
&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;
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
bool CefPostDataCToCpp::RemoveElement(CefRefPtr<CefPostDataElement> element) {
|
2011-12-08 02:38:30 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, remove_element))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: element; type: refptr_same
|
2010-10-03 23:04:50 +02:00
|
|
|
DCHECK(element.get());
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!element.get())
|
2010-10-03 23:04:50 +02:00
|
|
|
return false;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
int _retval = struct_->remove_element(struct_,
|
|
|
|
CefPostDataElementCToCpp::Unwrap(element));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
bool CefPostDataCToCpp::AddElement(CefRefPtr<CefPostDataElement> element) {
|
2011-12-08 02:38:30 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, add_element))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: element; type: refptr_same
|
2010-10-03 23:04:50 +02:00
|
|
|
DCHECK(element.get());
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!element.get())
|
2010-10-03 23:04:50 +02:00
|
|
|
return false;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Execute
|
|
|
|
int _retval = struct_->add_element(struct_,
|
|
|
|
CefPostDataElementCToCpp::Unwrap(element));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
void CefPostDataCToCpp::RemoveElements() {
|
2011-12-08 02:38:30 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, remove_elements))
|
2010-10-03 23:04:50 +02:00
|
|
|
return;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->remove_elements(struct_);
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2010-12-07 02:30:26 +01:00
|
|
|
template<> long CefCToCpp<CefPostDataCToCpp, CefPostData,
|
|
|
|
cef_post_data_t>::DebugObjCt = 0;
|
2010-10-03 23:04:50 +02:00
|
|
|
#endif
|
|
|
|
|