本文整理汇总了C++中xbox::VJSParms_callStaticFunction类的典型用法代码示例。如果您正苦于以下问题:C++ VJSParms_callStaticFunction类的具体用法?C++ VJSParms_callStaticFunction怎么用?C++ VJSParms_callStaticFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VJSParms_callStaticFunction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _getParents
void VJSGroup::_getParents( XBOX::VJSParms_callStaticFunction& ioParms, CUAGGroup* inGroup)
{
bool firstlevel = ioParms.GetBoolParam(1, "firstLevel", "allLevels");
CUAGGroupVector groups;
inGroup->RetainOwners(groups, firstlevel);
ioParms.ReturnValue(buildArrFromGroups(ioParms, groups, nil));
}
示例2: _save
void VJSImage::_save(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
VPictureCodecFactoryRef fact;
const VPictureCodec* encoder = nil;
bool ok = false;
VPicture* pic = inPict->GetPict();
if (pic != nil)
{
VFile* file = ioParms.RetainFileParam(1);
if (file != nil)
{
VString mimetype;
ioParms.GetStringParam(2, mimetype);
if (mimetype.IsEmpty())
{
VString extension;
file->GetExtension(extension);
if (extension.IsEmpty())
extension = L"pic";
encoder = fact->RetainEncoderForExtension(extension);
}
else
encoder = fact->RetainEncoderByIdentifier(mimetype);
if (encoder != nil)
{
VError err = VE_OK;
if (file->Exists())
err = file->Delete();
if (err == VE_OK)
{
VValueBag *pictureSettings = nil;
VValueBag *bagMetas = (VValueBag*)inPict->RetainMetaBag();
if (bagMetas != nil)
{
pictureSettings = new VValueBag();
ImageEncoding::stWriter settingsWriter(pictureSettings);
VValueBag *bagRetained = settingsWriter.CreateOrRetainMetadatas( bagMetas);
if (bagRetained)
bagRetained->Release();
}
err=encoder->Encode(*pic, pictureSettings, *file);
QuickReleaseRefCountable(bagMetas);
QuickReleaseRefCountable(pictureSettings);
if (err == VE_OK)
ok = true;
}
encoder->Release();
}
file->Release();
}
else
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_FILE, "1");
}
ioParms.ReturnBool(ok);
}
示例3: _getUsers
void VJSGroup::_getUsers( XBOX::VJSParms_callStaticFunction& ioParms, CUAGGroup* inGroup)
{
bool firstlevel = ioParms.GetBoolParam(1, "firstLevel", "allLevels");
CUAGUserVector users;
inGroup->RetainUsers(users, firstlevel);
ioParms.ReturnValue(buildArrFromUsers(ioParms, users, nil));
}
示例4: _filterParents
void VJSGroup::_filterParents( XBOX::VJSParms_callStaticFunction& ioParms, CUAGGroup* inGroup)
{
VString s;
ioParms.GetStringParam(1,s);
s.AppendUniChar(ioParms.GetWildChar());
CUAGGroupVector groups;
bool firstlevel = ioParms.GetBoolParam(2, "firstLevel", "allLevels");
inGroup->RetainOwners(groups, firstlevel);
ioParms.ReturnValue(buildArrFromGroups(ioParms, groups, &s));
}
示例5: _Send
void VJSXMLHttpRequest::_Send(XBOX::VJSParms_callStaticFunction& ioParms, XMLHttpRequest* inXhr)
{
XBOX::VString pData;
bool resData;
resData=ioParms.GetStringParam(1, pData);
if(inXhr) //Data is optional, we don't care if it's not set
{
XBOX::VError impl_err=XBOX::VE_OK;
XBOX::VError res=inXhr->Send(pData, &impl_err);
if(res!=XBOX::VE_OK)
{
uLONG code=ERRCODE_FROM_VERROR(impl_err);
uLONG comp=COMPONENT_FROM_VERROR(impl_err);
//XBOX::VErrorBase* verrBase = new XBOX::VErrorBase ( impl_err, 0 );
//XBOX::VTask::GetCurrent ( )-> PushRetainedError ( verrBase );
//We may have an implementation error which might be documented
if(impl_err!=XBOX::VE_OK)
XBOX::vThrowError(impl_err);
//Now throw the more generic error
XBOX::vThrowError(res);
}
}
else
XBOX::vThrowError(VE_XHRQ_JS_BINDING_ERROR);
}
示例6: _IsRunning
void VJSSharedWorkerClass::_IsRunning (XBOX::VJSParms_callStaticFunction &ioParms, void *)
{
XBOX::VString url, name;
if (!ioParms.GetStringParam(1, url))
XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "1");
else if (!ioParms.GetStringParam(2, name))
XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_STRING, "2");
else
ioParms.ReturnBool(VJSWorker::IsSharedWorkerRunning(url, name));
}
示例7: _setPublishGlobalNamespace
void VJSRPCServiceCore::_setPublishGlobalNamespace( XBOX::VJSParms_callStaticFunction& ioParms, VRPCService *inService)
{
bool publishGlobalNamespace = false;
if (ioParms.GetBoolParam( 1, &publishGlobalNamespace))
{
inService->SetPublishInClientGlobalNamespace( publishGlobalNamespace);
}
}
示例8: _setPatternForProxy
void VJSRPCServiceCore::_setPatternForProxy( XBOX::VJSParms_callStaticFunction& ioParms, VRPCService *inService)
{
VString pattern;
if (ioParms.GetStringParam( 1, pattern))
{
inService->SetPatternForProxy( pattern);
}
}
示例9: _thumbnail
void VJSImage::_thumbnail(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
bool ok = true;
if (!ioParms.IsNumberParam(1))
{
ok = false;
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
}
if (!ioParms.IsNumberParam(2))
{
ok = false;
vThrowError(VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "2");
}
VPicture* pic = inPict->GetPict();
if (pic != nil && ok)
{
sLONG w = 0, h = 0, mode = 0;
ioParms.GetLongParam(1, &w);
ioParms.GetLongParam(2, &h);
ioParms.GetLongParam(3, &mode);
if (w == 0)
w = 300;
if (h == 0)
h = 300;
if (mode == 0)
mode = 4;
VPicture* thumb = pic->BuildThumbnail(w, h, (PictureMosaic)mode);
if (thumb != nil)
{
VPictureCodecFactoryRef fact;
VPicture* thumb2 = new VPicture();
VError err = fact->Encode(*thumb, L".jpg", *thumb2, nil);
if (err == VE_OK)
{
/*
VJSPictureContainer* pictContains = new VJSPictureContainer(thumb2, true, ioParms.GetContextRef());
ioParms.ReturnValue(VJSImage::CreateInstance(ioParms.GetContextRef(), pictContains));
pictContains->Release();
*/
ioParms.ReturnVValue(*thumb2);
delete thumb2;
}
else
{
delete thumb2;
ioParms.ReturnNullValue();
}
delete thumb;
}
else
ioParms.ReturnNullValue();
}
else
ioParms.ReturnNullValue();
}
示例10: _SetRequestHeader
void VJSXMLHttpRequest::_SetRequestHeader(XBOX::VJSParms_callStaticFunction& ioParms, XMLHttpRequest* inXhr)
{
XBOX::VString pHeader;
XBOX::VString pValue;
bool resHeader=ioParms.GetStringParam(1, pHeader);
bool resValue=ioParms.GetStringParam(2, pValue);
if(resHeader && resValue && inXhr)
{
XBOX::VError res=inXhr->SetRequestHeader(pHeader, pValue);
if(res!=XBOX::VE_OK)
XBOX::vThrowError(res);
}
else
XBOX::vThrowError(VE_XHRQ_JS_BINDING_ERROR);
}
示例11: Address
void VJSNetServerObject::Address(XBOX::VJSParms_callStaticFunction &ioParms, VJSNetServerObject *inServer)
{
xbox_assert(inServer != NULL);
XBOX::VJSObject object(ioParms.GetContext());
object.MakeEmpty();
object.SetProperty("address", inServer->fAddress);
object.SetProperty("port", inServer->fPort);
}
示例12: _getPath
void VJSImage::_getPath(XBOX::VJSParms_callStaticFunction& ioParms, VJSPictureContainer* inPict)
{
VPicture* pic = inPict->GetPict();
if (pic != nil)
{
VString path;
pic->GetOutsidePath(path);
ioParms.ReturnString(path);
}
}
示例13: _terminate
void VJSDedicatedWorkerClass::_terminate (XBOX::VJSParms_callStaticFunction &ioParms, VJSWebWorkerObject *inDedicatedWorker)
{
xbox_assert(inDedicatedWorker != NULL);
VJSWorker *outsideWorker = VJSWorker::RetainWorker(ioParms.GetContext());
VJSWorker *insideWorker = inDedicatedWorker->fOnMessagePort->GetOther(outsideWorker);
insideWorker->Terminate();
XBOX::ReleaseRefCountable<VJSWorker>(&outsideWorker);
}
示例14: PostMessageMethod
void VJSMessagePort::PostMessageMethod (XBOX::VJSParms_callStaticFunction &ioParms, VJSMessagePort *inMessagePort)
{
xbox_assert(inMessagePort != NULL);
if (ioParms.CountParams() < 1) {
XBOX::vThrowError(XBOX::VE_INVALID_PARAMETER);
return;
}
VJSWorker *worker = VJSWorker::RetainWorker(ioParms.GetContext());
XBOX::VJSValue value = ioParms.GetParamValue(1);
VJSStructuredClone *message = VJSStructuredClone::RetainClone(value);
inMessagePort->PostMessage(inMessagePort->GetOther(worker), message);
XBOX::ReleaseRefCountable<VJSStructuredClone>(&message);
XBOX::ReleaseRefCountable<VJSWorker>(&worker);
}
示例15: _pause
void VJSNetServerClass::_pause (XBOX::VJSParms_callStaticFunction &ioParms, VJSNetServerObject *inServer)
{
xbox_assert(inServer != NULL);
sLONG waitingTime; // In milliseconds.
if (!ioParms.CountParams())
waitingTime = 1;
else if (ioParms.CountParams() != 1 || !ioParms.IsNumberParam(1) || !ioParms.GetLongParam(1, &waitingTime)) {
XBOX::vThrowError(XBOX::VE_JVSC_WRONG_PARAMETER_TYPE_NUMBER, "1");
return;
}
// Need support from VTCPConnectionListener.
XBOX::vThrowError(XBOX::VE_JVSC_UNSUPPORTED_FUNCTION, "net.Server.pause()");
}