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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user