本文整理汇总了C++中Local::Equals方法的典型用法代码示例。如果您正苦于以下问题:C++ Local::Equals方法的具体用法?C++ Local::Equals怎么用?C++ Local::Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Local
的用法示例。
在下文中一共展示了Local::Equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetState
void Window::SetState(Local<String> property, Local<Value> value, const AccessorInfo& info) {
NativeWindow *window = ObjectWrap::Unwrap<NativeWindow>(info.Holder());
Local<String> val = value->ToString();
if (val->Equals(String::New("normal"))) {
window->SetState(NW_STATE_NORMAL);
} else if (val->Equals(String::New("minimized"))) {
window->SetState(NW_STATE_MINIMIZED);
} else if (val->Equals(String::New("maximized"))) {
window->SetState(NW_STATE_MAXIMIZED);
} else if (val->Equals(String::New("fullscreen"))) {
window->SetState(NW_STATE_FULLSCREEN);
}
}
示例2: Equals
bool StringIMPL::Equals(char *value) const
{
Isolate::Scope isolate_scope(g_CurrentVM);
HandleScope handle_scope(g_CurrentVM);
Local<Context> context = v8::Local<v8::Context>::New(g_CurrentVM, g_GlobalContext);
Context::Scope context_scope(context);
Local<v8::String> compared = v8::String::NewFromUtf8(g_CurrentVM, value);
Local<v8::String> stringValue = Handle<v8::String>::New(g_CurrentVM, persisted_value);
return stringValue->Equals(compared);
}
示例3:
void
test_HandleScope() {
HandleScope outer;
Local<Value> v;
{
HandleScope inner;
v = inner.Close(String::New("hey"));
}
do_check_true(!v.IsEmpty());
Local<String> s = v->ToString();
do_check_true(!s.IsEmpty());
do_check_true(s->Equals(v));
}
示例4: while
void
V8Context::fill_prototype_stash(Handle<Object> prototype, HV* stash) {
HE *he;
while (he = hv_iternext(stash)) {
SV *key = HeSVKEY_force(he);
char *key_str = SvPV_nolen(key);
Local<String> name = String::New(key_str);
if (prototype->Has(name))
continue;
PerlFunctionData* pfd
= name->Equals(string_to_js) // we want to_js() to be called as a package function
? new PerlFunctionData(this, (SV*)GvCV(gv_fetchmethod(stash, key_str)))
: new PerlMethodData(this, key_str);
prototype->Set(name, pfd->object);
}
}