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


C++ VJSParms_callStaticFunction类代码示例

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


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

示例1: do_BinaryStream

void VJSStream::do_BinaryStream(VJSParms_callStaticFunction& ioParms)
{
	VFile* file = ioParms.RetainFileParam( 1);
	bool forwrite = ioParms.GetBoolParam( 2, L"Write", L"Read");
	if (file != NULL)
	{
		VError err = VE_OK;
		if (forwrite)
		{
			if (!file->Exists())
				err = file->Create();
		}
		VFileStream* stream = new VFileStream(file);
		if (err == VE_OK)
		{
			if (forwrite)
				err = stream->OpenWriting();
			else
				err = stream->OpenReading();
		}
		
		if (err == VE_OK)
		{
			ioParms.ReturnValue(VJSStream::CreateInstance(ioParms.GetContextRef(), stream));
		}
		else
		{
			delete stream;
		}
	}
	else
		vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
	ReleaseRefCountable( &file);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:34,代码来源:VJSRuntime_stream.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: _GetResult

void VJSLanguageSyntaxTesterDefinitionResults::_GetResult( VJSParms_callStaticFunction &ioParams, IJSLanguageSyntaxTesterDefinitionResults *inResults )
{
	if (inResults) {
		sLONG index;
		if (ioParams.GetLongParam( 1, &index ))
		{
			IDefinition definition = inResults->GetResult( index );
			VJSObject	result(ioParams.GetContextRef());
			VJSValue	jsval(ioParams.GetContextRef());

			result.MakeEmpty();

			jsval.SetString( definition.GetName() );
			result.SetProperty(L"name", jsval, JS4D::PropertyAttributeNone);

			jsval.SetString( definition.GetFilePath() );
			result.SetProperty(L"file", jsval, JS4D::PropertyAttributeNone);

			jsval.SetNumber( definition.GetLineNumber() + 1 );
			result.SetProperty(L"line", jsval, JS4D::PropertyAttributeNone);

			ioParams.ReturnValue(result);
		}
	}
}
开发者ID:sanyaade-mobiledev,项目名称:core-Components,代码行数:25,代码来源:LanguageSyntax.cpp

示例4: _ClearTimer

void VJSTimer::_ClearTimer (VJSParms_callStaticFunction &ioParms, VJSWorker *inWorker, bool inIsInterval) 
{
	xbox_assert(inWorker != NULL);

	if (!ioParms.CountParams() || !ioParms.IsNumberParam(1))

		return;
		
	sLONG			id;
	XBOX::VJSTimer	*timer;

	ioParms.GetLongParam(1, &id);
	if ((timer = inWorker->GetTimerContext()->LookUpTimer(id)) == NULL)

		return;	// No timer with given ID found.

	if (timer->IsInterval() != inIsInterval)

		return;	// Mismatched call (cannot used clearInterval() to clear a timeout for example).

	// Mark timer as "cleared".

	timer->_Clear();	

	// This will loop the event queue, trying to find the VJSTimerEvent.
	//
	// If the clearTimeout() or clearInterval() is executed inside "itself" (in its callback),
	// this will do nothing. The event is already executing, but as the timer is marked as 
	// "cleared", VJSTimerEvent::Discard() will free it.
	//
	// Otherwise, the loop will find the VJSTimerEvent object, calling its Discard() and thus 
	// freeing the timer.
	
	inWorker->UnscheduleTimer(timer);
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:35,代码来源:VJSTimer.cpp

示例5: _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

示例6: do_isoToDate

void VJSGlobalClass::do_isoToDate(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
	VTime dd;
	VString s;
	ioParms.GetStringParam(1, s);
	dd.FromJSONString(s);
	ioParms.ReturnTime(dd);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:8,代码来源:VJSGlobalClass.cpp

示例7: _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

示例8: _removeItem

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

	XBOX::VString	name;

	if (ioParms.CountParams() && ioParms.IsStringParam(1) && ioParms.GetStringParam(1, name))

		inStorageObject->RemoveKeyValue(name);
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:10,代码来源:VJSWebStorage.cpp

示例9: _filterGroups

void VJSDirectory::_filterGroups(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
	VString s;
	bool isquery = false;
	ioParms.GetStringParam(1, s);
	isquery = ioParms.GetBoolParam(2, "query", "not query");
	CUAGGroupVector groups;
	VError err = inDirectory->FilterGroups(s, isquery, groups);

	ioParms.ReturnValue(buildArrFromGroups(ioParms, groups, nil));
}
开发者ID:StephaneH,项目名称:core-Components,代码行数:11,代码来源:JsUAG.cpp

示例10: _PutString

void VJSStream::_PutString(VJSParms_callStaticFunction& ioParms, VStream* inStream)
{
	VString s;
	if (ioParms.IsStringParam(1))
	{
		ioParms.GetStringParam(1, s);
		VError err = s.WriteToStream(inStream);
	}
	else
		vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:11,代码来源:VJSRuntime_stream.cpp

示例11: _PutReal

void VJSStream::_PutReal(VJSParms_callStaticFunction& ioParms, VStream* inStream)
{
	Real r = 0;
	if (ioParms.IsNumberParam(1))
	{
		ioParms.GetRealParam(1, &r);
		VError err = inStream->PutReal(r);
	}
	else
		vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:11,代码来源:VJSRuntime_stream.cpp

示例12: do_trace

void VJSGlobalClass::do_trace( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
	size_t count = inParms.CountParams();
	for( size_t i = 1 ; i <= count ; ++i)	
	{
		VString msg;
		bool ok = inParms.GetStringParam( i, msg);
		if (!ok)
			break;
		VDebugMgr::Get()->DebugMsg( msg);
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:12,代码来源:VJSGlobalClass.cpp

示例13: do_GetProgressIndicator

void VJSGlobalClass::do_GetProgressIndicator(VJSParms_callStaticFunction& ioParms, VJSGlobalObject *inContext)
{
	if (ioParms.IsStringParam(1))
	{
		VString userinfo;
		ioParms.GetStringParam(1, userinfo);
		VProgressIndicator* progress = VProgressManager::RetainProgressIndicator(userinfo);
		if (progress != nil)
			ioParms.ReturnValue(VJSProgressIndicator::CreateInstance(ioParms.GetContextRef(), progress));
		QuickReleaseRefCountable(progress);
	}
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:12,代码来源:VJSGlobalClass.cpp

示例14: do_displayNotification

void VJSGlobalClass::do_displayNotification( VJSParms_callStaticFunction& inParms, VJSGlobalObject*)
{
	VString message;
	inParms.GetStringParam( 1, message);
	
	VString title( "Notification");
	inParms.GetStringParam( 2, title);
	
	bool critical = false;
	inParms.GetBoolParam( 3, &critical);

	VSystem::DisplayNotification( title, message, critical ? EDN_StyleCritical : 0);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:13,代码来源:VJSGlobalClass.cpp

示例15: do_dateToIso

void VJSGlobalClass::do_dateToIso(VJSParms_callStaticFunction& ioParms, VJSGlobalObject*)
{
	VString s;
	VJSValue jsval(ioParms.GetContextRef());
	if (ioParms.CountParams() > 0)
	{
		VTime dd;
		jsval = ioParms.GetParamValue(1);
		jsval.GetTime(dd);
		dd.GetJSONString(s);
	}
	ioParms.ReturnString(s);
}
开发者ID:sanyaade-webdev,项目名称:core-XToolbox,代码行数:13,代码来源:VJSGlobalClass.cpp


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