当前位置: 首页>>代码示例>>C++>>正文


C++ Local::IsBoolean方法代码示例

本文整理汇总了C++中Local::IsBoolean方法的典型用法代码示例。如果您正苦于以下问题:C++ Local::IsBoolean方法的具体用法?C++ Local::IsBoolean怎么用?C++ Local::IsBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Local的用法示例。


在下文中一共展示了Local::IsBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: scope

static gboolean
gum_v8_exception_handler_on_exception (GumExceptionDetails * details,
                                       gpointer user_data)
{
  GumV8ExceptionHandler * handler = (GumV8ExceptionHandler *) user_data;
  GumV8Core * core = handler->core;

  ScriptScope scope (core->script);
  Isolate * isolate = core->isolate;

  Local<Function> callback (Local<Function>::New (isolate, *handler->callback));

  Local<Object> ex, context;
  _gum_v8_parse_exception_details (details, ex, context, core);

  Handle<Value> argv[] = { ex };
  Local<Value> result = callback->Call (Null (isolate), 1, argv);

  _gum_v8_cpu_context_free_later (
      new GumPersistent<Object>::type (isolate, context),
      core);

  if (!result.IsEmpty () && result->IsBoolean ())
  {
    bool handled = result.As<Boolean> ()->Value ();
    return handled ? TRUE : FALSE;
  }

  return FALSE;
}
开发者ID:terry2012,项目名称:frida-gum,代码行数:30,代码来源:gumv8process.cpp

示例2: callback

static gboolean
gum_v8_module_filter_matches (const GumModuleDetails * details,
                              GumV8ModuleFilter * self)
{
  auto core = self->module->core;
  auto isolate = core->isolate;
  auto context = isolate->GetCurrentContext ();

  auto module = _gum_v8_module_value_new (details, self->module);

  auto callback (Local<Function>::New (isolate, *self->callback));
  auto recv = Undefined (isolate);
  Handle<Value> argv[] = { module };
  Local<Value> result;
  if (callback->Call (context, recv, G_N_ELEMENTS (argv), argv)
      .ToLocal (&result))
  {
    return result->IsBoolean () && result.As<Boolean> ()->Value ();
  }
  else
  {
    core->current_scope->ProcessAnyPendingException ();
    return FALSE;
  }
}
开发者ID:frida,项目名称:frida-gum,代码行数:25,代码来源:gumv8module.cpp

示例3: if

void
encodeArray(bson_buffer *bb, const char *name, const Local<Value> element) {
    Local<Array> a = Array::Cast(*element);
    bson_buffer *arr = bson_append_start_array(bb, name);

    for (int i = 0, l=a->Length(); i < l; i++) {
        Local<Value> val = a->Get(Number::New(i));
        stringstream keybuf;
        string keyval;
        keybuf << i << endl;
        keybuf >> keyval;

        if (val->IsString()) {
            encodeString(arr, keyval.c_str(), val);
        }
        else if (val->IsInt32()) {
            encodeInteger(arr, keyval.c_str(), val);
        }
        else if (val->IsNumber()) {
            encodeNumber(arr, keyval.c_str(), val);
        }
        else if (val->IsBoolean()) {
            encodeBoolean(arr, keyval.c_str(), val);
        }
        else if (val->IsArray()) {
            encodeArray(arr, keyval.c_str(), val);
        }
        else if (val->IsObject()) {
            bson bson(encodeObject(val));
            bson_append_bson(arr, keyval.c_str(), &bson);
            bson_destroy(&bson);
        }
    }
    bson_append_finish_object(arr);
}
开发者ID:w1nk,项目名称:node-mongodb,代码行数:35,代码来源:bson.cpp

示例4: ActiveSetter

void Toggle::ActiveSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
{
    HandleScope scope;

    if (value->IsBoolean()) {
        ClutterActor *instance = ObjectWrap::Unwrap<Toggle>(info.This())->_actor;

        mx_toggle_set_active(MX_TOGGLE(instance), value->ToBoolean()->Value());
    }
}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:10,代码来源:toggle.cpp

示例5: geomIgnoredSetter

void FeatureDefn::geomIgnoredSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
{
	HandleScope scope;
	FeatureDefn *def = ObjectWrap::Unwrap<FeatureDefn>(info.This());
	if(!value->IsBoolean()){
		NODE_THROW("geomIgnored must be a boolean");
		return;
	}
	def->this_->SetGeometryIgnored(value->IntegerValue());
}
开发者ID:Mofangbao,项目名称:node-gdal,代码行数:10,代码来源:gdal_feature_defn.cpp

