本文整理汇总了C++中CFX_WideString::Equal方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::Equal方法的具体用法?C++ CFX_WideString::Equal怎么用?C++ CFX_WideString::Equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::Equal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FXJS_InitializeRuntime
void FXJS_InitializeRuntime(v8::Isolate* pIsolate,
IFXJS_Runtime* pFXRuntime,
IFXJS_Context* context,
v8::Global<v8::Context>& v8PersistentContext) {
v8::Isolate::Scope isolate_scope(pIsolate);
v8::HandleScope handle_scope(pIsolate);
v8::Global<v8::ObjectTemplate>& globalObjTemp =
_getGlobalObjectTemplate(pIsolate);
v8::Local<v8::Context> v8Context = v8::Context::New(
pIsolate, NULL,
v8::Local<v8::ObjectTemplate>::New(pIsolate, globalObjTemp));
v8::Context::Scope context_scope(v8Context);
FXJS_PerIsolateData::SetUp(pIsolate);
v8Context->SetAlignedPointerInEmbedderData(kPerContextDataIndex, pFXRuntime);
int maxID = CFXJS_ObjDefinition::MaxID(pIsolate);
for (int i = 0; i < maxID; ++i) {
CFXJS_ObjDefinition* pObjDef = CFXJS_ObjDefinition::ForID(pIsolate, i);
CFX_WideString ws = CFX_WideString(pObjDef->objName);
CFX_ByteString bs = ws.UTF8Encode();
v8::Local<v8::String> objName =
v8::String::NewFromUtf8(pIsolate, bs.c_str(),
v8::NewStringType::kNormal,
bs.GetLength()).ToLocalChecked();
if (pObjDef->objType == FXJS_DYNAMIC) {
// Document is set as global object, need to construct it first.
if (ws.Equal(L"Document")) {
v8Context->Global()
->GetPrototype()
->ToObject(v8Context)
.ToLocalChecked()
->SetAlignedPointerInInternalField(0, new CFXJS_PrivateData(i));
if (pObjDef->m_pConstructor)
pObjDef->m_pConstructor(context, v8Context->Global()
->GetPrototype()
->ToObject(v8Context)
.ToLocalChecked(),
v8Context->Global()
->GetPrototype()
->ToObject(v8Context)
.ToLocalChecked());
}
} else {
v8::Local<v8::Object> obj = FXJS_NewFxDynamicObj(pIsolate, context, i);
v8Context->Global()->Set(v8Context, objName, obj).FromJust();
pObjDef->m_StaticObj.Reset(pIsolate, obj);
}
}
v8PersistentContext.Reset(pIsolate, v8Context);
}
示例2: JS_InitialRuntime
void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Persistent<v8::Context>& v8PersistentContext)
{
v8::Isolate* isolate = (v8::Isolate*)pJSRuntime;
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope handle_scope(isolate);
v8::Persistent<v8::ObjectTemplate>& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime);
v8::Handle<v8::Context> v8Context = v8::Context::New(isolate, NULL, v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp));
v8::Context::Scope context_scope(v8Context);
v8::Handle<v8::External> ptr = v8::External::New(isolate, pFXRuntime);
v8Context->SetEmbedderData(1, ptr);
CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0);
if(!pArray) return;
for(int i=0; i<pArray->GetSize(); i++)
{
CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
CFX_WideString ws = CFX_WideString(pObjDef->objName);
CFX_ByteString bs = ws.UTF8Encode();
v8::Handle<v8::String> objName = v8::String::NewFromUtf8(isolate, bs.c_str(), v8::String::kNormalString, bs.GetLength());
if(pObjDef->objType == JS_DYNAMIC)
{
//Document is set as global object, need to construct it first.
if(ws.Equal(L"Document"))
{
CJS_PrivateData* pPrivateData = new CJS_PrivateData;
pPrivateData->ObjDefID = i;
v8Context->Global()->GetPrototype()->ToObject()->SetAlignedPointerInInternalField(0, pPrivateData);
if(pObjDef->m_pConstructor)
pObjDef->m_pConstructor(context, v8Context->Global()->GetPrototype()->ToObject(), v8Context->Global()->GetPrototype()->ToObject());
}
}
else
{
v8::Handle<v8::Object> obj = JS_NewFxDynamicObj(pJSRuntime, context, i);
v8Context->Global()->Set(objName, obj);
pObjDef->m_StaticObj.Reset(isolate, obj);
}
}
v8PersistentContext.Reset(isolate, v8Context);
}
示例3:
bool operator!=(const CFX_WideStringC& s1, const CFX_WideString& s2)
{
return !s2.Equal(s1);
}