Ejemplo n.º 1
0
void VJSSession::_getStorage( XBOX::VJSParms_getProperty& ioParms, CUAGSession* inSession)
{
	VString s;
	VJSSessionStorageObject* storage = inSession->GetStorageObject();
	if (storage != nil)
		ioParms.ReturnValue(VJSStorageClass::CreateInstance(ioParms.GetContextRef(), storage));
}
Ejemplo n.º 2
0
void VJSSession::_getUser( XBOX::VJSParms_getProperty& ioParms, CUAGSession* inSession)
{
	VString s;
	CUAGUser* user = inSession->RetainUser();
	if (user != nil)
		ioParms.ReturnValue(user->CreateJSUserObject(ioParms.GetContextRef()));
	QuickReleaseRefCountable(user);
}
Ejemplo n.º 3
0
void VJSUser::_getStorage( XBOX::VJSParms_getProperty& ioParms, CUAGUser* inUser)
{
	VJSSessionStorageObject* storage = inUser->RetainStorageObject();
	if (storage != nil)
	{
		ioParms.ReturnValue(VJSStorageClass::CreateInstance(ioParms.GetContextRef(), storage));
		storage->Release();
	}
}
void VJSImage::_getMeta( XBOX::VJSParms_getProperty& ioParms, VJSPictureContainer* inPict)
{
	VPicture* pic = inPict->GetPict();
	if (inPict->MetaInfoInited())
	{
		ioParms.ReturnValue(VJSValue(ioParms.GetContextRef(), inPict->GetMetaInfo()));
	}
	else if (pic != nil)
	{
		/*
		const VPictureData* picdata = pic->RetainNthPictData(1);
		if (picdata != nil)
		*/
		{
			//const VValueBag* metadata = picdata->RetainMetadatas();
			const VValueBag* metadata = inPict->RetainMetaBag();
			if (metadata != nil)
			{
				VString jsons;
				metadata->GetJSONString(jsons, JSON_UniqueSubElementsAreNotArrays);
				VJSJSON json(ioParms.GetContextRef());
				metadata->Release();

				VJSValue result(json.Parse(jsons));

				if (!result.IsUndefined())
				{
	#if 0
					// plante pour l'instant, il faut que je comprenne
					inPict->SetMetaInfo(result, ioParms.GetContextRef());
					ioParms.ReturnValue(VJSValue(ioParms.GetContextRef(), inPict->GetMetaInfo()));
	#else
					ioParms.ReturnValue(VJSValue(ioParms.GetContextRef(), result));
	#endif
				}
				else
					ioParms.ReturnNullValue();
			}
			//picdata->Release();
		}
	}
}