mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add Date type support to CefV8Value (issue #190).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@242 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -60,6 +60,14 @@ CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateDate(const CefTime& date)
|
||||
{
|
||||
cef_v8value_t* impl = cef_v8value_create_date(&date);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateString(const CefString& value)
|
||||
{
|
||||
cef_v8value_t* impl = cef_v8value_create_string(value.GetStruct());
|
||||
@@ -163,6 +171,14 @@ bool CefV8ValueCToCpp::IsDouble()
|
||||
return struct_->is_double(struct_)?true:false;
|
||||
}
|
||||
|
||||
bool CefV8ValueCToCpp::IsDate()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, is_date))
|
||||
return false;
|
||||
|
||||
return struct_->is_date(struct_)?true:false;
|
||||
}
|
||||
|
||||
bool CefV8ValueCToCpp::IsString()
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, is_string))
|
||||
@@ -227,6 +243,14 @@ double CefV8ValueCToCpp::GetDoubleValue()
|
||||
return struct_->get_double_value(struct_);
|
||||
}
|
||||
|
||||
CefTime CefV8ValueCToCpp::GetDateValue()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_date_value))
|
||||
return CefTime();
|
||||
|
||||
return struct_->get_date_value(struct_);
|
||||
}
|
||||
|
||||
CefString CefV8ValueCToCpp::GetStringValue()
|
||||
{
|
||||
CefString str;
|
||||
|
@@ -36,6 +36,7 @@ public:
|
||||
virtual bool IsBool() OVERRIDE;
|
||||
virtual bool IsInt() OVERRIDE;
|
||||
virtual bool IsDouble() OVERRIDE;
|
||||
virtual bool IsDate() OVERRIDE;
|
||||
virtual bool IsString() OVERRIDE;
|
||||
virtual bool IsObject() OVERRIDE;
|
||||
virtual bool IsArray() OVERRIDE;
|
||||
@@ -44,6 +45,7 @@ public:
|
||||
virtual bool GetBoolValue() OVERRIDE;
|
||||
virtual int GetIntValue() OVERRIDE;
|
||||
virtual double GetDoubleValue() OVERRIDE;
|
||||
virtual CefTime GetDateValue() OVERRIDE;
|
||||
virtual CefString GetStringValue() OVERRIDE;
|
||||
virtual bool HasValue(const CefString& key) OVERRIDE;
|
||||
virtual bool HasValue(int index) OVERRIDE;
|
||||
|
Reference in New Issue
Block a user