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