mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add CefValue for wrapping various value types in a single object (issue #1607).
- Add IsSame() and IsEqual() methods for comparing CefValue* types. - Improve CefValue* documentation.
This commit is contained in:
@@ -62,6 +62,44 @@ bool CefBinaryValueCToCpp::IsOwned() {
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefBinaryValueCToCpp::IsSame(CefRefPtr<CefBinaryValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_same))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_same(struct_,
|
||||
CefBinaryValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefBinaryValueCToCpp::IsEqual(CefRefPtr<CefBinaryValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_equal))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_equal(struct_,
|
||||
CefBinaryValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBinaryValue> CefBinaryValueCToCpp::Copy() {
|
||||
if (CEF_MEMBER_MISSING(struct_, copy))
|
||||
return NULL;
|
||||
|
@@ -35,6 +35,8 @@ class CefBinaryValueCToCpp
|
||||
// CefBinaryValue methods
|
||||
virtual bool IsValid() OVERRIDE;
|
||||
virtual bool IsOwned() OVERRIDE;
|
||||
virtual bool IsSame(CefRefPtr<CefBinaryValue> that) OVERRIDE;
|
||||
virtual bool IsEqual(CefRefPtr<CefBinaryValue> that) OVERRIDE;
|
||||
virtual CefRefPtr<CefBinaryValue> Copy() OVERRIDE;
|
||||
virtual size_t GetSize() OVERRIDE;
|
||||
virtual size_t GetData(void* buffer, size_t buffer_size,
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
@@ -70,6 +71,44 @@ bool CefDictionaryValueCToCpp::IsReadOnly() {
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefDictionaryValueCToCpp::IsSame(CefRefPtr<CefDictionaryValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_same))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_same(struct_,
|
||||
CefDictionaryValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr<CefDictionaryValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_equal))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_equal(struct_,
|
||||
CefDictionaryValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefDictionaryValue> CefDictionaryValueCToCpp::Copy(
|
||||
bool exclude_empty_children) {
|
||||
if (CEF_MEMBER_MISSING(struct_, copy))
|
||||
@@ -195,6 +234,25 @@ CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefValue> CefDictionaryValueCToCpp::GetValue(const CefString& key) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_value))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: key; type: string_byref_const
|
||||
DCHECK(!key.empty());
|
||||
if (key.empty())
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = struct_->get_value(struct_,
|
||||
key.GetStruct());
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
bool CefDictionaryValueCToCpp::GetBool(const CefString& key) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_bool))
|
||||
return false;
|
||||
@@ -333,6 +391,31 @@ CefRefPtr<CefListValue> CefDictionaryValueCToCpp::GetList(
|
||||
return CefListValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
bool CefDictionaryValueCToCpp::SetValue(const CefString& key,
|
||||
CefRefPtr<CefValue> value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_value))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: key; type: string_byref_const
|
||||
DCHECK(!key.empty());
|
||||
if (key.empty())
|
||||
return false;
|
||||
// Verify param: value; type: refptr_same
|
||||
DCHECK(value.get());
|
||||
if (!value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_value(struct_,
|
||||
key.GetStruct(),
|
||||
CefValueCToCpp::Unwrap(value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefDictionaryValueCToCpp::SetNull(const CefString& key) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_null))
|
||||
return false;
|
||||
|
@@ -36,6 +36,8 @@ class CefDictionaryValueCToCpp
|
||||
virtual bool IsValid() OVERRIDE;
|
||||
virtual bool IsOwned() OVERRIDE;
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual bool IsSame(CefRefPtr<CefDictionaryValue> that) OVERRIDE;
|
||||
virtual bool IsEqual(CefRefPtr<CefDictionaryValue> that) OVERRIDE;
|
||||
virtual CefRefPtr<CefDictionaryValue> Copy(
|
||||
bool exclude_empty_children) OVERRIDE;
|
||||
virtual size_t GetSize() OVERRIDE;
|
||||
@@ -44,6 +46,7 @@ class CefDictionaryValueCToCpp
|
||||
virtual bool GetKeys(KeyList& keys) OVERRIDE;
|
||||
virtual bool Remove(const CefString& key) OVERRIDE;
|
||||
virtual CefValueType GetType(const CefString& key) OVERRIDE;
|
||||
virtual CefRefPtr<CefValue> GetValue(const CefString& key) OVERRIDE;
|
||||
virtual bool GetBool(const CefString& key) OVERRIDE;
|
||||
virtual int GetInt(const CefString& key) OVERRIDE;
|
||||
virtual double GetDouble(const CefString& key) OVERRIDE;
|
||||
@@ -52,6 +55,8 @@ class CefDictionaryValueCToCpp
|
||||
virtual CefRefPtr<CefDictionaryValue> GetDictionary(
|
||||
const CefString& key) OVERRIDE;
|
||||
virtual CefRefPtr<CefListValue> GetList(const CefString& key) OVERRIDE;
|
||||
virtual bool SetValue(const CefString& key,
|
||||
CefRefPtr<CefValue> value) OVERRIDE;
|
||||
virtual bool SetNull(const CefString& key) OVERRIDE;
|
||||
virtual bool SetBool(const CefString& key, bool value) OVERRIDE;
|
||||
virtual bool SetInt(const CefString& key, int value) OVERRIDE;
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
@@ -69,6 +70,44 @@ bool CefListValueCToCpp::IsReadOnly() {
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefListValueCToCpp::IsSame(CefRefPtr<CefListValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_same))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_same(struct_,
|
||||
CefListValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefListValueCToCpp::IsEqual(CefRefPtr<CefListValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_equal))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_equal(struct_,
|
||||
CefListValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefListValue> CefListValueCToCpp::Copy() {
|
||||
if (CEF_MEMBER_MISSING(struct_, copy))
|
||||
return NULL;
|
||||
@@ -160,6 +199,25 @@ CefValueType CefListValueCToCpp::GetType(int index) {
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefRefPtr<CefValue> CefListValueCToCpp::GetValue(int index) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_value))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: index; type: simple_byval
|
||||
DCHECK_GE(index, 0);
|
||||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = struct_->get_value(struct_,
|
||||
index);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
bool CefListValueCToCpp::GetBool(int index) {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_bool))
|
||||
return false;
|
||||
@@ -295,6 +353,30 @@ CefRefPtr<CefListValue> CefListValueCToCpp::GetList(int index) {
|
||||
return CefListValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
bool CefListValueCToCpp::SetValue(int index, CefRefPtr<CefValue> value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_value))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: index; type: simple_byval
|
||||
DCHECK_GE(index, 0);
|
||||
if (index < 0)
|
||||
return false;
|
||||
// Verify param: value; type: refptr_same
|
||||
DCHECK(value.get());
|
||||
if (!value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_value(struct_,
|
||||
index,
|
||||
CefValueCToCpp::Unwrap(value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefListValueCToCpp::SetNull(int index) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_null))
|
||||
return false;
|
||||
|
@@ -34,12 +34,15 @@ class CefListValueCToCpp
|
||||
virtual bool IsValid() OVERRIDE;
|
||||
virtual bool IsOwned() OVERRIDE;
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual bool IsSame(CefRefPtr<CefListValue> that) OVERRIDE;
|
||||
virtual bool IsEqual(CefRefPtr<CefListValue> that) OVERRIDE;
|
||||
virtual CefRefPtr<CefListValue> Copy() OVERRIDE;
|
||||
virtual bool SetSize(size_t size) OVERRIDE;
|
||||
virtual size_t GetSize() OVERRIDE;
|
||||
virtual bool Clear() OVERRIDE;
|
||||
virtual bool Remove(int index) OVERRIDE;
|
||||
virtual CefValueType GetType(int index) OVERRIDE;
|
||||
virtual CefRefPtr<CefValue> GetValue(int index) OVERRIDE;
|
||||
virtual bool GetBool(int index) OVERRIDE;
|
||||
virtual int GetInt(int index) OVERRIDE;
|
||||
virtual double GetDouble(int index) OVERRIDE;
|
||||
@@ -47,6 +50,7 @@ class CefListValueCToCpp
|
||||
virtual CefRefPtr<CefBinaryValue> GetBinary(int index) OVERRIDE;
|
||||
virtual CefRefPtr<CefDictionaryValue> GetDictionary(int index) OVERRIDE;
|
||||
virtual CefRefPtr<CefListValue> GetList(int index) OVERRIDE;
|
||||
virtual bool SetValue(int index, CefRefPtr<CefValue> value) OVERRIDE;
|
||||
virtual bool SetNull(int index) OVERRIDE;
|
||||
virtual bool SetBool(int index, bool value) OVERRIDE;
|
||||
virtual bool SetInt(int index, int value) OVERRIDE;
|
||||
|
363
libcef_dll/ctocpp/value_ctocpp.cc
Normal file
363
libcef_dll/ctocpp/value_ctocpp.cc
Normal file
@@ -0,0 +1,363 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
|
||||
CefRefPtr<CefValue> CefValue::Create() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = cef_value_create();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
bool CefValueCToCpp::IsValid() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_valid))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_valid(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::IsOwned() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_owned))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_owned(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::IsReadOnly() {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_read_only))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_read_only(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::IsSame(CefRefPtr<CefValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_same))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_same(struct_,
|
||||
CefValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::IsEqual(CefRefPtr<CefValue> that) {
|
||||
if (CEF_MEMBER_MISSING(struct_, is_equal))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: that; type: refptr_same
|
||||
DCHECK(that.get());
|
||||
if (!that.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->is_equal(struct_,
|
||||
CefValueCToCpp::Unwrap(that));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefValue> CefValueCToCpp::Copy() {
|
||||
if (CEF_MEMBER_MISSING(struct_, copy))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_value_t* _retval = struct_->copy(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefValueType CefValueCToCpp::GetType() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_type))
|
||||
return VTYPE_INVALID;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_value_type_t _retval = struct_->get_type(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::GetBool() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_bool))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->get_bool(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
int CefValueCToCpp::GetInt() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_int))
|
||||
return 0;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->get_int(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
double CefValueCToCpp::GetDouble() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_double))
|
||||
return 0;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
double _retval = struct_->get_double(struct_);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
CefString CefValueCToCpp::GetString() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_string))
|
||||
return CefString();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_string_userfree_t _retval = struct_->get_string(struct_);
|
||||
|
||||
// Return type: string
|
||||
CefString _retvalStr;
|
||||
_retvalStr.AttachToUserFree(_retval);
|
||||
return _retvalStr;
|
||||
}
|
||||
|
||||
CefRefPtr<CefBinaryValue> CefValueCToCpp::GetBinary() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_binary))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_binary_value_t* _retval = struct_->get_binary(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefBinaryValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefDictionaryValue> CefValueCToCpp::GetDictionary() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_dictionary))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefDictionaryValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
CefRefPtr<CefListValue> CefValueCToCpp::GetList() {
|
||||
if (CEF_MEMBER_MISSING(struct_, get_list))
|
||||
return NULL;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
cef_list_value_t* _retval = struct_->get_list(struct_);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefListValueCToCpp::Wrap(_retval);
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetNull() {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_null))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_null(struct_);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetBool(bool value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_bool))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_bool(struct_,
|
||||
value);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetInt(int value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_int))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_int(struct_,
|
||||
value);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetDouble(double value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_double))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_double(struct_,
|
||||
value);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetString(const CefString& value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_string))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: value
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_string(struct_,
|
||||
value.GetStruct());
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetBinary(CefRefPtr<CefBinaryValue> value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_binary))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: value; type: refptr_same
|
||||
DCHECK(value.get());
|
||||
if (!value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_binary(struct_,
|
||||
CefBinaryValueCToCpp::Unwrap(value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetDictionary(CefRefPtr<CefDictionaryValue> value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_dictionary))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: value; type: refptr_same
|
||||
DCHECK(value.get());
|
||||
if (!value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_dictionary(struct_,
|
||||
CefDictionaryValueCToCpp::Unwrap(value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
bool CefValueCToCpp::SetList(CefRefPtr<CefListValue> value) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_list))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: value; type: refptr_same
|
||||
DCHECK(value.get());
|
||||
if (!value.get())
|
||||
return false;
|
||||
|
||||
// Execute
|
||||
int _retval = struct_->set_list(struct_,
|
||||
CefListValueCToCpp::Unwrap(value));
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCToCpp<CefValueCToCpp, CefValue,
|
||||
cef_value_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
60
libcef_dll/ctocpp/value_ctocpp.h
Normal file
60
libcef_dll/ctocpp/value_ctocpp.h
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_
|
||||
#define CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_values.h"
|
||||
#include "include/capi/cef_values_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
|
||||
// Wrap a C structure with a C++ class.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefValueCToCpp
|
||||
: public CefCToCpp<CefValueCToCpp, CefValue, cef_value_t> {
|
||||
public:
|
||||
explicit CefValueCToCpp(cef_value_t* str)
|
||||
: CefCToCpp<CefValueCToCpp, CefValue, cef_value_t>(str) {}
|
||||
|
||||
// CefValue methods
|
||||
virtual bool IsValid() OVERRIDE;
|
||||
virtual bool IsOwned() OVERRIDE;
|
||||
virtual bool IsReadOnly() OVERRIDE;
|
||||
virtual bool IsSame(CefRefPtr<CefValue> that) OVERRIDE;
|
||||
virtual bool IsEqual(CefRefPtr<CefValue> that) OVERRIDE;
|
||||
virtual CefRefPtr<CefValue> Copy() OVERRIDE;
|
||||
virtual CefValueType GetType() OVERRIDE;
|
||||
virtual bool GetBool() OVERRIDE;
|
||||
virtual int GetInt() OVERRIDE;
|
||||
virtual double GetDouble() OVERRIDE;
|
||||
virtual CefString GetString() OVERRIDE;
|
||||
virtual CefRefPtr<CefBinaryValue> GetBinary() OVERRIDE;
|
||||
virtual CefRefPtr<CefDictionaryValue> GetDictionary() OVERRIDE;
|
||||
virtual CefRefPtr<CefListValue> GetList() OVERRIDE;
|
||||
virtual bool SetNull() OVERRIDE;
|
||||
virtual bool SetBool(bool value) OVERRIDE;
|
||||
virtual bool SetInt(int value) OVERRIDE;
|
||||
virtual bool SetDouble(double value) OVERRIDE;
|
||||
virtual bool SetString(const CefString& value) OVERRIDE;
|
||||
virtual bool SetBinary(CefRefPtr<CefBinaryValue> value) OVERRIDE;
|
||||
virtual bool SetDictionary(CefRefPtr<CefDictionaryValue> value) OVERRIDE;
|
||||
virtual bool SetList(CefRefPtr<CefListValue> value) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_
|
||||
|
Reference in New Issue
Block a user