本文整理汇总了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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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));
}
示例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");
}
示例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");
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}