示例6: EnableAnimationsSetter

	void BoxLayout::EnableAnimationsSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
	{
		HandleScope scope;

		if (value->IsBoolean()) {
			ClutterActor *instance = ObjectWrap::Unwrap<BoxLayout>(info.This())->_actor;

			mx_box_layout_set_enable_animations(MX_BOX_LAYOUT(instance), value->ToBoolean()->Value());
		}
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:10,代码来源:box_layout.cpp

示例7: ignoredSetter

void FieldDefn::ignoredSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
{
	HandleScope scope;
	FieldDefn *def = ObjectWrap::Unwrap<FieldDefn>(info.This());
	if(!value->IsBoolean()){
		NODE_THROW("ignored must be a boolean");
		return;
	}
	def->this_->SetIgnored(value->BooleanValue());
}
开发者ID:jarped,项目名称:node-gdal,代码行数:10,代码来源:gdal_field_defn.cpp

示例8: DisabledSetter

	void Widget::DisabledSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
	{
		HandleScope scope;

		if (value->IsBoolean()) {
			ClutterActor *instance = ObjectWrap::Unwrap<Actor>(info.This())->_actor;

			mx_widget_set_disabled(MX_WIDGET(instance), value->ToBoolean()->Value());
		}
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:10,代码来源:widget.cpp

示例9: ScrollToFocusedSetter

	void BoxLayout::ScrollToFocusedSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
	{
		HandleScope scope;

		if (value->IsBoolean()) {
			ClutterActor *instance = ObjectWrap::Unwrap<BoxLayout>(info.This())->_actor;

			mx_box_layout_set_scroll_to_focused(MX_BOX_LAYOUT(instance), value->ToBoolean()->Value());
		}
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:10,代码来源:box_layout.cpp

示例10: RepeatYSetter

	void Texture::RepeatYSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
	{
		HandleScope scope;

		if (value->IsBoolean()) {
			ClutterActor *instance = ObjectWrap::Unwrap<Actor>(info.This())->_actor;

			g_object_set(G_OBJECT(instance), "repeat-y", value->ToBoolean()->Value(), NULL);
		}
	}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:10,代码来源:texture.cpp

示例11: build_http_msg_buffer

void Msg_Struct::build_http_msg_buffer(Isolate* isolate, v8::Local<v8::Object> object, std::string &str) {
    std::stringstream stream;
    for(std::vector<Field_Info>::const_iterator iter = field_vec().begin();
            iter != field_vec().end(); iter++) {
        stream.str("");
        stream << "\"" << iter->field_name << "\":";
        Local<Value> value = object->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, iter->field_name.c_str(), NewStringType::kNormal).ToLocalChecked()).ToLocalChecked();
        if(iter->field_type == "int8" || iter->field_type == "int16" ||
                iter->field_type == "int32") {
            int32_t val = 0;
            if (value->IsInt32()) {
                val = value->Int32Value(isolate->GetCurrentContext()).FromJust();
            }
            stream << val << ",";
        }
        else if(iter->field_type == "int64") {
            int64_t val = 0;
            if (value->IsNumber()) {
                val = value->NumberValue(isolate->GetCurrentContext()).FromJust();
            }
            stream << val << ",";
        }
        else if(iter->field_type == "double") {
            double val = 0;
            if (value->IsNumber()) {
                val = value->NumberValue(isolate->GetCurrentContext()).FromJust();
            }
            stream << val << ",";
        }
        else if(iter->field_type == "bool") {
            bool val = 0;
            if (value->IsBoolean()) {
                val = value->BooleanValue(isolate->GetCurrentContext()).FromJust();
            }
            stream << val << ",";
        }
        else if(iter->field_type == "string") {
            if (value->IsString()) {
                String::Utf8Value str(value->ToString(isolate->GetCurrentContext()).ToLocalChecked());
                stream << "\"" << ToCString(str) << "\",";
            } else {
                stream << "\"\",";
            }
        }
        else {
            LOG_ERROR("Can not find the field_type:%s, struct_name:%s", iter->field_type.c_str(), struct_name().c_str());
        }

        str += stream.str();
    }
}
开发者ID:jice1001,项目名称:server,代码行数:51,代码来源:Msg_Struct.cpp

示例12: Set_FontState_strikeOut

static void Set_FontState_strikeOut(Local<String> property, Local<Value> value, const AccessorInfo& info) 
{
	HandleScope scope;
	
	Local<Object> self = info.Holder();
	Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
	if (wrap.IsEmpty())
		return;

	FontState *tmp = (FontState *) wrap->Value();
	if (tmp == NULL)
		return;

	if (!value.IsEmpty() && value->IsBoolean())
		tmp->setStrikeOut(value->BooleanValue());
}
开发者ID:Robyer,项目名称:miranda-plugins,代码行数:16,代码来源:FontState_v8_wrapper.cpp

示例13: execute

bool JSWrapper::execute( const char *scr, JSWrapperData *data, const char *fileName )
{
    HandleScope handle_scope( m_isolate );

    Local<String> source = String::NewFromUtf8( m_isolate, scr, NewStringType::kNormal ).ToLocalChecked();

    ScriptOrigin origin( v8::String::NewFromUtf8( m_isolate, fileName ? fileName : "Unknown" ) );
    MaybeLocal<Script> maybeScript = Script::Compile( m_context, source, &origin );

    bool success=false;

    if ( !maybeScript.IsEmpty() )
    {
        Local<Script> script = maybeScript.ToLocalChecked();        
        MaybeLocal<Value> maybeResult = script->Run(m_context);

        if ( !maybeResult.IsEmpty() )
        {
            Local<Value> result = maybeResult.ToLocalChecked();

            if ( data )
            {
                if ( result->IsNumber() )
                    data->setNumber( result->ToNumber()->Value() );
                else
                if ( result->IsString() )
                {
                    String::Utf8Value utf8( result );
                    data->setString( *utf8 );
                } else
                if ( result->IsBoolean() )
                    data->setBoolean( result->ToBoolean()->Value() );
                else                
                if ( result->IsObject() )
                    data->setObject( new JSWrapperObject( m_isolate, result->ToObject() ) );
                else
                if ( result->IsNull() )
                    data->setNull();
                else data->setUndefined();
            }

            success=true;
        } 
    }

    return success;
}
开发者ID:markusmoenig,项目名称:jsenginewrapper,代码行数:47,代码来源:jswrapper_v8.cpp

示例14: getGetdnsType

static GetdnsType getGetdnsType(Local<Value> value) {
    if (value->IsNumber() || value->IsNumberObject()) {
        return IntType;
    } else if (value->IsBoolean() || value->IsBooleanObject()) {
        return BoolType;
    } else if (value->IsString() || value->IsStringObject()) {
        return StringType;
    } else if (value->IsObject()) {
        // could be a node buffer or array
        if (node::Buffer::HasInstance(value)) {
            return BinDataType;
        } else if (value->IsArray()) {
            return ListType;
        } else if (GNUtil::isDictionaryObject(value)) {
            return DictType;
        }
    }
    return UnknownType;
}
开发者ID:joelpurra,项目名称:getdns-node,代码行数:19,代码来源:GNUtil.cpp

示例15: PolicyVerticalSetter

void ScrollView::PolicyVerticalSetter(Local<String> name, Local<Value> value, const AccessorInfo& info)
{
    HandleScope scope;
    MxScrollPolicy policy;

    if (value->IsBoolean()) {
        ClutterActor *instance = ObjectWrap::Unwrap<ScrollView>(info.This())->_actor;

        policy = mx_scroll_view_get_scroll_policy(MX_SCROLL_VIEW(instance));
        if (value->ToBoolean()->Value()) {
            if (policy == MX_SCROLL_POLICY_HORIZONTAL)
                mx_scroll_view_set_scroll_policy(MX_SCROLL_VIEW(instance), MX_SCROLL_POLICY_BOTH);
            else if (policy == MX_SCROLL_POLICY_NONE)
                mx_scroll_view_set_scroll_policy(MX_SCROLL_VIEW(instance), MX_SCROLL_POLICY_VERTICAL);
        } else {
            if (policy == MX_SCROLL_POLICY_VERTICAL)
                mx_scroll_view_set_scroll_policy(MX_SCROLL_VIEW(instance), MX_SCROLL_POLICY_NONE);
            else if (policy == MX_SCROLL_POLICY_BOTH)
                mx_scroll_view_set_scroll_policy(MX_SCROLL_VIEW(instance), MX_SCROLL_POLICY_HORIZONTAL);
        }
    }
}
开发者ID:cfsghost,项目名称:jsdx-toolkit,代码行数:22,代码来源:scrollview.cpp


注:本文中的Local::IsBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。