Пример #1
0
void VJSDirectory::_save(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
	VFile* dest = ioParms.RetainFileParam(1);

	if (dest != nil || ioParms.CountParams() == 0)

		ioParms.ReturnBool(inDirectory->Save(dest) == VE_OK);

	else {
		
		XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
		ioParms.ReturnBool(false);

	}

	QuickReleaseRefCountable(dest);
}
void VJSTextStream::_End (VJSParms_callStaticFunction &ioParms, VJSTextStreamState *inStreamState)
{
	if (inStreamState != NULL && inStreamState->fStream->IsReading())

		ioParms.ReturnBool(!inStreamState->fBuffer.GetLength() 
		&& inStreamState->fStream->GetSize() <= inStreamState->fStream->GetPos());

	else

		XBOX::vThrowError(XBOX::VE_JVSC_INVALID_STATE, L"TextStream.end()");
}
Пример #3
0
void VJSSession::_belongsTo(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession)
{
	bool ok = false;

	CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1);
	if (group != nil)
	{
		ok = inSession->BelongsTo(group);
	}

	QuickReleaseRefCountable(group);
	ioParms.ReturnBool(ok);
}
Пример #4
0
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);
}
Пример #5
0
void VJSSession::_checkPermission(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession)
{
	bool ok = false;

	CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1);
	if (group != nil)
	{
		ok = inSession->BelongsTo(group);
	}

	if (!ok)
	{
		VString groupName;
		if (group != nil)
			group->GetName(groupName);
		ThrowError(VE_UAG_SESSION_FAILED_PERMISSION, groupName);
	}

	QuickReleaseRefCountable(group);
	ioParms.ReturnBool(ok);
}
Пример #6
0
void VJSSession::_checkPermission(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);
	}

	if (!ok)
	{
		VString groupName;
		if (group != nil)
			group->GetName(groupName);
		ThrowError(VE_UAG_SESSION_FAILED_PERMISSION, groupName);
	}

	QuickReleaseRefCountable(group);
	ioParms.ReturnBool(ok);
}
void VJSStream::_IsByteSwapping(VJSParms_callStaticFunction& ioParms, VStream* inStream)
{
	ioParms.ReturnBool(inStream->NeedSwap());
}
Пример #8
0
void VJSStorageClass::_tryLock (VJSParms_callStaticFunction &ioParms, VJSStorageObject *inStorageObject)
{
	xbox_assert(inStorageObject != NULL);

	ioParms.ReturnBool(inStorageObject->TryLock());
}
Пример #9
0
void VJSDirectory::_hasAdministrator(VJSParms_callStaticFunction& ioParms, CUAGDirectory* inDirectory)
{
	ioParms.ReturnBool(! inDirectory->NoAdmin());
}