本文整理汇总了C++中CJS_PropValue::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ CJS_PropValue::GetType方法的具体用法?C++ CJS_PropValue::GetType怎么用?C++ CJS_PropValue::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJS_PropValue
的用法示例。
在下文中一共展示了CJS_PropValue::GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoProperty
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
switch (vp.GetType())
{
case VT_number:
{
double dData;
vp >> dData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_boolean:
{
bool bData;
vp >> bData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE);
}
case VT_object:
{
JSObject pData = (JSObject)vp;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
// else
// {
// if (vp.IsArrayObject())
// {
// CJS_Array array;
// vp.ConvertToArray(array);
// return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "",
// (Dobject*)(Darray*)array, FALSE);
// }
// else
// return FALSE;
// }
}
case VT_null:
{
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
return TRUE;
}
default:
return FALSE;
}
}
示例2: DoProperty
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError)
{
if (vp.IsSetting())
{
CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname);
switch (vp.GetType())
{
case VT_number:
{
double dData;
vp >> dData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_boolean:
{
bool bData;
vp >> bData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE);
}
case VT_string:
{
CFX_ByteString sData;
vp >> sData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE);
}
case VT_object:
{
JSObject pData;
vp >> pData;
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE);
}
case VT_null:
{
return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE);
}
case VT_undefined:
{
DelProperty(cc, propname, sError);
return TRUE;
}
default:
return FALSE;
}
}