- 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:
Marshall Greenblatt
2015-04-15 15:45:30 +02:00
parent 740ad72f90
commit 0369063810
23 changed files with 3281 additions and 185 deletions

View File

@@ -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;