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


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

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


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

示例1: getView

Ti::TiValue Ti::TiViewProxy::remove(Ti::TiValue value)
{
	Ti::TiValue val;
	val.setUndefined();

	Ti::TiViewProxy *childProxy = static_cast<Ti::TiViewProxy*>(value.toProxy());
	if(!_childViewsProxies.contains(childProxy)) return val;

	Ti::TiView* childView = childProxy->getView();
	Ti::TiView* thisView = getView();
	childProxy->makeWeak();
	thisView->remove(childView);
	_childViewsProxies.removeOne(childProxy);

	childProxy->_parentProxy = NULL;
    Local<Value> children = _jsObject->Get(String::New("children"));
    if(!children.IsEmpty() && !children->IsUndefined())
    {
    	Local<Array> array = Local<Array>::Cast(children);
    	for(int i = 0, len = array->Length(); i < len; i++) {
    		if(array->Get(i) == value.toJSValue())
    		{
    	    	array->Delete(i);
    	    	break;
    		}
    	}
    }

	return val;
}
开发者ID:Buder,项目名称:titanium_mobile_blackberry,代码行数:30,代码来源:Ti_ViewProxy.cpp

示例2: handle_scope

tjs_error
TJSInstance::remove(Isolate *isolate, Local<Object> &obj, const tjs_char *membername)
{
	if (!membername) {
		return TJS_E_NOTIMPL;
	}

	HandleScope handle_scope(isolate);
	Context::Scope context_scope(getContext());
	TryCatch try_catch;
	return obj->Delete(String::NewFromTwoByte(isolate, membername)) ? TJS_S_OK : TJS_S_FALSE;
}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:12,代码来源:tjsinstance.cpp

示例3: imp

static gboolean
gum_v8_module_handle_import_match (const GumImportDetails * details,
                                   gpointer user_data)
{
  GumV8ImportsContext * ctx =
      static_cast<GumV8ImportsContext *> (user_data);
  Isolate * isolate = ctx->isolate;
  Local<Context> jc = isolate->GetCurrentContext ();
  PropertyAttribute attrs =
      static_cast<PropertyAttribute> (ReadOnly | DontDelete);

  Local<Object> imp (ctx->imp->Clone ());

  switch (details->type)
  {
    case GUM_IMPORT_FUNCTION:
    {
      /* the default value in our template */
      break;
    }
    case GUM_IMPORT_VARIABLE:
    {
      Maybe<bool> success = imp->ForceSet (jc, ctx->type, ctx->variable, attrs);
      g_assert (success.IsJust ());
      break;
    }
    case GUM_IMPORT_UNKNOWN:
    {
      Maybe<bool> success = imp->Delete (jc, ctx->type);
      g_assert (success.IsJust ());
      break;
    }
    default:
    {
      g_assert_not_reached ();
      break;
    }
  }

  Maybe<bool> success = imp->ForceSet (jc,
      ctx->name,
      String::NewFromOneByte (isolate,
          reinterpret_cast<const uint8_t *> (details->name)),
      attrs);
  g_assert (success.IsJust ());

  if (details->module != NULL)
  {
    success = imp->ForceSet (jc,
        ctx->module,
        String::NewFromOneByte (isolate,
            reinterpret_cast<const uint8_t *> (details->module)),
        attrs);
    g_assert (success.IsJust ());
  }
  else
  {
    success = imp->Delete (jc, ctx->module);
    g_assert (success.IsJust ());
  }

  if (details->address != 0)
  {
    success = imp->ForceSet (jc,
        ctx->address,
        _gum_v8_native_pointer_new (GSIZE_TO_POINTER (details->address),
            ctx->self->core),
        attrs);
    g_assert (success.IsJust ());
  }
  else
  {
    success = imp->Delete (jc, ctx->address);
    g_assert (success.IsJust ());
  }

  Handle<Value> argv[] = {
    imp
  };
  Local<Value> result = ctx->on_match->Call (ctx->receiver, 1, argv);

  gboolean proceed = TRUE;
  if (!result.IsEmpty () && result->IsString ())
  {
    String::Utf8Value str (result);
    proceed = (strcmp (*str, "stop") != 0);
  }

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


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