void VJSSession::_getStorage( XBOX::VJSParms_getProperty& ioParms, CUAGSession* inSession) { VString s; VJSSessionStorageObject* storage = inSession->GetStorageObject(); if (storage != nil) ioParms.ReturnValue(VJSStorageClass::CreateInstance(ioParms.GetContext(), storage)); }
void VJSSession::_getExpiration( XBOX::VJSParms_getProperty& ioParms, CUAGSession* inSession) { VTime exp; inSession->GetExpiration(exp); VJSValue exptime(ioParms.GetContext()); exptime.SetVValue(exp); ioParms.ReturnValue(exptime); }
void VJSSession::_getUser( XBOX::VJSParms_getProperty& ioParms, CUAGSession* inSession) { VString s; CUAGUser* user = inSession->RetainUser(); if (user != nil) ioParms.ReturnValue(user->CreateJSUserObject(ioParms.GetContext())); QuickReleaseRefCountable(user); }
void VJSUser::_getStorage( XBOX::VJSParms_getProperty& ioParms, CUAGUser* inUser) { VJSSessionStorageObject* storage = inUser->RetainStorageObject(); if (storage != nil) { ioParms.ReturnValue(VJSStorageClass::CreateInstance(ioParms.GetContext(), storage)); storage->Release(); } }
void VJSStorageClass::_GetProperty (XBOX::VJSParms_getProperty &ioParms, VJSStorageObject *inStorageObject) { xbox_assert(inStorageObject != NULL); XBOX::VString name; if (!ioParms.GetPropertyName(name)) ioParms.ReturnNullValue(); else if (name.EqualToUSASCIICString("length")) { XBOX::VJSValue length(ioParms.GetContext()); length.SetNumber(inStorageObject->NumberKeysValues()); ioParms.ReturnValue(length); } else { XBOX::VJSValue value(ioParms.GetContext()); value.SetNull(); sLONG i; for (i = 0; i < kNumberMethods; i++) if (name.EqualToUSASCIICString(kMethodNames[i])) { ioParms.ForwardToParent(); break; } if (i == kNumberMethods) { inStorageObject->GetKeyValue(name, &value); ioParms.ReturnValue(value); } } }
void VJSDirectory::_getInternalStore( XBOX::VJSParms_getProperty& ioParms, CUAGDirectory* inDirectory) { CDB4DBase* base = inDirectory->RetainAndExposeDB(); if (base != NULL) { ioParms.ReturnValue(base->CreateJSDatabaseObject(ioParms.GetContext())); ReleaseRefCountable( &base); // sc 20/06/2012 } else ioParms.ReturnNullValue(); }