本文整理汇总了C++中AccessorInfo::Holder方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessorInfo::Holder方法的具体用法?C++ AccessorInfo::Holder怎么用?C++ AccessorInfo::Holder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessorInfo
的用法示例。
在下文中一共展示了AccessorInfo::Holder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTiObjectFromJsObject
/* Call back for V8 named properties. This is the entry point for setting
* properties from js. We handle the properties we know and let V8 handle
* all other properties.
*/
Handle<Value> TiObject::_propSetter(Local<String> prop, Local<Value> value, const AccessorInfo& info)
{
HandleScope handleScope;
Handle<Object> result;
TiObject* obj = getTiObjectFromJsObject(info.Holder());
if (obj == NULL)
{
// We are not tracking this object so let V8 handle it.
info.Holder()->ForceSet(prop, value);
return value;
}
return obj->setPropHelper(*String::Utf8Value(prop), value, &TiObject::setValue);
}
示例2: getTiObjectFromJsObject
/* Call back for V8 named properties. This is the entry point for accessing
* properties from js. We handle the properties we know and let V8 handle
* all other properties.
*/
Handle<Value> TiObject::_propGetter(Local<String> prop, const AccessorInfo& info)
{
HandleScope handleScope;
Handle<Object> result;
TiObject* obj = getTiObjectFromJsObject(info.Holder());
if (obj == NULL)
{
// Returns "empty". This will cause V8 to go back to default lookup.
return result;
}
Handle<ObjectTemplate> global = getObjectTemplateFromJsObject(info.Holder());
String::Utf8Value propName(prop);
const char* propString = (const char*)(*propName);
TiObject* propObject = obj->onLookupMember(propString);
if (propObject == NULL)
{
// TODO: Fix the following block of commented out code. Currently it breaks
// Titanium runtime.
/*
if(obj->canAddMembers())
{
// If we're allowed to add members, return an "empty" result
// so V8 will handle it. V8 will set the value internally so
// we can ignore non-Titanium objects.
return result;
}
*/
return Handle<Value>();
}
Handle<Value> ret = propObject->getValue();
if (!ret.IsEmpty())
{
return handleScope.Close(ret);
}
if ((propObject->hasMembers()) || (propObject->isFunction()))
{
result = global->NewInstance();
propObject->setValue(result);
setTiObjectToJsObject(result, propObject);
}
else
{
propObject->release();
return handleScope.Close(propObject->getValue());
}
propObject->release();
return handleScope.Close(result);
}
示例3: nroSetter
/* Generic setter for all NdbRecordObjects
*/
void nroSetter(Local<String>, Local<Value> value, const AccessorInfo& info)
{
NdbRecordObject * nro =
static_cast<NdbRecordObject *>(info.Holder()->GetPointerFromInternalField(1));
int nField = info.Data()->Int32Value();
nro->setField(nField, value);
}
示例4: New
Handle<Value> get_classification(Local<String> property, const AccessorInfo &info) {
const NdbError *err = unwrapPointer<const NdbError *>(info.Holder());
switch(err->classification) {
MAP_CODE(NoError);
MAP_CODE(ApplicationError);
MAP_CODE(NoDataFound);
MAP_CODE(ConstraintViolation);
MAP_CODE(SchemaError);
MAP_CODE(UserDefinedError);
MAP_CODE(InsufficientSpace);
MAP_CODE(TemporaryResourceError);
MAP_CODE(NodeRecoveryError);
MAP_CODE(OverloadError);
MAP_CODE(TimeoutExpired);
MAP_CODE(UnknownResultError);
MAP_CODE(InternalError);
MAP_CODE(FunctionNotImplemented);
MAP_CODE(UnknownErrorCode);
MAP_CODE(NodeShutdown);
MAP_CODE(SchemaObjectExists);
MAP_CODE(InternalTemporary);
}
return String::New("-unknown-");
}
示例5:
Handle<Value> ODBCResult::FetchModeGetter(Local<String> property, const AccessorInfo &info) {
HandleScope scope;
ODBCResult *obj = ObjectWrap::Unwrap<ODBCResult>(info.Holder());
return scope.Close(Integer::New(obj->m_fetchMode));
}
示例6: setter_enabled
void PushbotsModule::setter_enabled(Local<String> property, Local<Value> value, const AccessorInfo& info)
{
LOGD(TAG, "set enabled");
HandleScope scope;
JNIEnv *env = titanium::JNIScope::getEnv();
if (!env) {
LOGE(TAG, "Failed to get environment, enabled wasn't set");
return;
}
static jmethodID methodID = NULL;
if (!methodID) {
methodID = env->GetMethodID(PushbotsModule::javaClass, "setEnabled", "(Ljava/lang/Boolean;)V");
if (!methodID) {
const char *error = "Couldn't find proxy method 'setEnabled' with signature '(Ljava/lang/Boolean;)V'";
LOGE(TAG, error);
}
}
titanium::Proxy* proxy = titanium::Proxy::unwrap(info.Holder());
if (!proxy) {
return;
}
jvalue jArguments[1];
bool isNew_0;
if (!value->IsNull()) {
Local<Value> arg_0 = value;
jArguments[0].l =
titanium::TypeConverter::jsValueToJavaObject(env, arg_0, &isNew_0);
} else {
jArguments[0].l = NULL;
}
jobject javaProxy = proxy->getJavaObject();
env->CallVoidMethodA(javaProxy, methodID, jArguments);
if (!JavaObject::useGlobalRefs) {
env->DeleteLocalRef(javaProxy);
}
if (isNew_0) {
env->DeleteLocalRef(jArguments[0].l);
}
if (env->ExceptionCheck()) {
titanium::JSException::fromJavaException();
env->ExceptionClear();
}
}
示例7: SetStmtCacheSize
/*
DESCRIPTION
Set Accessor of stmtCacheSize property
*/
void Oracledb::SetStmtCacheSize ( Local<String> property, Local<Value> value,
const AccessorInfo& info)
{
HandleScope scope;
Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
NJS_SET_PROP_UINT(oracledb->stmtCacheSize_, value, "stmtCacheSize");
}
示例8: PropertySetter
void MSMap::PropertySetter (Local<String> property, Local<Value> value, const AccessorInfo& info) {
MSMap *map = ObjectWrap::Unwrap<MSMap>(info.Holder());
v8::String::AsciiValue n(property);
if (strcmp(*n, "width") == 0) {
map->this_->width = value->Int32Value();
} else if (strcmp(*n, "height") == 0) {
map->this_->height = value->Int32Value();
} else if (strcmp(*n, "maxsize") == 0) {
map->this_->maxsize = value->Int32Value();
} else if (strcmp(*n, "units") == 0) {
int32_t units = value->Int32Value();
if (units >= MS_INCHES && units <= MS_NAUTICALMILES) {
map->this_->units = (MS_UNITS) units;
}
} else if (strcmp(*n, "resolution") == 0) {
map->this_->resolution = value->NumberValue();
} else if (strcmp(*n, "defresolution") == 0) {
map->this_->defresolution = value->NumberValue();
} else if (strcmp(*n, "name") == 0) {
REPLACE_STRING(map->this_->name, value);
} else if (strcmp(*n, "imagetype") == 0) {
REPLACE_STRING(map->this_->imagetype, value);
} else if (strcmp(*n, "shapepath") == 0) {
REPLACE_STRING(map->this_->shapepath, value);
} else if (strcmp(*n, "projection") == 0) {
v8::String::AsciiValue _v_(value->ToString());
msLoadProjectionString(&(map->this_->projection), *_v_);
} else if (strcmp(*n, "mappath") == 0) {
REPLACE_STRING(map->this_->mappath, value);
}
}
示例9: SetOutFormat
/*
DESCRIPTION
Set Accessor of outFormat property
*/
void Oracledb::SetOutFormat ( Local<String> property, Local<Value> value,
const AccessorInfo& info )
{
HandleScope scope;
Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
NJS_SET_PROP_UINT(oracledb->outFormat_, value, "outFormat");
}
示例10: SetIsExternalAuth
/*
DESCRIPTION
Set Accessor of isExternalAuth property
*/
void Oracledb::SetIsExternalAuth(Local<String> property, Local<Value> value,
const AccessorInfo& info )
{
HandleScope scope;
Oracledb* oracledb = ObjectWrap::Unwrap<Oracledb>(info.Holder());
oracledb->isExternalAuth_ = value->ToBoolean()->Value();
}
示例11: Undefined
Handle<Value> Proxy::setIndexedProperty(uint32_t index, Local<Value> value, const AccessorInfo& info)
{
JNIEnv* env = JNIScope::getEnv();
if (!env) {
LOG_JNIENV_GET_ERROR(TAG);
return Undefined();
}
Proxy* proxy = NativeObject::Unwrap<Proxy>(info.Holder());
bool javaValueIsNew;
jobject javaValue = TypeConverter::jsValueToJavaObject(value, &javaValueIsNew);
jobject javaProxy = proxy->getJavaObject();
env->CallVoidMethod(javaProxy,
JNIUtil::krollProxySetIndexedPropertyMethod,
index,
javaValue);
if (!JavaObject::useGlobalRefs) {
env->DeleteLocalRef(javaProxy);
}
if (javaValueIsNew) {
env->DeleteLocalRef(javaValue);
}
return value;
}
示例12: nroGetter
/* Generic getter for all NdbRecordObjects
*/
Handle<Value> nroGetter(Local<String>, const AccessorInfo & info)
{
NdbRecordObject * nro =
static_cast<NdbRecordObject *>(info.Holder()->GetPointerFromInternalField(1));
int nField = info.Data()->Int32Value();
return nro->getField(nField);
}
示例13:
Handle<Value> PDFHexStringDriver::GetValue(Local<String> property,const AccessorInfo &info)
{
HandleScope scope;
Handle<String> result = String::New(ObjectWrap::Unwrap<PDFHexStringDriver>(info.Holder())->TheObject->GetValue().c_str());
return scope.Close(result);
}
示例14:
Handle<Value> Ti::TiProxy::_Setter (Local<String> property, Local<Value> value, const AccessorInfo& info)
{
HandleScope handleScope;
// Ti::TiHelper::LogInternal(QString("Property Setter: ").append(Ti::TiHelper::QStringFromValue(property)));
// Todo: Come back to this later
// if(value == info.Holder()->Get(property)) {
// Ti::TiHelper::LogInternal(QString("Already set: ").append(Ti::TiHelper::QStringFromValue(property)));
// return value;
// }
Handle<Object> obj = Handle<Object>::Cast(info.Holder());
// Todo: come back to this - might not be allowing GC to collect proxies
obj->ForceSet(property, value);
// for example. scrollView.views = [a,b,c]
// scrollView.remove(a) <--- removed from view, but still in array
Handle<External> proxyObject = Handle<External>::Cast(obj->GetHiddenValue(String::New("module")));
if(proxyObject.IsEmpty())
proxyObject = Handle<External>::Cast(obj->GetHiddenValue(String::New("proxy")));
if(proxyObject.IsEmpty())
return value;
Ti::TiProxy* tiProxy = static_cast<Ti::TiProxy*>(proxyObject->Value());
if(tiProxy->properties.contains(Ti::TiHelper::QStringFromValue(property)))
{
Ti::TiProperty *prop = tiProxy->properties[Ti::TiHelper::QStringFromValue(property)];
return handleScope.Close(prop->setValue(value));
}
return value;
}
示例15: ThrowException
Handle<Value> Geometry::GetSRID(Local<String> name, const AccessorInfo& info)
{
Geometry *geom = ObjectWrap::Unwrap<Geometry>(info.Holder());
const int srid = GEOSGetSRID(geom->geos_geom_);
if (srid == 0)
return ThrowException(String::New("couldn't get SRID (maybe it wasn't set)"));
return Integer::New(srid);
}