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


C++ VJSParms_callStaticFunction::GetContext方法代码示例

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


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

示例1: _getCurrentPath

void VJSRequireClass::_getCurrentPath (VJSParms_callStaticFunction &ioParms, void *)
{
	VJSGlobalObject	*globalObject	= ioParms.GetContext().GetGlobalObjectPrivateInstance();
	
	xbox_assert(globalObject != NULL);

	XBOX::VFilePath	*path	= (XBOX::VFilePath *) globalObject->GetSpecific(VJSContext::kURLSpecificKey);
	
	xbox_assert(path != NULL);

	XBOX::VFilePath	parent;

	if (!path->GetParent(parent)) {

		ioParms.ReturnString("/");

	} else {

		XBOX::VString	posixPath;

		parent.GetPosixPath(posixPath);

		ioParms.ReturnString(posixPath);

	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:26,代码来源:VJSModule.cpp

示例2: _unPromote

void VJSSession::_unPromote(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession)
{
	sLONG promotionToken = 0;
	ioParms.GetLongParam(1, &promotionToken);
	CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX'));
	inSession->UnPromoteFromToken(promotionToken, privileges);
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:7,代码来源:JsUAG.cpp

示例3: ClearInterval

void VJSTimer::ClearInterval (VJSParms_callStaticFunction &ioParms, VJSGlobalObject *inGlobalObject)
{
	VJSWorker	*worker;

	worker = VJSWorker::RetainWorker(ioParms.GetContext());
	VJSTimer::_ClearTimer(ioParms, worker, true);
	XBOX::ReleaseRefCountable<VJSWorker>(&worker);
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:8,代码来源:VJSTimer.cpp

示例4: SetTimeout

void VJSTimer::SetTimeout (VJSParms_callStaticFunction &ioParms, VJSGlobalObject *inGlobalObject)
{
	VJSWorker	*worker;

	worker = VJSWorker::RetainWorker(ioParms.GetContext());
	VJSTimer::_SetTimer(ioParms, worker, false);
	XBOX::ReleaseRefCountable<VJSWorker>(&worker);
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:8,代码来源:VJSTimer.cpp

示例5: _setEnabled

void VJSDataServiceCore::_setEnabled( VJSParms_callStaticFunction& ioParms, VDataService *inService)
{
	VRIAContext *riaContext = VRIAJSRuntimeContext::GetApplicationContextFromJSContext( ioParms.GetContext(), inService->GetApplication());

	bool enabled = false;
	if (ioParms.GetBoolParam( 1, &enabled))
	{
		inService->SetEnabled( enabled);
	}
}
开发者ID:rajeshpillai,项目名称:core-Wakanda,代码行数:10,代码来源:VJSDataServiceCore.cpp

示例6: buildArrFromGroups

VJSArray buildArrFromGroups(VJSParms_callStaticFunction& ioParms, CUAGGroupVector groups, const VString* filter)
{
	VJSArray groupArr(ioParms.GetContext());
	for (CUAGGroupVector::iterator cur = groups.begin(), end = groups.end(); cur != end; ++cur)
	{
		if (filter == nil)
		{
			groupArr.PushValue((*cur)->CreateJSGroupObject(ioParms.GetContext()));
		}
		else
		{
			VString s;
			(*cur)->GetName(s);
			if (s.CompareToSameKind_Like(filter) == CR_EQUAL)
				groupArr.PushValue((*cur)->CreateJSGroupObject(ioParms.GetContext()));
		}
	}

	return groupArr;
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:20,代码来源:JsUAG.cpp

示例7: buildArrFromUsers

VJSArray buildArrFromUsers(VJSParms_callStaticFunction& ioParms, CUAGUserVector& users, const VString* filter)
{
	VJSArray userArr(ioParms.GetContext());
	for (CUAGUserVector::iterator cur = users.begin(), end = users.end(); cur != end; ++cur)
	{
		if (filter == nil)
		{
			userArr.PushValue((*cur)->CreateJSUserObject(ioParms.GetContext()));
		}
		else
		{
			VString s;
			(*cur)->GetName(s);
			if (s.CompareToSameKind_Like(filter) == CR_EQUAL)
				userArr.PushValue((*cur)->CreateJSUserObject(ioParms.GetContext()));
		}
	}

	return userArr;
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:20,代码来源:JsUAG.cpp

示例8: do_include

void VJSGlobalClass::do_include( VJSParms_callStaticFunction& inParms, VJSGlobalObject *inGlobalObject)
{
	// EvaluateScript() uses NULL (this is default) as inThisObject argument. 
	// This works fine currently, but would it be better (if any problem) to pass global (application) object instead? 
	// See WAK0074064.

	VFile* file = inParms.RetainFileParam(1, false);
	if (file != NULL)
	{
		bool newlyRegistered = inGlobalObject->RegisterIncludedFile( file);		// sc 15/06/2010 the file must be registered
		if (inParms.GetBoolParam(2,"refresh","auto") || newlyRegistered)
		{
			inParms.GetContext().EvaluateScript( file, NULL, inParms.GetExceptionRefPointer());
		}
		file->Release();
	}
	else
	{
		VString pathname;
		if (inParms.IsStringParam(1) && inParms.GetStringParam( 1, pathname))
		{
			VFolder* folder = inGlobalObject->GetRuntimeDelegate()->RetainScriptsFolder();
			if (folder != NULL)
			{
				file = new VFile( *folder, pathname, FPS_POSIX);
				
				bool newlyRegistered = inGlobalObject->RegisterIncludedFile( file);		// sc 15/06/2010 the file must be registered
				if (inParms.GetBoolParam(2,"refresh","auto") || newlyRegistered)
				{
					inParms.GetContext().EvaluateScript( file, NULL, inParms.GetExceptionRefPointer());
				}
				ReleaseRefCountable( &file);
			}
			ReleaseRefCountable( &folder);
		}
		else
			vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:39,代码来源:VJSGlobalClass.cpp

示例9: _promoteWith

void VJSSession::_promoteWith(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession)
{
	sLONG promotionToken = 0;

	CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1);
	if (group != nil)
	{
		CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX'));
		promotionToken = inSession->PromoteIntoGroup(group, privileges);
	}

	QuickReleaseRefCountable(group);
	ioParms.ReturnNumber(promotionToken);
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:14,代码来源:JsUAG.cpp

示例10: _belongsTo

void VJSSession::_belongsTo(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession)
{
	bool ok = false;

	CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1);
	if (group != nil)
	{
		CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX'));
		ok = inSession->BelongsTo(group, privileges);
	}

	QuickReleaseRefCountable(group);
	ioParms.ReturnBool(ok);
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:14,代码来源:JsUAG.cpp

示例11: do_Require

void VJSGlobalClass::do_Require(VJSParms_callStaticFunction& ioParms, VJSGlobalObject *inGlobalObject)
{
	xbox_assert(inGlobalObject != NULL);

	XBOX::VString	className;

	if (ioParms.CountParams() != 1 || !ioParms.IsStringParam(1) || !ioParms.GetStringParam(1, className))

		vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");

	else

		ioParms.ReturnValue(inGlobalObject->Require(ioParms.GetContext(), className));
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:14,代码来源:VJSGlobalClass.cpp

示例12: _addGroup

void VJSDirectory::_addGroup(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
	VError err;
	VString groupname, fullname;
	ioParms.GetStringParam(1, groupname);
	ioParms.GetStringParam(2, fullname);
	CUAGGroup* group = inDirectory->AddOneGroup(groupname, fullname, err);
	if (group == nil)
		ioParms.ReturnNullValue();
	else
	{
		ioParms.ReturnValue(VJSGroup::CreateInstance(ioParms.GetContext(), group));
		group->Release();
	}
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:15,代码来源:JsUAG.cpp

示例13: do_testMe

void VJSGlobalClass::do_testMe( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
	VJSObject globalObject( inParms.GetContext().GetGlobalObject());
	
	VString functionName;
	inParms.GetStringParam( 1, functionName);
	
	std::vector<VJSValue> values;
	size_t count = inParms.CountParams();
	for( size_t i = 2 ; i <= count ; ++i)
		values.push_back( inParms.GetParamValue( i));

	VJSValue result( inParms.GetContextRef());
	bool ok = globalObject.CallMemberFunction( functionName, &values, &result, inParms.GetExceptionRefPointer());
	inParms.ReturnValue( result);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:16,代码来源:VJSGlobalClass.cpp

示例14: _addUser

void VJSDirectory::_addUser(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
	VError err;
	VString username, password, fullname;
	ioParms.GetStringParam(1, username);
	ioParms.GetStringParam(2, password);
	ioParms.GetStringParam(3, fullname);
	CUAGUser* user = inDirectory->AddOneUser(username, password, fullname, err);
	if (user == nil)
		ioParms.ReturnNullValue();
	else
	{
		ioParms.ReturnValue(VJSUser::CreateInstance(ioParms.GetContext(), user));
		user->Release();
	}
	
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:17,代码来源:JsUAG.cpp

示例15: _key

void VJSStorageClass::_key (VJSParms_callStaticFunction &ioParms, IJSStorageObject *inStorageObject)
{
	xbox_assert(inStorageObject != NULL);

	sLONG	index;

	if (ioParms.CountParams() && ioParms.IsNumberParam(1) && ioParms.GetLongParam(1, &index)) {

		XBOX::VJSValue	value(ioParms.GetContext());

		inStorageObject->GetKeyValue(index, &value);

		ioParms.ReturnValue(value);

	} else

		ioParms.ReturnNullValue();
}
开发者ID:sanyaade-mobiledev,项目名称:core-XToolbox,代码行数:18,代码来源:VJSWebStorage.cpp


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